This commit is contained in:
2026-02-03 15:31:29 +05:00
commit 326c677e8d
2800 changed files with 1489388 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
<?php
namespace App\Nova\Resources\CMS\Forms;
use App\Models\CMS\Forms\ContactUS as ContactUSModel;
use App\Models\System\Settings\OS;
use App\Nova\Resource;
use App\Nova\User;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Http\Requests\NovaRequest;
class ContactUS extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<ContactUSModel>
*/
public static $model = ContactUSModel::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'title';
/**
* The relationships that should be eager loaded on index queries.
*
* @var array
*/
public static $with = ['user'];
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'title', 'phone',
];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Messages');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Message');
}
/**
* Get the fields displayed by the resource.
*/
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
BelongsTo::make(__('User'), 'user', User::class),
Text::make(__('Phone'), 'phone')->rules('required'),
Text::make(__('Title'), 'title')->rules('required'),
Textarea::make(__('Content'), 'content')->rules('required')->alwaysShow(),
Select::make(__('Type'), 'type')
->options(OS::apps())
->displayUsingLabels()
->rules('required'),
DateTime::make(__('Created at'), 'created_at')
->turkmenDate()
->exceptOnForms(),
];
}
/**
* Get the cards available for the request.
*
* @return array
*/
public function cards(NovaRequest $request)
{
return [];
}
/**
* Get the filters available for the resource.
*
* @return array
*/
public function filters(NovaRequest $request)
{
return [];
}
/**
* Get the lenses available for the resource.
*
* @return array
*/
public function lenses(NovaRequest $request)
{
return [];
}
/**
* Get the actions available for the resource.
*
* @return array
*/
public function actions(NovaRequest $request)
{
return [];
}
}

View File

@@ -0,0 +1,116 @@
<?php
namespace App\Nova\Resources\CMS\Marketing;
use App\Nova\Resource;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Trix;
use Laravel\Nova\Http\Requests\NovaRequest;
class Newsletter extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\Resources\CMS\Marketing\Newsletter>
*/
public static $model = \App\Models\CMS\Marketing\Newsletter::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'subject';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'id', 'subject',
];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Email Newsletters');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Email Newsletter');
}
/**
* Get the fields displayed by the resource.
*
* @return array
*/
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
Text::make(__('Subject'), 'subject')
->rules('required'),
Trix::make(__('Content'), 'content')
->withFiles('public')
->rules('required'),
Boolean::make('sent')
->exceptOnForms()
->default(false),
];
}
/**
* Get the cards available for the request.
*
* @return array
*/
public function cards(NovaRequest $request)
{
return [];
}
/**
* Get the filters available for the resource.
*
* @return array
*/
public function filters(NovaRequest $request)
{
return [];
}
/**
* Get the lenses available for the resource.
*
* @return array
*/
public function lenses(NovaRequest $request)
{
return [];
}
/**
* Get the actions available for the resource.
*
* @return array
*/
public function actions(NovaRequest $request)
{
return [];
}
}

View File

@@ -0,0 +1,109 @@
<?php
namespace App\Nova\Resources\CMS\Marketing;
use App\Nova\Resource;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
class NewsletterUser extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\Resources\CMS\Marketing\NewsletterUser>
*/
public static $model = \App\Models\CMS\Marketing\NewsletterUser::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'email';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'id', 'email',
];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Email Newsletter').' '.__('subscribed').' '.__('users');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('User');
}
/**
* Get the fields displayed by the resource.
*
* @return array
*/
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
Text::make(__('Email'), 'email')
->sortable()
->rules('required', 'email', 'max:254')
->creationRules('unique:newsletter_users,email')
->updateRules('unique:newsletter_users,email,{{resourceId}}'),
];
}
/**
* Get the cards available for the request.
*
* @return array
*/
public function cards(NovaRequest $request)
{
return [];
}
/**
* Get the filters available for the resource.
*
* @return array
*/
public function filters(NovaRequest $request)
{
return [];
}
/**
* Get the lenses available for the resource.
*
* @return array
*/
public function lenses(NovaRequest $request)
{
return [];
}
/**
* Get the actions available for the resource.
*
* @return array
*/
public function actions(NovaRequest $request)
{
return [];
}
}

