Файл: app/Models/Page.php
Строк: 19
<?php
namespace AppModels;
use IlluminateDatabaseEloquentBuilder;
use IlluminateDatabaseEloquentModel;
/**
* Class Page
*
* @mixin Builder
* @package App
*/
class Page extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
public $fillable = [
'name', 'slug', 'footer', 'content'
];
/**
* @param Builder $query
* @param $value
* @return Builder
*/
public function scopeSearchName(Builder $query, $value)
{
return $query->where('name', 'like', '%' . $value . '%')->orWhere('content', 'like', '%' . $value . '%');
}
}