<?php

namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\SoftDeletes;
class Album extends Model
{
    use SoftDeletes;
    use Sluggable;
    use HasFactory;
    protected $fillable = [
        'title',
        'slug',
        'description',
        'cover_photo',
        'is_published',
    ];

    public function sluggable(): array
   {
       return [
           'slug' => [
               'source' => 'title'
           ]
       ];
   }
   public function photos()
   {
       return $this->hasMany(Photo::class);
   }
}
