fix: fix relations and casts in admin and user models
This commit is contained in:
+13
-8
@@ -7,14 +7,18 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
//use Illuminate\Foundation\Auth\Admin as Authenticate;
|
||||||
|
//use Illuminate\Foundation\Auth\Admin as Authenticate;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Admin
|
* Class Admin
|
||||||
*
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string $first_name
|
* @property string $full_name
|
||||||
* @property string $last_name
|
* @property string $username
|
||||||
* @property string $email
|
* @property string $email
|
||||||
* @property string $mobile
|
* @property string $mobile
|
||||||
* @property string $password
|
* @property string $password
|
||||||
@@ -24,25 +28,26 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
*
|
*
|
||||||
* @package App\Models
|
* @package App\Models
|
||||||
*/
|
*/
|
||||||
class Admin extends Model
|
class Admin extends User
|
||||||
{
|
{
|
||||||
protected $table = 'admins';
|
protected $table = 'admins';
|
||||||
|
|
||||||
public static $snakeAttributes = false;
|
public static $snakeAttributes = false;
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'status' => 'int'
|
'status' => 'int',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
'password'
|
'password',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'first_name',
|
'full_name',
|
||||||
'last_name',
|
'username',
|
||||||
'email',
|
'email',
|
||||||
'mobile',
|
'mobile',
|
||||||
'password',
|
'password',
|
||||||
'status'
|
'status',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Foundation\Auth\User as Authenticate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class User
|
* Class User
|
||||||
@@ -30,7 +30,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
*
|
*
|
||||||
* @package App\Models
|
* @package App\Models
|
||||||
*/
|
*/
|
||||||
class User extends Model
|
class User extends Authenticate
|
||||||
{
|
{
|
||||||
protected $table = 'users';
|
protected $table = 'users';
|
||||||
public static $snakeAttributes = false;
|
public static $snakeAttributes = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user