Does this course use Laravel 8 or version 9, please? TIA
laravel 8
So far so go with the course. There is an extra migration in my migrations folder "personal_access_tokens". I deleted it but it migrates when migrating "users". Why does "personal_access_tokens" migrate if it's not in the migrations folder?
Very Enjoyable course. I initially opted for Slim years ago as it was lightweight compared to Laravel but I have to admit, Laravel is less of a pain in the ass...
I think I might carry around the extra pounds ;)
Hi Guys - A bit late to the party and I am using the following:
Windows 7 Xampp 3.3.0 PHP 8.1.2 Laravel Installer 4.2.10 laravel/framework 9.2
I have been followiing the tutorials with success until episode 12 (submitting forms)
Everything works up until I try to POST a form
@ 4:53 Alex posts 'CATS' and he gets a 419 error (session expired) whereas I am getting a 404 error (not found)
An interest point I noticed is Alex is using the server root directory for this tutorial and I have my project nested within various folders.
Instead of the POST being directed to the local area that it is called from I am getting:
http://localhost/post
Whereas I am calling from:
http://localhost/projects/Teachers/CodeCourse/LARAVEL/laravelbasics/public/posts/create.
I have tried amending the route information on the ROUTES/WEB.PHP file and the CREATE.BLADE .PHP file but then I get another error:
where the file path seems duplicated and removing either of them seems to bring me back to the first issue :/
Would appreciate some guidance :)
UPDATE 1:
I had to modify the URL to allow for me not being in the default webserver directory:
form action="{{ url('/posts') }}" method="post"
Adding the url function sorted it out :)
UPDATE 2: I should have waiting til 10:30 but learned something useful nevertheless...
thanks
Loving this series, and I relate to this strategy much better than some of the others who I'd stumbled across. Might be good to mention a couple of times that IDE specific problems may occur that aren't really problems. For example, PHPstorm doesn't automatically recognize (some, or all?) eloquent models, even though they function when executed. I've stumbled upon many warnings suggesting that the model doesn't exist, when clearly it does, because it works. I spent over an hour bumbling through trying to figure out what I did wrong, or missed in the series, when warned that "the method 'find' was not found in App\Models\Post." It turned out to only be the IDE causing trouble. Anyway - really great series. I'm feeling real progress using these. Thank you.
is it the same course posted on Traversymedia channel?
EXCELLENT, I'm glad i found this site..made my 2020 way better!
Off topic: what is the name of the plugin that adds the "import class" function to my VSCODE editor after right - clicking
PHP namespace resolver https://marketplace.visualstudio.com/items?itemName=MehediDracula.php-namespace-resolver
Thanks...
Alex, what theme are you using in VS Code? I would like the blade syntax to be highlighted and not just white.
Download the Laravel Extension Pack https://marketplace.visualstudio.com/items?itemName=onecentlin.laravel-extension-pack
Error! Target class [PostController] does not exist.
PostController.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PostController extends Controller { public function index() { $posts = [ ['id' => 1, 'title' => 'Post one'], ['id' => 2, 'title' => 'Post two'], ['id' => 3, 'title' => 'Post three'] ];
1 return view('posts.index', [2 'posts' => $posts3 ]);4}
}
web.php
use Illuminate\Support\Facades\Route;
Route::get('/', function () { return view('home'); });
Route::get('/posts', 'PostController@index');
The way controller route declarations are defined changed in Laravel 8.
web.php use Illuminate\Support\Facades\Route; use App\Http\Controllers\PostController;
change: Route::get('/posts', 'PostController@index');
to: Route::get('/posts', [PostController::class, 'index']);
Read more about it here: https://laravel.com/docs/8.x/upgrade (Search for routing)
Thanks both. The course has now been completely refreshed to address the move from Laravel 7 to Laravel 8.
Thanks Alex!
Thanks Paul!
Hi, Alex, can you include lessons on policy & gates, or how to manage user roles and permissions on a simple way?
Hi Alex! I did the change in ~/.zshrc file for
export PATH="$HOME/.composer/vendor/bin:$PATH"
and it worked also.
Thanks for the great content.
Where are the source code?