PHP code example of stats4sd / laravel-backpack-section-title

1. Go to this page and download the library: Download stats4sd/laravel-backpack-section-title 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/ */

    

stats4sd / laravel-backpack-section-title example snippets


$this->crud->addField([
    'name' => 'field_name',
    'type' => 'section-title',
    'title' => 'Your Heading',
    'content' => 'Some information about how to complete the form, to be displayed inside a callout box',
    'variant' => 'info',
    'divider' => true,
    'view_namespace' => 'stats4sd.laravel-backpack-section-title::fields',
]);

$this->crud->addField([
    'name' => 'dynamic title',
    'type' => 'section-title',
    'title' => function($entry) {
        return "Editing " . $entry['name'];
    }
]);


$this->crud->addField([
    'name' => 'dynamic title',
    'type' => 'section-title',
    'title' => function($entry) {
        if($entry) {
            return "Editing " . $entry['name'];
        } else {
            return "Creating new entry";
        }
    }
]);