1. Go to this page and download the library: Download typerocket/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/ */
typerocket / laravel example snippets
'providers' => [
// Other Service Providers
TypeRocket\Service::class,
],
class PostController extends Controller
{
public function create(Request $request)
{
$form = new \TypeRocket\Form('Post', 'create', null, '/posts/');
$form->setRequest($request); // set request
return view('posts.create', ['form' => $form]);
}
}
class PostController extends Controller
{
public function store(Request $request)
{
$tr = $request->input('tr');
$validator = \Validator::make($tr, [
'title' => 'ic();
$post->title = $tr['title'];
$post->save();
header('Location: /posts/');
}
}
Route::post('matrix_api/{group}/{type}', function($group, $type) {
(new TypeRocket\Matrix())->route($group, $type);
});
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
class VerifyCsrfToken extends BaseVerifier
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'matrix_api/*' // added
];
}