PHP code example of rinvex / laravel-forms

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

    

rinvex / laravel-forms example snippets


// Get instance of your parent model (ex. `Event`)
$event = new \App\Models\Event::find(1);

// Create multiple new forms
$event->forms()->createMany([
    [...],
    [...],
    [...],
]);

// Find an existing form
$form = app('rinvex.forms.form')->find(1);

// Update an existing form
$form->update([
    'name' => 'Contact Us',
]);

// Delete form
$form->delete();

// Alternative way of form deletion
$event->forms()->where('id', 123)->first()->delete();

// Get attached forms collection
$event->forms;

// Get attached forms query builder
$event->forms();
shell
    php artisan rinvex:publish:forms
    
shell
    php artisan rinvex:migrate:forms