PHP code example of soufiene-slimi / star-field-for-backpack

1. Go to this page and download the library: Download soufiene-slimi/star-field-for-backpack 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/ */

    

soufiene-slimi / star-field-for-backpack example snippets


CRUD::addField([
    'view_namespace' => 'star-field-for-backpack::fields',
    'name' => 'rate',
    'type' => 'star',
    // 'label' => 'Rating', // (optional)
    // 'count' => 8, // (optional) the max rate count; default value is 5
    // 'default' => 6, // (optional) the default checked rate on new item creation
    // 'hint' => 'Cheer up!', // (optional)
    // 'options' => [ // (optional) customize the look
    //     'icon' => '★', // (optional) the default icon is ★
    //     'unchecked_color' => '#ccc', // (optional) the default value is #ccc
    //     'checked_color' => '#ffc700', // (optional) the default value is #ffc700
    //     'hover_color' => '#c59b08', // (optional) the default value is #c59b08
    // ],
]);
star.blade.php