PHP code example of ycs77 / laravel-crud-page

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

    

ycs77 / laravel-crud-page example snippets


'resources' => [
    // ...

    'post' => [
        'model' => '\App\Post',
        'controller' => '\App\Http\Controllers\PostController',
        'file_store' => 'posts',
        'view_name' => null,
        'actions' => [
            'index' => true,
            'create' => true,
            'show' => true,
            'edit' => true,
            'delete' => true,
        ],
    ],
],

class PostController extends CrudController
{
    /**
     * Get table fields.
     *
     * @see https://github.com/KABBOUCHI/laravel-table-view#usage
     * 
     * @return array
     */
    protected function getTableFields()
    {
        return [
            'Title' => 'title',
        ];
    }

    /**
     * Get form fields.
     * 
     * @see https://github.com/ycs77/laravel-form-field-type
     * 
     * @return array
     */
    protected function formFields()
    {
        return [
            'title' => [
                'type' => 'text',
                'rules' => '

CrudPage::routes('post');

php artisan vendor:publish --tag=laravel-crud-page
php artisan vendor:publish --tag=laravel-form-builder-bs4
php artisan vendor:publish --tag=laravel-form-field-type-config

php artisan make:crud:controller PostController