Merge branch 'main' of ssh://gitea.office.local:222/alex_chevski/eatvio into alex_chevski-main

This commit is contained in:
Anatoliy Poloz
2023-12-20 11:19:16 +03:00
19 changed files with 1391 additions and 603 deletions

View File

@@ -11,13 +11,37 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Laracasts\Presenter\PresentableTrait;
use Spatie\Sluggable\HasSlug;
use Spatie\Sluggable\SlugOptions;
class Plan extends Model implements Viewable
{
use HasFactory;
use HasSlug;
use InteractsWithViews;
use PresentableTrait;
public function getSlugOptions(): SlugOptions
{
return SlugOptions::create()
->generateSlugsFrom(['name'] )
->saveSlugsTo('slug')
// ->slugsShouldBeNoLongerThan(20)
->usingSeparator('_');
// ->usingLanguage('ru')
// ->doNotGenerateSlugsOnUpdate();
}
/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName()
{
return 'slug';
}
protected $withCount = [
'likes',
'comments',