<?php
namespace AppModels;
use IlluminateDatabaseEloquentModel;
class User extends Model
{
/**
* Scope a query to only include popular users.
*
* @param IlluminateDatabaseEloquentBuilder $query
* @return IlluminateDatabaseEloquentBuilder
*/
public function scopePopular($query)
{
return $query->where('votes', '>', 100);
}
/**
* Scope a query to only include active users.
*
* @param IlluminateDatabaseEloquentBuilder $query
* @return void
*/
public function scopeActive($query)
{
$query->where('active', 1);
}
}