PHP code example of coreproc / nova-toggle-fields

1. Go to this page and download the library: Download coreproc/nova-toggle-fields 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/ */

    

coreproc / nova-toggle-fields example snippets


use Coreproc\NovaToggleFields\Traits\HasToggleableFields;

class Contact extends Resource
{
    use HasToggleableFields;
    
    .....
}

use Coreproc\NovaToggleFields\Traits\HasToggleableFields;

class Contact extends Resource
{
    use HasToggleableFields;
    
    .....
    
    /**
     * Get the actions available for the resource.
     *
     * @param \Laravel\Nova\Http\Requests\NovaRequest $request
     * @return array
     */
    public function actions(NovaRequest $request)
    {
        return [
            (new ToggleFields(self::class, $this->indexFields($request))),
        ];
    }
    
    ...
}