As made route in laravel?

Good day dear programmers in laravel created routers? Already more than 2 months I can not understand how all dispensations? For me happiness only to deal with this and continue to train on their own frameworke.

Just tell me how the routing in laravel pliz

Which folder is the implementation of the $router->get() as I understand there is a RESTful API ->post

https://habr.com/ru/post/265845/

I thought that url must be able to connect controller such as

lumen.local/public/about

AboutController.php

further

lumen.local/public/controller/action/parametr

But it's different there is another app/Http/Controllers

lumen.local/public
lumen.local/public/about

routes/web.php

$router->get('/', function () use ($router) {
 return $router->app->version();
});

$router->get('/about', function()
{
 return 'About';
});


Did something like this roughly in laravel all elegantly down to my bad code

<?php

 $action = $_SERVER['REQUEST_URI'];

 $routes = [];

 route('/', function()
{
 $title = 'Home';

 $template =
[
'header',
'content',
'footer'
];

 view($title, $template);
});

 route('about', function()
{
 $title = 'About';

 $template =
[
'header',
'content',
'footer'
];

 view($title, $template);
});

 function route($action = null, $callback = null)
{
 global $routes;

 $action = trim($action, '/');

 $routes[$action] = $callback;
}

 function getPath($action = null)
{
 global $routes;

 $action = trim($action, '/');

 $callback = $routes[$action];

call_user_func($callback);
}

getPath($action);

//View

 function view($title = null, $template = [])
{
 require_once 'views/' . 'index.php';
 }
March 19th 20 at 09:19
2 answers
March 19th 20 at 09:21
Solution
View the basics you will understand, then understand:

PSR-7 framework 2/7: Routing and controllers

The video creates its own routing close to the pack Aura, which in turn is close to maravillosa. That is not just how to use it, and how it works and why. Long and useful.
Thank you very much! - eladio_Yundt commented on March 19th 20 at 09:24
March 19th 20 at 09:23
what? no? It's some left in the packet, which the routing with new interface stalls is irrelevant. Author - shenali is the answer? - Francesca commented on March 19th 20 at 09:26

Find more questions by tags Laravel