View File

@@ -0,0 +1,179 @@
<?php
namespace App\Nova\Resources\CMS\Media;
use App\Models\CMS\Media\Banner as BannerModel;
use App\Models\System\Settings\OS;
use App\Nova\Filters\AppTypeFilter;
use App\Nova\Filters\VisableFilter;
use App\Nova\Resource;
use App\Repositories\CMS\Media\Banner\BannerRepository;
use Ebess\AdvancedNovaMediaLibrary\Fields\Images;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\URL;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Panel;
use Outl1ne\NovaSortable\Traits\HasSortableRows;
use Trin4ik\NovaSwitcher\NovaSwitcher;
class Banner extends Resource
{
/**
* Sortable behavior
*/
use HasSortableRows;
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\CMS\Media\Banner>
*/
public static $model = BannerModel::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'id';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'name',
];
/**
* The relationships that should be eager loaded on index queries.
*
* @var array
*/
public static $with = ['media'];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Banners');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Banner');
}
/**
* Get the fields displayed by the resource.
*/
public function fields(NovaRequest $request): array
{
return [
new Panel(__('Basic information'), [
ID::make()->sortable(),
Images::make(__('Image'), 'main')
->conversionOnIndexView('thumb200x200')
->rules('required')
->required(),
Select::make(__('App'), 'app')
->displayUsingLabels()
->searchable()
->options(OS::apps())
->default(OS::WEBSITE),
Select::make(__('Place'), 'place')
->displayUsingLabels()
->searchable()
->options(BannerModel::places())
->rules('required'),
Text::make(__('Name'), 'title')
->translatable()
->rules('nullable', 'string', 'max:255'),
URL::make(__('Link'), 'link')
->displayUsing(fn () => $this->link)
->rules('nullable', 'string', 'max:2048')
->hideFromIndex(),
NovaSwitcher::make(__('Visible'), 'is_visible')
->default(true),
]),
new Panel(__('Additional information'), [
Select::make(__('Resource type to attach'), 'resource_type')
->displayUsingLabels()
->searchable()
->options(BannerModel::attachableResources())
->rules('nullable')
->onlyOnForms(),
Select::make(__('Resource to attach'), 'resource_id')
->displayUsingLabels()
->searchable()
->rules('nullable')
->dependsOn(['resource_type'], function ($field, $request, $formData) {
if ($formData->resource_type) {
$field->options(BannerRepository::getNovaResource($formData->resource_type))->rules('required');
}
})
->onlyOnForms(),
Text::make(
__('Attached resource'),
fn () => view('vendor.nova.resources.banner.resource-type', ['resource' => $this])->render()
)->asHtml()->hideFromIndex(),
Text::make(__('Note'), 'description')
->translatable()
->rules('nullable', 'string', 'max:255')
->hideFromIndex(),
]),
];
}
/**
* Get the cards available for the request.
*/
public function cards(NovaRequest $request): array
{
return [];
}
/**
* Get the filters available for the resource.
*/
public function filters(NovaRequest $request): array
{
return [
new VisableFilter,
new AppTypeFilter,
];
}
/**
* Get the lenses available for the resource.
*/
public function lenses(NovaRequest $request): array
{
return [];
}
/**
* Get the actions available for the resource.
*/
public function actions(NovaRequest $request): array
{
return [];
}
}

View File

