Skip to content

wamesk/laravel-nova-country

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Nova 4 Country

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages