44 lines
1.1 KiB
PHP
Executable File
44 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Modules\Configindex\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ConfigPage extends Model
|
|
{
|
|
protected $table = 'config_index';
|
|
protected $primaryKey = 'config_index_id';
|
|
|
|
protected $fillable = [
|
|
'config_index_bus_id',
|
|
'config_index_key',
|
|
'config_index_title',
|
|
'config_index_content',
|
|
'config_index_meta_title',
|
|
'config_index_meta_description',
|
|
'config_index_show_public_nav',
|
|
'config_index_show_dashboard_nav'
|
|
];
|
|
|
|
protected $casts = [
|
|
'config_index_show_public_nav' => 'boolean',
|
|
'config_index_show_dashboard_nav' => 'boolean',
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
|
|
/**
|
|
* Get content by key and bus_id
|
|
*
|
|
* @param string $key
|
|
* @param int $busId
|
|
* @return self|null
|
|
*/
|
|
public static function getByKey(string $key, int $busId)
|
|
{
|
|
return self::where('config_index_key', $key)
|
|
->where('config_index_bus_id', $busId)
|
|
->first();
|
|
}
|
|
}
|