Laravel Tricks

Browse latest tricks and tips on Laravel.

How to check current installed version of Laravel ?

Check laravel versionUse php artisan --version command to check current installed version of Laravel FrameworkUsage:php artisan --version ...
published on : 10 minutes ago 12 Comments

Call to a member function connection() on null Laravel Lumen

Enabling Eloquent in LumenBy defaults Eloquent is not enabled in Lumen, To use Eloquent functions un-comment $app->withEloquent(); line from your bootstrap/app.php file. ...
published on : 3 hours ago 12 Comments

Active Record Implementation in Laravel?

How to use Active Record in Laravel Active Record Implementation is an architectural pattern found in software engineering that stores in-memory object data in relational databases ...
published on : 30 minutes ago 12 Comments

Rollback all migrations in Laravel

Laravel rollback all migrations In order to rollback/ remove your all migrations in Laravel, use below artisan command. php artisan migrate:reset ...
published on : 5 minutes ago 12 Comments

What does "composer dump-autoload" do?

Laravel composer dump-autoloadWhenever we run "composer dump-autoload" Composer re-reads the composer.json file to build up the list of files to autoload. ...
published on : 33 minutes ago 12 Comments

How to Clear cache in Laravel?

Step to clear cache in LaravelClear database cacheIn Laravel php artisan cache:clear command is used to clear cache. It will remove all the cache associated with the connection to ...
published on : 10 minutes ago 12 Comments

Installing Laravelcollective/html package in laravel 5.5

Laravelcollective/Html PackageIn order to use form helpers in Laravel 5, you need to install Laravelcollective/html package. Laravel's Laravelcollective/html package is HTML and Fo ...
published on : 3 hours ago 12 Comments

Sending data to view using redirect in Laravel?

You can send data to view using redirects in Laravel by using below code$data=['id'=>1,'name'=>'test']; return Redirect::route('Controller.method')->with('data' => $d ...
published on : 34 minutes ago 12 Comments

How to get user details by id or email in Laravel?

Get user by email in Laravel 5Laravel function to get user details by email or id in Laravelpublic function getUserByEmail(Request $request){ $email =$request->input('email ...
published on : 7 minutes ago 12 Comments

Generating application key in Lumen

Lumen generate keyTo generate application key in Lumen, please add your routes/web.php and point your domain to /key and copy the output string and paste it in your .env file$app-& ...
published on : 49 minutes ago 12 Comments