/home/bdqbpbxa/api-uniferx.goodface.com.ua/app/Nova/Layouts/Pages/BlogLayout.php
<?php
namespace App\Nova\Layouts\Pages;
use Acme\MultilangText\MultilangText;
use Acme\MultilangTextarea\MultilangTextarea;
use App\Models\Country;
use App\Models\Language;
use Illuminate\Support\Facades\Storage;
use Laravel\Nova\Fields\Heading;
use Laravel\Nova\Fields\Image;
use Whitecube\NovaFlexibleContent\Layouts\Layout;
class BlogLayout extends Layout
{
/**
* The layout's unique identifier
*
* @var string
*/
protected $name = 'title';
/**
* The displayed title
*
* @var string
*/
protected $title = 'Content';
protected $limit = 1;
/**
* Get the fields displayed by the layout.
*
* @return array
*/
public function fields()
{
$countries = Country::query()->get();
$languages = Language::query()->get();
$uploadLink = route('nova.fields.upload.image');
return [
Heading::make(__('First screen')),
MultilangText::make('Title', 'title')
->fullWidth()
->languages($languages)
->countries($countries)
->uploadLink($uploadLink),
Image::make(__('Title background'), 'fs_title_background') ->disk('public')
->disableDownload()->deletable()->prunable()->path('posts')
->preview(function ($value, $disk) { return $value ? Storage::disk($disk)->url($value) : null; })
->thumbnail(function ($value, $disk) { return $value ? Storage::disk($disk)->url($value) : null; }),
MultilangText::make('Subscribe button', 'subscribe_button')
->fullWidth()
->languages($languages)
->countries($countries)
->uploadLink($uploadLink),
MultilangTextarea::make(__('Description'), 'description')
->languages($languages)
->countries($countries)
->uploadLink($uploadLink)
->fullWidth(),
Heading::make(__('Subscribe')),
MultilangText::make('Subscribe Title', 'subscribe_title')
->fullWidth()
->languages($languages)
->countries($countries)
->uploadLink($uploadLink),
MultilangText::make('Subscribe Description', 'subscribe_description')
->fullWidth()
->languages($languages)
->countries($countries)
->uploadLink($uploadLink),
MultilangTextarea::make('Subscribe Policy Text', 'subscribe_policy_text')
->fullWidth()
->languages($languages)
->countries($countries)
->uploadLink($uploadLink),
Heading::make(__('Other')),
MultilangText::make('Show more button', 'show_more_button')
->fullWidth()
->languages($languages)
->countries($countries)
->uploadLink($uploadLink),
];
}
}