wamesk / laravel-nova-country
Laravel Nova 4 Country field.
2.0.4
2024-09-04 08:32 UTC
Requires
- laravel/nova: ^4.0
- rinvex/countries: ^9.0
- wamesk/laravel-nova-currency: ^2.0
- wamesk/laravel-nova-language: ^3.0
- wamesk/laravel-nova-vat-rate: ^2.0
README
Requirements
laravel/nova: ^4.0
Installation
composer require wamesk/laravel-nova-country
php artisan migrate
php artisan db:seed --class=LanguageSeeder php artisan db:seed --class=CurrencySeeder php artisan db:seed --class=CountrySeeder
Add Policy to ./app/Providers/AuthServiceProvider.php
protected $policies = [ 'App\Models\Country' => 'Policies\CountryPolicy', ];
Usage
Select::make(__('customer.field.country'), 'country_code') ->help(__('customer.field.country.help')) ->options(fn () => CountryController::getListForSelect()) ->searchable() ->required() ->rules('required') ->onlyOnForms(), BelongsTo::make(__('customer.field.country'), 'country', Country::class) ->displayUsing(fn () => CountryController::displayUsing($request, $this)) ->sortable() ->filterable() ->showOnPreview() ->exceptOnForms(),