/home/bdqbpbxa/dev-subdomains/api-uniferx.goodface.com.ua/app/Nova/Layouts/Pages/ProductsLayout.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 Laravel\Nova\Fields\Text;
use Whitecube\NovaFlexibleContent\Layouts\Layout;
class ProductsLayout 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 [
/** First screen */
Heading::make(__('First screen')),
MultilangText::make('Title', 'fs_title')->languages($languages)->countries($countries)->uploadLink($uploadLink)
->fullWidth(),
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('View button', 'fs_view_button')->languages($languages)->countries($countries)->uploadLink($uploadLink)
->fullWidth(),
/** agricultural solutions */
Heading::make(__('Agricultural solutions')),
MultilangText::make('Tag', 'agricultural_tag')->languages($languages)->countries($countries)->uploadLink($uploadLink)
->fullWidth(),
MultilangTextarea::make('Title', 'agricultural_title')->languages($languages)->countries($countries)->uploadLink($uploadLink)
->fullWidth(),
MultilangTextarea::make('Description', 'agricultural_description')->languages($languages)->countries($countries)->uploadLink($uploadLink)
->fullWidth(),
];
}
}