[
34
]
Then, we can seed the database by calling it, using the following command:
$ php artisan db:seed
Seeding is good for initially populating a database. If we were to re-run the seed
command, we would actually get an error as we're defining primary keys for our
records; if we tried re-seeding, the database will trigger a duplicate primary key
error. We can first truncate the table, but this will be dangerous if deployed to a
production environment, as it will delete any user-contributed records, as well as
your seed data definitions!
Mastering Blade
Now that we have some information in our database, we need to define the
templates that are going to display it. Blade is Laravel's lightweight template
language and its syntax is very easy to learn. Here are some examples of how Blade
can reduce the number of keystrokes and increase the readability of your templates:
Do'stlaringiz bilan baham: |