PHP code example of geeklearners / laravel-admin

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

    

geeklearners / laravel-admin example snippets


use App\Http\Requests\StoreContactTypeRequest;
use Geeklearners\Traits\ModelAdmin;
use Illuminate\Database\Eloquent\Model;

class ContactType extends Model
{
    use ModelAdmin;
    protected $guarded = ['id'];
    /**
     * Form fields to be displayed during creation
     */
    public static function formFields = [
        'name' => [
            'type' => 'text', 'class' => 'form-control'
        ],
        'description' => [
            'type' => 'text', 'class' => 'form-control'
        ],
        'status' => [
            'type' => 'select', 'class' => 'form-control', 'options' => ['1' => 'Active', '0' => 'Inactive']
        ]
    ];

    /**
     * Laravel FormRequest can be injected with the following key which of them will instantiated
     * at appropriate methods
     * 'store'=>...................
     * 'index'=>...................
     * 'update'=>..................
     * 'delete'=>..................
     */
    public static $form_requests = [
        'store' => StoreContactTypeRequest::class
    ];

    /**
     * List out the columns to ype='hidden' name='_token' value='" . csrf_token() . "'><input type='submit' value='Delete' class='btn btn-danger btn-sm'></form>";
        }];
    }
}

php artisan vendor:publish --tag=geeklearners_admin