fix:change admin routes and flight blade
This commit is contained in:
+26
-27
@@ -1,15 +1,10 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\AdminStatus;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Carbon\Carbon;
|
||||
use App\Models\Permission;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
/**
|
||||
* Class Admin
|
||||
@@ -24,40 +19,44 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @package App\Models
|
||||
* @property-read AdminPermission|null $permission
|
||||
*/
|
||||
class Admin extends Authenticatable
|
||||
{
|
||||
protected $table = 'admins';
|
||||
public static $snakeAttributes = false;
|
||||
protected $table = 'admins';
|
||||
|
||||
protected $casts = [
|
||||
'file_id' => 'int',
|
||||
'status' => AdminStatus::class,
|
||||
];
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $hidden = [
|
||||
'password'
|
||||
];
|
||||
protected $casts = [
|
||||
'file_id' => 'int',
|
||||
'status' => AdminStatus::class,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'file_id',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'email',
|
||||
protected $hidden = [
|
||||
'password',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'file_id',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'email',
|
||||
'username',
|
||||
'password',
|
||||
'status'
|
||||
];
|
||||
'password',
|
||||
'status',
|
||||
];
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class, 'file_id');
|
||||
}
|
||||
|
||||
|
||||
public function permission()
|
||||
{
|
||||
return $this->hasOne(AdminPermission::class);
|
||||
return $this->hasOne(
|
||||
AdminPermission::class,
|
||||
'admin_id',
|
||||
'id'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user