Back to notes
Which Laravel folder contains Blade templates?
Press to flip
The `resources` folder.
How do you handle CSRF protection in Laravel?
Laravel automatically generates a CSRF token for each active user session and includes it in each form; you include it in AJAX requests using the `@csrf` Blade directive.
How can you publish configuration files in Laravel?
Using the command `php artisan vendor:publish`.
What is the purpose of the `.env` file in a Laravel project?
It is used to configure environment variables like database credentials and mail settings.
How do you install Laravel Breeze for quick authentication setup?
Run `composer require laravel/breeze --dev` followed by `php artisan breeze:install`.
What is the purpose of middleware in Laravel?
Middleware acts as a filter for HTTP requests entering your application.
What utility-first CSS framework is recommended for Laravel frontend integration?
Tailwind CSS.
What is Vite used for in a Laravel project?
Vite is a module bundler for integrating frontend assets like CSS and JavaScript.
What is the `compact` function used for in Laravel?
It simplifies passing data to views.
How do you define a resource route in Laravel?
`Route::resource('notes', NoteController::class);`
How do you create a migration file in Laravel?
`php artisan make:migration <migration-name>`
Which Laravel folder contains the migration files?
The `database` folder.
What command is used to create a new Laravel project?
`composer create-project --prefer-dist laravel/laravel <project-name>`
What command is used to start a development server in Laravel?
`php artisan serve`
What is Eloquent ORM and its purpose in Laravel?
Eloquent ORM provides an object-relational mapping to interact with the database using models.
Which Artisan command generates a resource controller for a model?
`php artisan make:controller <ControllerName>Controller --resource --model=<ModelName>`
Which command creates both a model and a migration in Laravel?
`php artisan make:model <ModelName> -m`
What command initializes the npm dependencies for a Laravel project?
`npm install`
How do you implement email verification in Laravel?
Laravel provides built-in features to ensure user emails are verified, typically through email verification routes and middleware.
Explain the purpose of the `storage` folder in a Laravel project.
The `storage` folder is used to store files generated by the framework, such as logs and compiled Blade templates.
Previous
Next