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