You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
721 B
36 lines
721 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class AdminFloor extends Model
|
|
{
|
|
use HasFactory, SoftDeletes;
|
|
|
|
protected $table = 'admin_floor';
|
|
|
|
protected $fillable
|
|
= [
|
|
'name',
|
|
'image_url'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'updated_at',
|
|
'created_at',
|
|
'deleted_at'
|
|
];
|
|
|
|
public static function getName($id)
|
|
{
|
|
return self::query()->where('id', $id)->value('name') ?? '';
|
|
}
|
|
|
|
public static function getData(): array
|
|
{
|
|
return self::query()->select(['id', 'name'])->get()->toArray();
|
|
}
|
|
}
|
|
|