Laravel quiz and interview questions

Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern. Some of the features of Laravel are a modular packaging system with a dedicated dependency manager, different ways for accessing relational databases, utilities that aid in application deployment and maintenance

Recent added questions

  •  

    What method is used to include "soft deleted" entries to the result? What's behind XXXXXXX?

    $flights = App\Flight::XXXXXXX()
                    ->where('account_id', 1)
                    ->get();

     

  • Let's say you have several languages folders like resources/lang/en and resources/lang/es. Where would the default language be set? In which file? 

  • After running artisan make:auth - what new controller will be generated? 

  • Look at the code snippet. If that middleware fails, what HTTP code would be returned?
     

    Route::put('/post/{post}', function (Post $post) {
        // The current user may update the post...
    })->middleware('can:update,post');

     

  • What are the methods used in database migrations classes?

  • This command will roll back all of your migrations and then execute the migrate command. This command effectively re-creates your entire database.

  • Look at the snippet below - command generates the test. What does the class extend? What's behind XXXXXX?

    php artisan make:test UserTest
    
    class UserTest extends XXXXXX
    {
    // ...

     

  • Look at the code snippet. What relationship will it actually make?
     

    class Comment extends Model
    {
        /**
         * Get the post that owns the comment.
         */
        public function post()
        {
            return $this->belongsTo('App\Post', 'post_id', 'post_id');
        }
    }

     

View all Laravel quiz questions

© 2017 QuizBucket.org