2016-05-19 15:01:28 +01:00
|
|
|
<?php
|
|
|
|
|
2018-01-15 14:02:13 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2017-12-19 16:00:42 +00:00
|
|
|
namespace App\Models;
|
2016-05-19 15:01:28 +01:00
|
|
|
|
2020-09-13 17:00:45 +01:00
|
|
|
use Eloquent;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
2016-05-19 15:01:28 +01:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2018-01-15 14:02:13 +00:00
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
2020-09-13 17:00:45 +01:00
|
|
|
use Illuminate\Support\Carbon;
|
2016-05-19 15:01:28 +01:00
|
|
|
|
2020-02-22 11:06:43 +00:00
|
|
|
/**
|
2020-02-22 11:21:00 +00:00
|
|
|
* App\Models\MicropubClient.
|
2020-02-22 11:06:43 +00:00
|
|
|
*
|
|
|
|
* @property int $id
|
|
|
|
* @property string $client_url
|
|
|
|
* @property string $client_name
|
2020-09-13 17:00:45 +01:00
|
|
|
* @property Carbon|null $created_at
|
|
|
|
* @property Carbon|null $updated_at
|
|
|
|
* @property-read Collection|\App\Models\Note[] $notes
|
2020-02-22 11:06:43 +00:00
|
|
|
* @property-read int|null $notes_count
|
2020-09-13 17:00:45 +01:00
|
|
|
* @method static Builder|MicropubClient newModelQuery()
|
|
|
|
* @method static Builder|MicropubClient newQuery()
|
|
|
|
* @method static Builder|MicropubClient query()
|
|
|
|
* @method static Builder|MicropubClient whereClientName($value)
|
|
|
|
* @method static Builder|MicropubClient whereClientUrl($value)
|
|
|
|
* @method static Builder|MicropubClient whereCreatedAt($value)
|
|
|
|
* @method static Builder|MicropubClient whereId($value)
|
|
|
|
* @method static Builder|MicropubClient whereUpdatedAt($value)
|
|
|
|
* @mixin Eloquent
|
2020-02-22 11:06:43 +00:00
|
|
|
*/
|
2016-05-29 14:21:46 +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'];
|
2017-06-22 14:30:10 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the relationship with notes.
|
|
|
|
*
|
2020-02-22 11:06:43 +00:00
|
|
|
* @return HasMany
|
2017-06-22 14:30:10 +01:00
|
|
|
*/
|
2018-01-15 14:02:13 +00:00
|
|
|
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');
|
2017-06-22 14:30:10 +01:00
|
|
|
}
|
2016-05-19 15:01:28 +01:00
|
|
|
}
|