Amazing didatics as always (i'll say it again, even for us that already use the language for long time)... I'd just add constants in Router class for each method, because it bother's me using "magic strings" even if its used once.
It is probably the point. Teach the users how the MVC and logic works so it's easy for someone to start on Laravel or keep it as mini-framework for small projects. I did something similar with a course teaching like this and in the end started Laravel and was like: "Hey, it's really similar" and was really easy to migrate a project to the framework.
It's precisely the point. :) I want to make onboarding to any PHP framework as intuitive as possible. When you try Laravel after completing this series, you'll think to yourself, "Oh, I totally get this."
Great how you explain it step by step. I love it. The method add is public, but on that point it could be private like the variable routes, couldn't it?
Hi, great video. One thing that i do not understand is how in note route route ( show route) , the URI match ? since that route has a query string, which query string is in URI should not match. Another thing, i think that in first version of this series, at root of routes array you create the methods as keys and associate the respective route ( uri + controller) to method key, so you had assoc array instead of index array that you have now in this new series. And why not use preg_match?
I have written all the routes using the router->get() syntax, but only the top 1 is getting rendered rest all are showing Error404.php page 😢. Can somebody help me?
Hi @Laracastsofficial how do you handle the routes for images inside the uploads folder? It always goes to 404 even on direct URL. Or even CSS/JS folder so I can add it dynamically on my routes.
used this code with IIS Server with web.config file to send each file to public/index.php but could not load the static files like .js, .css and images can you guide
Your routers way isn't working . I tried a lot but getting in trouble each time. I also tried to implement it on real hosted website to analyze either may be something wrong with my virtual php environment but still it's not been working.
Is anyone still monitoring this playlist? Everything has worked great until this video. The new routing system has broken everything and nothing works.
In order to actually save a new note and to delete a note, routes.php should be $router->get('/', 'controllers/index.php'); $router->get('/about', 'controllers/about.php'); $router->get('/contact', 'controllers/contact.php'); $router->get('/notes', 'controllers/notes/index.php'); $router->get('/note', 'controllers/notes/show.php'); $router->get('/notes/create', 'controllers/notes/create.php'); // Jeffrey forgot these last two routes $router->post('/notes/create','controllers/notes/create.php'); $router->delete('/note','controllers/notes/show.php');
Thanks for the lesson. I didn't understand what really happens behind the scenes in Laravel and now I do 😊
Amazing didatics as always (i'll say it again, even for us that already use the language for long time)...
I'd just add constants in Router class for each method, because it bother's me using "magic strings" even if its used once.
I thought I was the only one thinking that way.
i have a filing that this series will end up with laravel as final result hhhhh
It is probably the point. Teach the users how the MVC and logic works so it's easy for someone to start on Laravel or keep it as mini-framework for small projects. I did something similar with a course teaching like this and in the end started Laravel and was like: "Hey, it's really similar" and was really easy to migrate a project to the framework.
It's precisely the point. :)
I want to make onboarding to any PHP framework as intuitive as possible. When you try Laravel after completing this series, you'll think to yourself, "Oh, I totally get this."
@@Laracastsofficial 🥳💝
@@Laracastsofficial thank you i love the way you explain with
great stuff Jeffrey!
Great how you explain it step by step. I love it.
The method add is public, but on that point it could be private like the variable routes, couldn't it?
Cool thing will be later to show how {param} variables can be appended to routes
Thanks for awesome tutorials
I learn a lot about core php
👌👌👌
Hi, great video.
One thing that i do not understand is how in note route route ( show route) , the URI match ?
since that route has a query string, which query string is in URI should not match.
Another thing, i think that in first version of this series, at root of routes array you create the methods as keys and associate the respective route ( uri + controller) to method key, so you had assoc array instead of index array that you have now in this new series.
And why not use preg_match?
Because we're only getting the path, not the query string.
$uri = parse_url($_SERVER['REQUEST_URI'])['path'];
@@Laracastsofficial
Ya, after i post the comment i went to review the code and reach the same conclusion, lol.
Anyways should be useful for others.
this episode is a little hard, but amazing
I have written all the routes using the router->get() syntax, but only the top 1 is getting rendered rest all are showing Error404.php page 😢. Can somebody help me?
Could you solve it? I have the same issue.
Tanks a lot
Hi @Laracastsofficial how do you handle the routes for images inside the uploads folder? It always goes to 404 even on direct URL. Or even CSS/JS folder so I can add it dynamically on my routes.
you the best
No doubt
used this code with IIS Server with web.config file to send each file to public/index.php
but could not load the static files like .js, .css and images
can you guide
You the best 👌
That meme😂😂
Why wont use URI as $routes array key in order not to cycle the $routes array for finding the matching REQUEST URI?
👍
Anyone knows what theme Jeffey is using here? I tried Googling, but only found the old theme in Laracasts.
i think materialize?
It's called Carbon.
All of the things I use are listed here: laracasts.com/uses
Hey Jeffrey, is the source code available?
is there a way to get the code of this video??
can we stand against AI with php ?
I tried a lot on your routers but these are not working, even on real website i tried to implement it not working.
Your routers way isn't working . I tried a lot but getting in trouble each time. I also tried to implement it on real hosted website to analyze either may be something wrong with my virtual php environment but still it's not been working.
Did you ever figure it out? Nothing is working for me either with this new router.
Is anyone still monitoring this playlist? Everything has worked great until this video. The new routing system has broken everything and nothing works.
In order to actually save a new note and to delete a note, routes.php should be
$router->get('/', 'controllers/index.php');
$router->get('/about', 'controllers/about.php');
$router->get('/contact', 'controllers/contact.php');
$router->get('/notes', 'controllers/notes/index.php');
$router->get('/note', 'controllers/notes/show.php');
$router->get('/notes/create', 'controllers/notes/create.php');
// Jeffrey forgot these last two routes
$router->post('/notes/create','controllers/notes/create.php');
$router->delete('/note','controllers/notes/show.php');