%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/conference/app/Models/
Upload File :
Create Path :
Current File : /var/www/html/conference/app/Models/Author.php

<?php

namespace App\Models;

class Author extends BaseModel
{
    protected $fillable = [
        'name',
        'surname',
        'email',
        'title',
        'job',
    ];

    protected $appends = [
        'fullname'
    ];

    public function articles()
    {
        return $this->belongsToMany(Article::class, 'article_author', 'author_id', 'article_id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\MorphOne
     */
    public function media()
    {
        return $this->morphOne(Media::class, 'model');
    }

    public function getFullnameAttribute()
    {
        return $this->name . ' ' . $this->surname;
    }

}

Zerion Mini Shell 1.0