Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (SoranĂ®)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Before we move on, let's talk about CRUD. Do you
know what that acronym stands for?
It stands for create, read, update, and delete.
These are the four basic operations for working with a resource.
In our application, we have a blog post resource, and we
want to allow users to create new posts.
Also, we need to provide a way to read them, in other words,
to show the information about a specific post.
And we also want to allow users to update them and delete them.
This pattern is so common that frameworks like Laravel
provide a lot of functionality to manage these operations
in a predictable and uniform way.
For example,
Laravel provides us with a special type of controller
known as a resource controller.
This resource controller assumes that you will implement
CRUD operations on a specific resource.
So unlike the regular controller, it will be prepopulated with certain actions.
And here are the names of these actions that will be provided by default. Create
and store should sound familiar because that is exactly how we named our two
routes for creating and storing a new post resource.
So the create action should serve a form for creating a new resource, and store
action should actually store that resource in the database.
The show action should read the information from the database about a particular
resource instance and show it to the user. Edit and update are similar to create
and store, but the edit action serves the form for modifying an existing
resource instance and update is used for updating information about that
instance. Destroy is self‑explanatory.
It is used for deleting a specific instance of the resource from the
database. So these actions round up all of the CRUD operations.
This only leaves us with the index section,
which is usually used to present all of the
instances from that specific resource.
So if the resource in question is a blog post,
this action should show a list of all blog posts from the database.
In the next lesson,
we will implement this resource controller in our own application.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.