git add .
git commit "Implement user registration"
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
@@ -23,12 +24,15 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property int $status
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @property Collection|Role[] $roles
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Admin extends Model
|
||||
{
|
||||
protected $table = 'admins';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'status' => 'int'
|
||||
@@ -48,4 +52,9 @@ class Admin extends Model
|
||||
'image',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function roles()
|
||||
{
|
||||
return $this->belongsToMany(Role::class, 'admin_roles');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class AdminRole
|
||||
*
|
||||
* @property int $admin_id
|
||||
* @property int $role_id
|
||||
*
|
||||
* @property Admin $admin
|
||||
* @property Role $role
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class AdminRole extends Model
|
||||
{
|
||||
protected $table = 'admin_roles';
|
||||
public $incrementing = false;
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'admin_id' => 'int',
|
||||
'role_id' => 'int'
|
||||
];
|
||||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo(Admin::class);
|
||||
}
|
||||
|
||||
public function role()
|
||||
{
|
||||
return $this->belongsTo(Role::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class City
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $provinces
|
||||
* @property string $name
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Collection|User[] $users
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class City extends Model
|
||||
{
|
||||
protected $table = 'cities';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'provinces' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'provinces',
|
||||
'name'
|
||||
];
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Comment extends Model
|
||||
{
|
||||
protected $table = 'comments';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
|
||||
@@ -26,6 +26,7 @@ class Favorite extends Model
|
||||
{
|
||||
protected $table = 'favorites';
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
|
||||
@@ -26,6 +26,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class File extends Model
|
||||
{
|
||||
protected $table = 'files';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'size' => 'int'
|
||||
|
||||
@@ -32,6 +32,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Flight extends Model
|
||||
{
|
||||
protected $table = 'flights';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'departure_date' => 'datetime',
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Permission
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $slug
|
||||
* @property string|null $description
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @property Collection|Role[] $roles
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Permission extends Model
|
||||
{
|
||||
protected $table = 'permissions';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'slug',
|
||||
'description'
|
||||
];
|
||||
|
||||
public function roles()
|
||||
{
|
||||
return $this->belongsToMany(Role::class, 'role_permissions');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Province
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Province extends Model
|
||||
{
|
||||
protected $table = 'provinces';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Role
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $slug
|
||||
* @property string $description
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Collection|Admin[] $admins
|
||||
* @property Collection|Permission[] $permissions
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Role extends Model
|
||||
{
|
||||
protected $table = 'roles';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'slug',
|
||||
'description'
|
||||
];
|
||||
|
||||
public function admins()
|
||||
{
|
||||
return $this->belongsToMany(Admin::class, 'admin_roles');
|
||||
}
|
||||
|
||||
public function permissions()
|
||||
{
|
||||
return $this->belongsToMany(Permission::class, 'role_permissions');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class RolePermission
|
||||
*
|
||||
* @property int $role_id
|
||||
* @property int $permission_id
|
||||
*
|
||||
* @property Permission $permission
|
||||
* @property Role $role
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class RolePermission extends Model
|
||||
{
|
||||
protected $table = 'role_permissions';
|
||||
public $incrementing = false;
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'role_id' => 'int',
|
||||
'permission_id' => 'int'
|
||||
];
|
||||
|
||||
public function permission()
|
||||
{
|
||||
return $this->belongsTo(Permission::class);
|
||||
}
|
||||
|
||||
public function role()
|
||||
{
|
||||
return $this->belongsTo(Role::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Setting
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $code
|
||||
* @property string $value
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Setting extends Model
|
||||
{
|
||||
protected $table = 'settings';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $fillable = [
|
||||
'code',
|
||||
'value'
|
||||
];
|
||||
}
|
||||
@@ -32,6 +32,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Tour extends Model
|
||||
{
|
||||
protected $table = 'tours';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'travel_type_id' => 'int',
|
||||
|
||||
@@ -23,6 +23,7 @@ class TourFlight extends Model
|
||||
{
|
||||
protected $table = 'tour_flights';
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'tour_id' => 'int',
|
||||
|
||||
@@ -23,6 +23,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class TravelType extends Model
|
||||
{
|
||||
protected $table = 'travel_types';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'status' => 'int'
|
||||
|
||||
+21
-7
@@ -8,14 +8,15 @@ namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class User
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $Firstname
|
||||
* @property string $Lastname
|
||||
* @property string $first_name
|
||||
* @property string $last_name
|
||||
* @property string $national_code
|
||||
* @property int $gender
|
||||
* @property int $marital_status
|
||||
@@ -25,24 +26,28 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property string|null $profile_image
|
||||
* @property string $username
|
||||
* @property string $password
|
||||
* @property string|null $province
|
||||
* @property string|null $city
|
||||
* @property int $province_id
|
||||
* @property int $city_id
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property City $city
|
||||
* @property Collection|Comment[] $comments
|
||||
* @property Collection|Favorite[] $favorites
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class User extends Model
|
||||
class User extends Authenticatable
|
||||
{
|
||||
protected $table = 'users';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'gender' => 'int',
|
||||
'marital_status' => 'int',
|
||||
'province_id' => 'int',
|
||||
'city_id' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
@@ -62,11 +67,20 @@ class User extends Model
|
||||
'profile_image',
|
||||
'username',
|
||||
'password',
|
||||
'province',
|
||||
'city',
|
||||
'province_id',
|
||||
'city_id',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class);
|
||||
}
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Province::class);
|
||||
}
|
||||
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany(Comment::class);
|
||||
|
||||
Reference in New Issue
Block a user