Tag : ServiceProvider


How to set global view variables using composer share in Laravel 5?

Everyone will have same situation sometimes, like we have some information that we need to access in all view files for example site title, login user information, footer information etc. But, we can define global view variables using composer() of Laravel. We just have to define value in AppServiceProvider and we can access that variable in every blade files. In bellow example i set "siteTitle" variable as global and i can access that variable in every view files. You have to just open <strong class="path">AppServiceProvider.php</strong> and we can set variable as like bellow: <strong>app/.....

By Hardik Savani | July 8, 2016 | | 1966 Viewer | Category : Laravel
READ MORE

Laravel 5 Repository Pattern Tutorial from scratch

In this post i want to share with you how to create Repository Pattern in Laravel 5 application. generally we are getting data directly from model, I mean we are use just MVC. But if you have big application then it is better way if you use Repository Pattern. I will give you few step to create Repository Pattern. normally we use directly from Model but if you make Repository Pattern for every module then it is good way to develop laravel application. <img width="100%" style="border:2px solid red" src="/upload/Laravel-5-Repository-Pattern-Tutorial.png"> <strong class="step">Step 1: Create In.....

By Hardik Savani | April 13, 2016 | | 17961 Viewer | Category : Laravel
READ MORE

How to create Event for Mail sending in Laravel 5.2?

Events provides a simple observer implementation, allowing you to subscribe and listen for events in your application. In this posts you can learn how to create event for email send in your laravel 5.2 application. event is very help to create proper progmamming way. First create event using bellow command. <pre class="prettyprint lang-php">php artisan make:event SendMail</pre> Ok, now you can see file in this path <strong class="path">app/Events/SendMail.php</strong> and put bellow code in that file. <strong>app/Events/SendMail.php</strong> <pre class="prettyprint lang-php"> namespace App\Ev.....

By Hardik Savani | March 13, 2016 | | 14152 Viewer | Category : PHP Laravel
READ MORE

    How to use Select with MySQL DATE_FORMAT() in Laravel?

    How to use Select with MySQL DATE_FORMAT() in Laravel?

    Open Post

    Laravel 5 - How to create custom error page with example

    Laravel 5 - How to create custom error page with example

    Open Post

    laravel 5.4 New Feature - Add eloquent whereKey method

    laravel 5.4 New Feature - Add eloquent whereKey method

    Open Post

    Laravel 5.3 - Create Bootstrap Contact US Form using Form Request

    Laravel 5.3 - Create Bootstrap Contact US Form using Form Request

    Open Post

    Magento 2 - How to solve one or more indexers are invalid by command line?

    Magento 2 - How to solve one or more indexers are invalid by command line?

    Open Post

    Laravel 5 - Multiple markers in google map using gmaps.js

    Laravel 5 - Multiple markers in google map using gmaps.js

    Open Post