I\'m currently working on my Laravel app and to prevent spam I decided that only active users are able to login. I\'m currently using Laravel\'s login system just like in La
You can use Eloquent scopes: https://laravel.com/docs/5.5/eloquent#query-scopes
like this:
class User extends Authenticatable {
...
/**
* The "booting" method of the model.
*
* @return void
*/
protected static function boot() {
parent::boot();
static::addGlobalScope('scopeActive', function (Builder $builder) {
$builder->where('active', 1);
});
}
...