31 lines
952 B
PHP
31 lines
952 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* App\Option
|
|
*
|
|
* @property int $id
|
|
* @property string $key 選項名稱
|
|
* @property string $value 選項值
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Option key($key)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Option newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Option newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Option query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Option whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Option whereKey($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Option whereValue($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class Option extends Model
|
|
{
|
|
protected $fillable = ['key', 'value'];
|
|
|
|
public function scopeKey($query, $key)
|
|
{
|
|
return $query->where('key', $key);
|
|
}
|
|
}
|