38 lines
904 B
PHP
38 lines
904 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Journalist extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'journalists';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'email',
|
|
'phone_number',
|
|
'press_card',
|
|
'press_card_doc',
|
|
'ukw_certificate',
|
|
'ukw_certificate_doc',
|
|
'edit_description',
|
|
'edit_status',
|
|
'media_id'
|
|
];
|
|
|
|
public function media(){
|
|
return $this->belongsTo(Media::class, 'media_id', 'id')->withTrashed();
|
|
}
|
|
|
|
public function cooperationProposals()
|
|
{
|
|
return $this->belongsToMany(CooperationProposal::class, 'journalists_cooperation_proposals', 'journalist_id', 'cooperation_proposal_id')
|
|
->using(JournalistCooperationProposal::class)
|
|
->withTimestamps();
|
|
}
|
|
}
|