This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
ModuleWeb/SRC/app/User.php

23 lines
404 B
PHP
Raw Normal View History

2015-02-12 13:56:47 +01:00
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
2015-02-17 15:56:30 +01:00
use Auth;
2015-02-12 13:56:47 +01:00
2015-02-17 15:56:30 +01:00
class User extends Model {
2015-02-12 13:56:47 +01:00
protected $table = 'users';
2015-02-17 15:56:30 +01:00
public $timestamps = false;
2015-02-12 13:56:47 +01:00
2015-02-17 15:56:30 +01:00
public function scopeCurrent($query)
{
$email = Auth::user()->email;
return $query->where('email', $email)->first();
}
2015-02-12 13:56:47 +01:00
2015-02-17 15:56:30 +01:00
public function scopeReferents($query)
{
return $query->where('admin', '0');
}
2015-02-12 13:56:47 +01:00
}