laravel model set scope code example
Example 1: laravel scope
public function apply(Builder $builder, Model $model)
{
$builder->where('age', '>', 200);
}
Example 2: laravel scope relationship
class User extends Model {
protected function getDateFormat()
{
return 'U';
}
}