How to Insert Data using Eloquent | Full Laravel 9 Course | Laravel For Beginners | Learn Laravel

preview_player
Показать описание
This video will show you two different ways on how you could insert data into the database using Eloquent – Want to learn the most popular PHP framework? Laravel makes your development process a lot easier without sacrificing your applications functionalities.

📚 New Udemy Course

📲 Let’s plan a meeting

💌 Newsletter

🔥 Resources

🔗 Useful links

📋 Table of Content
00:00 - Introduction
01:35 - Request object
02:11 - Linking the ‘New Article’ button
02:47 - 404 - Restructuring routes
03:18 - Working with CSRF tokens
07:22 - Method 1 on storing data
09:47 - Redirecting after a POST method
10:48 - Method 2 on storing data

#laravel #framework #php #laravel9 #eloquent
Рекомендации по теме
Комментарии
Автор

The best series so far! Keep it up :) Thank you so much

salehalnaggar
Автор

I think that 'show' route should have a chain method of 'whereNumber('id')'. This will let 'create' route shows. I really appreciate your videos and the way you simplify things.

mohammedbenaoumeur
Автор

I became addicted to your laravel courses! Love it. But today I didn't catch one thing. Why the /create route has to be moved to the top of the route group? Is there some logic behind? Thanks!

petrsimunekCZ
Автор

hi, maybe this question is unrelated to the video, but I wanted to know, why does my code insert 2 data into database, I only wanted 1 data stored, but when I checked on phpmyadmin, I got 2 of the same data, instead of storing 2 data, somehow it inserted 4 data, any idea?

public function store(Request $request)
{
DB::table('stuff')
->insert
([
'name' => Fan',
'id_category' => 1,
'qty' => 11,
'buy_price' => '160',
'sell_price' => ''240',
]);

echo "Data has been saved";
}

elnozz
Автор

I think the create.blade.php in the git repo has no lines?

Zeus-giih
welcome to shbcf.ru