Massivly simplify notes index controller method

This commit is contained in:
Jonny Barnes 2017-06-22 14:30:10 +01:00
parent 36cf131839
commit 0c62e558ec
5 changed files with 200 additions and 197 deletions

View file

@ -19,4 +19,13 @@ class MicropubClient extends Model
* @var array
*/
protected $fillable = ['client_url', 'client_name'];
/**
* Define the relationship with notes.
*
* @return void
*/
public function notes() {
return $this->hasMany('App\Note', 'client_id', 'client_url');
}
}