Birmingham mumbai


Download 1.3 Mb.
Pdf ko'rish
bet66/68
Sana05.01.2022
Hajmi1.3 Mb.
#227543
1   ...   60   61   62   63   64   65   66   67   68
Bog'liq
Laravel 5 Essentials

[

 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:


Download 1.3 Mb.

Do'stlaringiz bilan baham:
1   ...   60   61   62   63   64   65   66   67   68




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling