Skip to content

Instantly share code, notes, and snippets.

@ChadTaljaardt
Created February 14, 2017 15:30
Show Gist options
  • Save ChadTaljaardt/8f35fbfb5a7b02b5cbcc8faeddae1cf6 to your computer and use it in GitHub Desktop.
Save ChadTaljaardt/8f35fbfb5a7b02b5cbcc8faeddae1cf6 to your computer and use it in GitHub Desktop.
<?php
namespace App\Models;
use App\Traits\UuidModel;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable, UuidModel;
public $incrementing = false;
protected $fillable = [
'name', 'email', 'password',
];
protected $hidden = [
'password', 'remember_token',
];
protected function detections()
{
return $this->hasMany('App\Models\Detection', 'user_id', 'id');
}
protected function plates()
{
return $this->belongsToMany('App\Models\Plate', 'detections');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment