mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
pull
This commit is contained in:
+30
-9
@@ -5,31 +5,37 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
|
||||
/**
|
||||
* Class Address
|
||||
* @package App\Models
|
||||
* @version August 4, 2020, 4:36 am
|
||||
*
|
||||
* @property \App\Models\Company company
|
||||
* @property \App\Models\Country country_id
|
||||
* @property \App\Models\Company company_id
|
||||
* @property \App\Models\State state_id
|
||||
* @property \App\Models\District district_id
|
||||
* @property string postcode
|
||||
* @property string street_one
|
||||
* @property string street_two
|
||||
* @property string city
|
||||
* @property string state
|
||||
* @property string post_code
|
||||
* @property string country
|
||||
* @property integer billing_type
|
||||
*/
|
||||
class Address extends AbstractModel
|
||||
{
|
||||
|
||||
use SoftDeletes;
|
||||
|
||||
|
||||
protected $table = 'addresses';
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
/**
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
**/
|
||||
public function country(): HasOne
|
||||
{
|
||||
return $this->hasOne(Country::class, 'country_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
**/
|
||||
public function company(): HasOne
|
||||
@@ -37,4 +43,19 @@ class Address extends AbstractModel
|
||||
return $this->hasOne(Company::class, 'company_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
**/
|
||||
public function state(): HasOne
|
||||
{
|
||||
return $this->hasOne(State::class, 'state_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
**/
|
||||
public function district(): HasOne
|
||||
{
|
||||
return $this->hasOne(District::class, 'district_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,14 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
DB::beginTransaction();
|
||||
|
||||
//General
|
||||
$this->call(CountriesTableSeeder::class);
|
||||
$this->call(CurrenciesTableSeeder::class);
|
||||
$this->call(StatesTableSeeder::class);
|
||||
$this->call(DistrictsTableSeeder::class);
|
||||
|
||||
DB::commit();
|
||||
}
|
||||
}
|
||||
|
||||
+14
-13
@@ -2,26 +2,27 @@
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['prefix' => 'account', 'namespace' => 'Account', 'as' => 'account.'], function () {
|
||||
Route::group(['prefix' => 'account', 'namespace' => 'Accounts', 'as' => 'account.'], function () {
|
||||
|
||||
Route::group(['prefix' => 'authentication', 'as' => 'authentication.'], function () {
|
||||
|
||||
Route::group(['prefix' => 'login', 'as' => 'authenticate.'], function () {
|
||||
Route::post('/attempt', 'UserAuthenticationController@authenticate')->name('attempt');
|
||||
Route::post('/check_email', 'CheckEmailController@check')->name('email.check');
|
||||
});
|
||||
// Route::group(['prefix' => 'login', 'as' => 'authenticate.'], function () {
|
||||
// Route::post('/attempt', 'UserAuthenticationController@authenticate')->name('attempt');
|
||||
// Route::post('/check_email', 'CheckEmailController@check')->name('email.check');
|
||||
// });
|
||||
|
||||
Route::group(['prefix' => 'password', 'as' => 'password.'], function () {
|
||||
Route::post('/forget', 'GeneratePasswordResetController@generate')->name('forget');
|
||||
Route::post('/reset', 'ResetPasswordController@reset')->name('reset');
|
||||
});
|
||||
// Route::group(['prefix' => 'password', 'as' => 'password.'], function () {
|
||||
// Route::post('/forget', 'GeneratePasswordResetController@generate')->name('forget');
|
||||
// Route::post('/reset', 'ResetPasswordController@reset')->name('reset');
|
||||
// });
|
||||
|
||||
Route::post('/registration', 'CreateUserController@create')->name('registration');
|
||||
|
||||
});
|
||||
|
||||
Route::group(['prefix' => 'user', 'as' => 'user.'], function () {
|
||||
Route::get('list', 'ListUsersController@list')->name('list');
|
||||
});
|
||||
Route::post('/registration', 'CreateUserController@create')->name('registration');
|
||||
|
||||
// Route::group(['prefix' => 'user', 'as' => 'user.'], function () {
|
||||
// Route::get('list', 'ListUsersController@list')->name('list');
|
||||
// });
|
||||
|
||||
});
|
||||
@@ -15,6 +15,7 @@ use Illuminate\Support\Facades\Route;
|
||||
*/
|
||||
|
||||
Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function () {
|
||||
|
||||
require __DIR__ . '/account.php';
|
||||
|
||||
Route::group(['middleware' => 'valid.token'], function () {
|
||||
|
||||
Reference in New Issue
Block a user