Looking to hire Laravel developers? Try LaraJobs

laravel-nova-country maintained by wamesk

Description
Laravel Nova 5 Country field.
Author
Last update
2025/12/10 14:12 (dev-main)
License
Links
Downloads
490
Tags

Comments
comments powered by Disqus

Laravel Nova Country

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(),