61 lines
1010 B
PHP
61 lines
1010 B
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class File
|
|
*
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property string $extension
|
|
* @property int $size
|
|
* @property string $original_name
|
|
* @property string $path
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property Collection|Flight[] $flights
|
|
* @property Collection|User[] $users
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class File extends Model
|
|
{
|
|
protected $table = 'files';
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $casts = [
|
|
'size' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'extension',
|
|
'size',
|
|
'original_name',
|
|
'path'
|
|
];
|
|
|
|
public function flights()
|
|
{
|
|
return $this->hasMany(Flight::class);
|
|
}
|
|
|
|
public function users()
|
|
{
|
|
return $this->hasMany(User::class);
|
|
}
|
|
public function adminAvatar()
|
|
{
|
|
return $this->hasOne(AdminAvatar::class);
|
|
}
|
|
}
|