PHP code example of diezg / collapsible

1. Go to this page and download the library: Download diezg/collapsible 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/ */

    

diezg / collapsible example snippets


use Diezg\Collapsible\HasManyCollapsible;

class User extends Resource
{
    /**
     * Get the fields displayed by the resource.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function fields(Request $request)
    {
        return [
            ID::make()->sortable(),

            Text::make('Name'),

            HasManyCollapsible::make(__('Products'), 'products', Product::class)
                ->buttonText('Show custom text', 'Hide custom text'), // Optional
        ];
    }
}