jonnybarnes.uk/app/Models/MicropubClient.php

36 lines
711 B
PHP
Raw Normal View History

2016-05-19 15:01:28 +01:00
<?php
declare(strict_types=1);
2017-12-19 16:00:42 +00:00
namespace App\Models;
2016-05-19 15:01:28 +01:00
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
2016-05-19 15:01:28 +01:00
class MicropubClient extends Model
2016-05-19 15:01:28 +01:00
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'clients';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['client_url', 'client_name'];
/**
* Define the relationship with notes.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function notes(): HasMany
2017-06-22 15:44:41 +00:00
{
2017-12-19 16:00:42 +00:00
return $this->hasMany('App\Models\Note', 'client_id', 'client_url');
}
2016-05-19 15:01:28 +01:00
}