1. Go to this page and download the library: Download uzzal/legacy-router 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/ */
namespace App\Http;
...
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Uzzal\LegacyRouter\LegacyRouter;
...
class Kernel extends HttpKernel
{
...
public function __construct(Application $app)
{
$router = new LegacyRouter($app['events'], $app);
$app->singleton('router', function($app) use ($router){
return $router;
});
parent::__construct($app, $router);
}
...
}
namespace App\Console;
...
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Uzzal\LegacyRouter\LegacyRouter;
use Illuminate\Contracts\Foundation\Application;
...
class Kernel extends ConsoleKernel
{
...
public function __construct(Application $app)
{
$router = new LegacyRouter($app['events'], $app);
$app->singleton('router', function($app) use ($router){
return $router;
});
parent::__construct($app, $app['events']);
}
...
}
class TestController extends Controller
{
public function getIndex(){
return 'this is a get request';
}
public function postStore(){
return 'this is a post request';
}
}
Route::controller('/test', 'TestController');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.