PHP code example of laraform / laraform-laravel
1. Go to this page and download the library: Download laraform/laraform-laravel 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/ */
laraform / laraform-laravel example snippets
php
// app/Forms/MyFirstForm.php
namespace App\Forms;
use Laraform;
class MyFirstForm extends Laraform
{
public $schema = [
'hello_world' => [
'type' => 'text',
'label' => 'Hello',
'default' => 'World'
]
];
}
php
// routes/web.php
Route::get('/', function () {
return view('welcome', [
'form' => app('App\Forms\MyFirstForm')
]);
});