PHP code example of luissobrinho / lcrud
1. Go to this page and download the library: Download luissobrinho/lcrud 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/ */
luissobrinho / lcrud example snippets
@form_maker_table();
@form_maker_object();
@form_maker_array();
@form_maker_columns();
form_maker_table();
form_maker_object();
form_maker_array();
form_maker_columns();
LForm::fromTable();
LForm::fromObject();
LForm::fromArray();
LForm::getTableColumns();
[
'id' => [
'type' => 'hidden',
],
'name' => [
'type' => '', // defaults to standard text input
'placeholder' => 'User Name Goes Here!',
'alt_name' => 'User Name',
'custom' => 'custom DOM attributes etc',
'class' => 'css class names',
'before' => '<span class="input-group-addon" id="basic-addon1">@</span>',
'after' => '<span class="input-group-addon" id="basic-addon2">@example.com</span>',
],
'job' => [
'type' => 'select',
'alt_name' => 'Your Job',
'custom' => 'multiple', // custom attributes like multiple, disabled etc
'options' => [
'key 1' => 'value_1',
'key 2' => 'value_2',
]
],
'roles' => [
'type' => 'relationship',
'class' => 'App\Repositories\Roles\Roles',
'label' => 'name' // the field for the label in the select input generated
]
]
[ 'name', 'birthday' ]
[ 'name' => 'string', 'birthday' => 'date' ]
InputMaker::label();
InputMaker::create();
[
'type' => '', // defaults to standard text input
'placeholder' => 'User Name Goes Here!',
'alt_name' => 'User Name',
'custom' => 'custom DOM attributes etc',
'class' => 'css class names',
'before' => '<span class="input-group-addon" id="basic-addon1">@</span>',
'after' => '<span class="input-group-addon" id="basic-addon2">@example.com</span>',
]
php artisan vendor:publish --provider="Luisobrinho\LForm\LFormProvider"
LForm::fromTable($table, $columns = null, $class = 'form-control', $view = null, $reformatted = true, $populated = false, $idAndTimestamps = false)
fromObject($object, $columns = null, $view = null, $class = 'form-control', $populated = true, $reformatted = false, $idAndTimestamps = false)
blade
fromArray($array, $columns = null, $view = null, $class = 'form-control', $populated = true, $reformatted = false, $idAndTimestamps = false)