PHP code example of ministrare / laravel-core-package

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

    

ministrare / laravel-core-package example snippets


<?= Form::Method('POST', route('login')) 

<?= Form::Input('type', 'label (optional)', 'slug (optional)', ['options (optional)'])->Render() 

<?= Form::Input('checkbox', __('label'), 'slug', [
    //Required
    'options' => [
        'value_checkbox_option_1' => '(string) label checkbox option 1',
        'value_checkbox_option_2' => '(string) label checkbox option 2',
    ],
    // optional
    'class' => '(string) If set, sets the HTML property class with given value.',
    'message' => '(string) If set, sets and show the error message.',
    'value' => "(string) if set, sets the checkbox that matches the giving key value",
])->Render() 

<?= Form::Input('checkbox', __('Remember Me'), 'remember', [
    'class' => 'col-md-8 offset-md-2',
    'options' => [
        'remember' => __('Remember Me'),
    ],
    'message' => isset($message) ? $message : '',
    'value' => $checkbox,
])->Render() 

<?= Form::Input('email', __('label'), 'slug', [    
    // optional
    'autocomplete' => '(boolean) If set, sets the HTML property autocomplete with the slug.',
    'autofocus' => '(boolean) If set, sets the HTML property autofocus.',
    'class' => '(string) If set, sets the HTML property class with given value.',
    'icon' => '(string) If set, shows a font-awesome 4.7.0 icon instead of the label. example: "address-book" will result in "fa fa-address-book".',        
    'message' => '(string) If set, sets and show the error message.',
    'placeholder' => '(string) If set, sets the HTML property placeholder with given value.',
    '

<?= Form::Input('email', __('E-mail'), 'email', [
    'placeholder' => '[email protected]',
    'class' => 'col-md-8 offset-md-2',
    '

<?= Form::Input('password', __('label'), 'slug', [    
    // optional
    'autocomplete' => '(boolean) If set, sets the HTML property autocomplete with the slug.',
    'autofocus' => '(boolean) If set, sets the HTML property autofocus.',
    'class' => '(string) If set, sets the HTML property class with given value.',
    'icon' => '(string) If set, shows a font-awesome 4.7.0 icon instead of the label. example: "address-book" will result in "fa fa-address-book".',        
    'message' => '(string) If set, sets and show the error message.',
    'placeholder' => '(string) If set, sets the HTML property placeholder with given value.',
    '

<?= Form::Input('password', __('Password'), 'password', [
    'class' => 'col-md-8 offset-md-2',
    'message' => isset($message) ? $message : '',
    'value' =>  '',
])->Render() 

<?= Form::Input('radio', __('label'), 'slug', [
    //Required
    'options' => [
        'value_radio_option_1' => '(string) label radio option 1',
        'value_radio_option_2' => '(string) label radio option 2',
    ],
    // optional
    'class' => '(string) If set, sets the HTML property class with given value.',
    'message' => '(string) If set, sets and show the error message.',
    'value' => "(string) if set, sets the radio option that matches the giving key value",
])->Render() 

<?= Form::Input('radio', __('Remember Me'), 'remember', [
    'class' => 'col-md-8 offset-md-2',
    'options' => [
        0 => __('Remember Me'),
        1 => __('Don`t Remember Me'),
    ],
    'message' => isset($message) ? $message : '',
    'value' =>  '',
])->Render() 

<?= Form::Input('select', __('label'), 'slug', [
    //Required
    'options' => [
        'value_radio_option_1' => '(string) label radio option 1',
        'value_radio_option_2' => '(string) label radio option 2',
    ],
    // optional
    'class' => '(string) If set, sets the HTML property class with given value.',
    'emptyFirst' => "(string) If set, places a empty option in front of the options to display e empty field on load",
    'message' => '(string) If set, sets and show the error message.',
    'multiple' => '(boolean) if set, allows the user to select multiple options.',
    'value' => "(mixed) if set with value_radio_option, will select this option on load. For multiple select, array value allowed."
])->Render() 

<?= Form::Input('select', __('Roles'), 'roles', [
    'class' => 'col-md-8 offset-md-2',
    'emptyFirst' => true,
    'options' => [
        1 =>'test',
        2 =>'Administrator',
        3 =>'Administrator',
        4 =>'Administrator',
    ],
    'value' => 2,
])->Render(); 

<?= Form::Input('string', __('label'), 'slug', [    
    // optional
    'autocomplete' => '(boolean) If set, sets the HTML property autocomplete with the slug.',
    'autofocus' => '(boolean) If set, sets the HTML property autofocus.',
    'class' => '(string) If set, sets the HTML property class with given value.',
    'icon' => '(string) If set, shows a font-awesome 4.7.0 icon instead of the label. example: "address-book" will result in "fa fa-address-book".',        
    'message' => '(string) If set, sets and show the error message.',
    'placeholder' => '(string) If set, sets the HTML property placeholder with given value.',
    '

<?= Form::Input('string', __('First name'), 'first_name', [    
    'placeholder' => 'First name',
    'class' => 'col-md-8 offset-md-2',
    '

<?= Form::Input('textarea', __('label'), 'slug', [
    // optional
    'class' => '(string) If set, sets the HTML property class with given value.',
    'rows' => "(integer) If set, sets the HTML property rows with given value",
    'value' => '(mixed) If set, sets the textarea with given value',
])->Render() 

<?= Form::Input('textarea', __('Message'), 'message', [
    'class' => 'col-md-8 offset-md-2',
    'rows' => 3,
    'value' => $message,
])->Render() 

<?= Form::Input(string)->Label(string)->Slug(string)->Options(array)->Render(); 

<?= Form::End() 

<?= Utilities::createSlug(string $name) 

<?= Utilities::keyExists(string $needle, array $haystack)