1. Go to this page and download the library: Download fuzz/magic-box 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/ */
fuzz / magic-box example snippets
/**
* Define the routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function map(Router $router)
{
// Register a handy macro for registering resource routes
$router->macro('restful', function ($model_name, $resource_controller = 'ResourceController') use ($router) {
$alias = Str::lower(Str::snake(Str::plural(class_basename($model_name)), '-'));
$router->resource($alias, $resource_controller, [
'only' => [
'index',
'store',
'show',
'update',
'destroy',
],
]);
});
$router->group(['namespace' => $this->namespace], function ($router) {