PHP code example of diviky / laravel-form-components

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

    

diviky / laravel-form-components example snippets


return [
    'framework' => 'bootstrap-4',
];

return [
    'use_eloquent_date_casting' => true,
];

class ActivityModel extends Model
{
    public $dates = ['finished_at'];

    public $casts = [
        'started_at'   => 'date',
        'failed_at'    => 'datetime',
        'completed_at' => 'date:d-m-Y',
        'skipped_at'   => 'datetime:Y-m-d H:i',
    ];
}

use Livewire\Component;

class ContactForm extends Component
{
    public $name;
    public $email;

    public function submit()
    {
        $this->validate([
            'name' => 'nction render()
    {
        return view('livewire.contact-form');
    }
}

$countries = [
    'be' => 'Belgium',
    'nl' => 'The Netherlands',
];

return [
    'prefix' => 'tailwind',
];

return [
    'framework' => 'bootstrap-5',
];
blade
<x-form-select name="country_code" :options="$countries" />
bash
php artisan vendor:publish --provider="Diviky\LaravelFormComponents\Support\ServiceProvider"