Files
airline-agency/app/Models/Admin.php
T

77 lines
1.3 KiB
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class Admin
*
* @property int $id
* @property string $first_name
* @property string $last_name
* @property string $username
* @property string $email
* @property string $mobile
* @property string $password
* @property int|null $file_id
* @property int $role
* @property int $status
* @property Carbon|null $last_login_at
* @property Carbon $created_at
* @property Carbon $updated_at
* @property string|null $deleted_at
*
* @property File|null $file
* @property Collection|Comment[] $comments
*
* @package App\Models
*/
class Admin extends Model
{
use SoftDeletes;
protected $table = 'admins';
public static $snakeAttributes = false;
protected $casts = [
'file_id' => 'int',
'role' => 'int',
'status' => 'int',
'last_login_at' => 'datetime'
];
protected $hidden = [
'password'
];
protected $fillable = [
'first_name',
'last_name',
'username',
'email',
'mobile',
'password',
'file_id',
'role',
'status',
'last_login_at'
];
public function file()
{
return $this->belongsTo(File::class);
}
public function comments()
{
return $this->hasMany(Comment::class);
}
}