Add BaseModel with stricter attribute existence checking

This commit is contained in:
2018-07-29 16:37:11 +02:00
parent 72ddd75023
commit f1529b3b8e
10 changed files with 53 additions and 23 deletions
+11 -2
View File
@@ -7,10 +7,15 @@ use App\Models\Concerns\InstanceCache;
use App\Models\Concerns\Reportable;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notification;
use MightyPork\Exceptions\ArgumentException;
use MightyPork\Exceptions\NotExistException;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
/**
* A user in the application
@@ -37,8 +42,12 @@ use MightyPork\Exceptions\NotExistException;
* @property-read Notification[]|Collection $unreadNotifications
* @property-read string $handle - user handle, including @
*/
class User extends Authenticatable
class User extends BaseModel implements
AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
use Authenticatable, Authorizable, CanResetPassword;
use Reportable;
use Notifiable;
use InstanceCache;