From the course: Laravel Essential Training
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Working with the database - Laravel Tutorial
From the course: Laravel Essential Training
Working with the database
In this course, we will use a MySQL database with Laravel. This default configuration is ready to work with Laravel Sail, which is what we are using within Codespaces. So if you're working locally using Herd, this might look slightly different to you, but you don't have to change the defaults. It will work. A database with this name was already created when the app was created and ready to connect. So everything is set up for us to start working with this database. Before we start creating a table and writing some queries, let's use a GUI tool to interact with the database. This Codespace ID already has a database client extension installed. So you should be able to see this database icon here. If you're working locally, you can download and install a tool like TablePlus. In Codespaces, open the database tool. Click on "Create Connection" and change these values to match the ones in the environment config. So host is mysql, username is sail, password is password. Let me change those…
Contents
-
-
-
-
Understand Laravel configuration3m 53s
-
(Locked)
Working with the database6m 3s
-
(Locked)
Creating and running migrations3m
-
(Locked)
Creating models and using Eloquent4m 12s
-
(Locked)
Challenge: Create a migration to add a column and update a row52s
-
(Locked)
Solution: Create a migration to add a column and update a row3m 2s
-
-
-
-
-
-
-