wamesk/laravel-nova-country

Laravel Nova 5 Country field.

5.0.3 2025-02-20 15:43 UTC

This package is auto-updated.

Last update: 2025-02-20 15:44:40 UTC


README

Requirements

  • laravel/nova: ^5.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

Usage

Select::make(__('customer.field.country'), 'country_id')
    ->help(__('customer.field.country.help'))
    ->options(fn () => resolve(CountryService::class)->getListForSelect())
    ->searchable()
    ->required()
    ->rules('required')
    ->onlyOnForms(),
                        
BelongsTo::make(__('customer.field.country'), 'country', Country::class)
    ->displayUsing(fn () => resolve(CountryService::class)->displayUsing($request, $this))
    ->sortable()
    ->filterable()
    ->showOnPreview()
    ->exceptOnForms(),