By OnlineInterviewQuestions com Php laravel Interview Questions What is Laravel?


You can specify route names for controller actions



Download 39.11 Kb.
View original pdf
Page3/9
Date17.09.2022
Size39.11 Kb.
#156480
1   2   3   4   5   6   7   8   9
laravel-interview-questions

You can specify route names for controller actions:
Route::get('user/profile', 'UserController@showProfile')->name('profile');
Once you have assigned a name to your routes, you may use the route's name when generating URLs orb bredirects via the global route function:
// Generating URLs...
$url = route('profile');
// Generating Redirects...
return redirect()->route('profile');


Q9.
What is database migration. How to create migration via artisan ?
Migrations are like version control for your database, that’s allow your team to easily modify and share the application’s database schema. Migrations are typically paired with Laravel’s schema builder to easily build your application’s database schema.
Use below commands to create migration data via artisan creating Migrationphp artisan make:migration create_users_table
Q10.
What are service providers in Laravel ?
Service Providers are central place where all laravel application is bootstrapped . Your application as well all
Laravel core services are also bootstrapped by service providers.
All service providers extend the Illuminate\Support\ServiceProvider class. Most service providers contain a register and a boot method. Within the register method, you should only bind things into the service container. You should never attempt to register any event listeners, routes, or any other piece of functionality within the register method.
You can read more about service provider from here
Q11.
Explain Laravel’s service container ?
One of the most powerful feature of Laravel is its Service Container. It is a powerful tool for resolving class dependencies and performing dependency injection in Laravel.
Dependency injection is a fancy phrase that essentially means class dependencies are injected into the class via the constructor or, in some cases, setter methods.

Download 39.11 Kb.

Share with your friends:
1   2   3   4   5   6   7   8   9




The database is protected by copyright ©essaydocs.org 2022
send message

    Main page