Skip to content

wamesk/laravel-nova-unit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Nova 4 Units

Requirements

  • laravel/nova: ^4.0

Installation

composer require wamesk/laravel-nova-unit
php artisan vendor:publish --provider="Wame\LaravelNovaUnit\PackageServiceProvider"
php artisan migrate
php artisan db:seed --class=UnitSeeder

Add Policy to ./app/Providers/AuthServiceProvider.php

protected $policies = [
    'App\Models\Unit' => 'App\Policies\UnitPolicy',
];

Usage

Select::make(__('product.field.unit'), 'unit_id')
    ->help(__('product.field.unit.help'))
    ->options(UnitController::selectOptions())