44 lines
826 B
PHP
44 lines
826 B
PHP
<?php
|
|
|
|
namespace Modules\Authentication\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Language extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'languages';
|
|
|
|
protected $fillable = [
|
|
'restaurant_id',
|
|
'name',
|
|
'code',
|
|
'file_path',
|
|
'flag',
|
|
'is_default',
|
|
'status',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_default' => 'boolean',
|
|
];
|
|
|
|
/**
|
|
* Accessor for full flag URL
|
|
*/
|
|
public function getFlagUrlAttribute()
|
|
{
|
|
return $this->flag ? asset("storage/{$this->flag}") : null;
|
|
}
|
|
|
|
/**
|
|
* Accessor for full JSON file URL
|
|
*/
|
|
public function getFileUrlAttribute()
|
|
{
|
|
return $this->file_path ? asset("storage/{$this->file_path}") : null;
|
|
}
|
|
}
|