@@ -0,0 +1,190 @@
<?php
namespace App\Nova\Resources\CMS\Media;
use App\Models\CMS\Media\Carousel as CarouselModel;
use App\Models\System\Settings\OS;
use App\Nova\Filters\AppTypeFilter;
use App\Nova\Filters\VisableFilter;
use App\Nova\Resource;
use App\Repositories\CMS\Media\Banner\BannerRepository;
use Ebess\AdvancedNovaMediaLibrary\Fields\Images;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\URL;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Panel;
use Outl1ne\NovaSortable\Traits\HasSortableRows;
use Trin4ik\NovaSwitcher\NovaSwitcher;
class Carousel extends Resource
{
/**
* Sortable behavior
*/
use HasSortableRows;
/**
* The model the resource corresponds to.
*
* @var class-string<CarouselModel>
*/
public static $model = CarouselModel::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'id';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'title',
];
/**
* The relationships that should be eager loaded on index queries.
*
* @var array
*/
public static $with = ['media'];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Carousels');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Carousel');
}
/**
* Get the fields displayed by the resource.
*/
public function fields(NovaRequest $request): array
{
return [
new Panel(__('Basic information'), [
ID::make()->sortable(),
Images::make(__('Image'), 'main')
->conversionOnIndexView('thumb50x50')
->rules('required')
->required(),
Select::make(__('App'), 'app')
->displayUsingLabels()
->searchable()
->options(OS::apps())
->default(OS::WEBSITE)
->rules('required'),
Select::make(__('Place'), 'place')
->displayUsingLabels()
->searchable()
->options(CarouselModel::places())
->default('homepage')
->rules('required'),
Text::make(__('Name'), 'title')
->translatable()
->rules('nullable', 'string', 'max:255'),
URL::make(__('Link'), 'link')
->displayUsing(fn () => $this->link)
->rules('nullable', 'string', 'max:2048')
->hideFromIndex(),
NovaSwitcher::make(__('Is visible'), 'is_visible')
->default(true)
->sortable(),
]),
new Panel(__('Additional information'), [
Select::make(__('Resource type to attach'), 'resource_type')
->displayUsingLabels()
->searchable()
->options(CarouselModel::attachableResources())
->rules('nullable')
->onlyOnForms(),
Select::make(__('Resource to attach'), 'resource_id')
->displayUsingLabels()
->searchable()
->rules('nullable')
->dependsOn(['resource_type'], function ($field, $request, $formData) {
if ($formData->resource_type) {
$field->options(BannerRepository::getNovaResource($formData->resource_type))->rules('required');
}
})
->onlyOnForms(),
Text::make(
__('Attached resource'),
fn () => view('vendor.nova.resources.banner.resource-type', ['resource' => $this])->render()
)->asHtml()->hideFromIndex(),
Text::make(__('Note'), 'description')
->translatable()
->rules('nullable', 'string', 'max:255')
->hideFromIndex(),
]),
];
}
/**
* Get the cards available for the request.
*
* @return array
*/
public function cards(NovaRequest $request)
{
return [];
}
/**
* Get the filters available for the resource.
*
* @return array
*/
public function filters(NovaRequest $request)
{
return [
new VisableFilter,
new AppTypeFilter,
];
}
/**
* Get the lenses available for the resource.
*
* @return array
*/
public function lenses(NovaRequest $request)
{
return [];
}
/**
* Get the actions available for the resource.
*
* @return array
*/
public function actions(NovaRequest $request)
{
return [];
}
}

View File

@@ -0,0 +1,119 @@
<?php
namespace App\Nova\Resources\CMS\Media;
use App\Nova\Resource;
use Ebess\AdvancedNovaMediaLibrary\Fields\Images;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
class Gallery extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\Resources\CMS\Media\Gallery>
*/
public static $model = \App\Models\CMS\Media\Gallery::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'title';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'id', 'title',
];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Galleries');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Gallery');
}
/**
* Get the fields displayed by the resource.
*
* @return array
*/
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
Images::make(__('Image'), 'main')
->conversionOnIndexView('thumb')
->rules('required')
->required(),
Text::make(__('Title'), 'title')
->rules('required', 'string')
->translatable(),
Text::make(__('Description'), 'description')
->translatable(),
Boolean::make(__('Active'), 'is_visible')->default(true),
];
}
/**
* Get the cards available for the request.
*
* @return array
*/
public function cards(NovaRequest $request)
{
return [];
}
/**
* Get the filters available for the resource.
*
* @return array
*/
public function filters(NovaRequest $request)
{
return [];
}
/**
* Get the lenses available for the resource.
*
* @return array
*/
public function lenses(NovaRequest $request)
{
return [];
}
/**
* Get the actions available for the resource.
*
* @return array
*/
public function actions(NovaRequest $request)
{
return [];
}
}