Laravel Interview Question Answer
What is PSR-4 in Laravel?

By PSR-4 , We can define namesaces in any location, For example we create user namespace that looks classes for
app/usersection and we define location in composer.json.

 

"autoload": {
"classmap": [
"app/database/migrations",
"app/database/seeds"
],

"psr-4": {
"User\\": "app/usersection/",

}
},

What is PHP Artisan commands?

PHP artisan is run on command line interface, By php artisan we can create controller, modal, project down/up, database migration etc. for this we just goto your project

c:\xampp\htdocs\shishirtest>

Then enter artisan command, some example of artisan.

To create controller
php artisan make:controller controllername

To enable maintenance mode
php artisan down

To disable maintenance mode
php artisan up

To see list of artisan command
php artisan list

Laravel features

Inbuilt CRSF(cross-site request forgery)
Inbuilt paginations
Reverse Routing
Query builder
Database migration
Authentication
Template engine

What is Dependency Injection

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.

What is Laravel 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.

instead of creating objects manually with the new keyword, you can register a binding on the Service Container,and create an instance through the service container.

What are service providers?

All laravel application is bootstrapped in Service providers. Our application and all laravel services are also bootstrapped by service providers.

Mostly service providers contain register and boot method, All service providers extend the Illuminate\Support\ServiceProvider class.

What is contracts?

Contracts are set of interfaces that define the core services provided by the framework.For example for email services we use contractIlluminate\Contracts\Mail\Mailer 

What is composer?

Composer is a tool for manage dependency in php. Dependency means suppose you want to install Laravel Framework and Laravel require other packages. so if Install laravel by Composer then laravel install and other required packages is also install.

What is default packages of Laravel 5.4 ?

Cashier
Envoy
Passport
Scout
Socialite


Next

Share on Facebook
Success Story
Nikhil kumar singh
Avatar
PHP Developer
IT & DC
My field was different and I was confident that web page creation and designing was something I will never be able to do. I had tried to train myself with It and Dc and then I found out it is not so tough and I was able to enjoy the training. I had started as a fresher but now I am a successful trainer and train people on the same subject.
Tenzi norsang
Avatar
PHP Developer
TGC India
My friends were happily placed in big companies in much better position than I was. I found this training course through It and Dc and it really enhanced my knowledge in different ways about the PHP development and web design. The result in with me now as I have got no time to think about anything else now other than my work as a web developer.
Sponsored Ads