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 | | 3047 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 | | 47679 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 | | 30946 Viewer | Category : PHP Laravel
READ MORE

    Laravel 5 custom pagination view example

    Laravel 5 custom pagination view example

    Open Post

    How to integrate stripe payment gateway in Laravel 5.4 Application ?

    How to integrate stripe payment gateway in Laravel 5.4 Application ?

    Open Post

    How to integrate google map using gmaps.js in php example?

    How to integrate google map using gmaps.js in php example?

    Open Post

    Laravel 5.3 - image dimension validation rules example

    Laravel 5.3 - image dimension validation rules example

    Open Post

    Laravel 5 database backup using Laravel Backup Package

    Laravel 5 database backup using Laravel Backup Package

    Open Post

    Automatically Refresh or Reload a Page using jQuery Example

    Automatically Refresh or Reload a Page using jQuery Example

    Open Post