PHP code example of laravel / nova-pennant

1. Go to this page and download the library: Download laravel/nova-pennant library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laravel / nova-pennant example snippets


use Laravel\Nova\PennantTool\PennantTool;

/**
 * Get the fields displayed by the resource.
 *
 * @return array
 */
public function fields(NovaRequest $request)
{
    return [
        ID::make()->sortable(),

        Text::make('Name')
            ->sortable()
            ->rules('()
            ->creationRules('

use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Nova;
use Laravel\Nova\PennantTool\PennantTool;

// ...

PennantTool::make()
    ->canRun(fn (NovaRequest $request) => Nova::user($request)->admin),

use Laravel\Nova\PennantTool\PennantTool;

// ...

PennantTool::make()
    ->