Category : Laravel



Example of unionAll in Query Builder Laravel 5

Sometimes you need to bind multimple query then you can use unionAll in laravel. If you use union all then laravel query builder provide unionAll method for mysql union. when you are doing big project or ERP level project then mostly you require to use union for getting data from database with multiple table. In Following example you can see how to use union all in Laravel 5. <strong>Example:</strong> <pre class="language-php"> $silver = DB::table("product_silver") ->select("product_silver.name" ,"product_silver.price" ,"product_silver.quantity"); $gold = DB::table("product_g.....

By Hardik Savani | March 2, 2016 | | 8445 Viewer | Category : Laravel
READ MORE

Laravel 5 Join with subquery in Query Builder Example

In this post i want to show you how to use subquery with join in laravel query builder. Whenever you need to use subquery in your laravel project you can use following example and learn hot to use subquery. In bellow example you can see we add subquery using DB::raw(), DB::raw() throught we can select our subtable and after in second argument i added compare your field. That way you can easily fire subquery with laravel 5.2 query builder. <strong>Example:</strong> <pre class="language-sql"> $data = DB::table("items") ->select("items.*","items_count.price_group","items_count.quantity_group") .....

By Hardik Savani | March 2, 2016 | | 47804 Viewer | Category : Laravel
READ MORE

Laravel 5 import export to excel and csv using maatwebsite example.

In this post i will show you how to import excel or csv to store in database and how to export or download excel or csv file from database table by maatwebsite. maatwebsite packages throught you can easily get data, also you can group by data, also create more then one sheet etc. so now i show you simple example of items table data, you can donwload in xls, xlsx and csv formate and also you import data in xls, xlsx and csv formate file. In following few step you can implement import and export both function in your project. First see your browser preview will become like this: <strong>Preivew:.....

By Hardik Savani | February 29, 2016 | | 410544 Viewer | Category : Laravel
READ MORE

How to create laravel 5 widgets ?

In this post you can learn how to create your own widgets in laravel 5.2, First thing why we are create widgets, So we can use widget because when we can create re-usable code, for example you have manu items and comes from database like home, items, products, aboutus, contact us etc. you require to display in top header, in sidebar and in footer. But in top you have to just display home and aboutus, and in sidebar products and items same that way in footer. So, basically you have to display in three place in your site page. widgets through you can make one function or view and call just one w.....

By Hardik Savani | February 27, 2016 | | 12619 Viewer | Category : Laravel
READ MORE

How to convert one time zone to anothor time zone

Some application required one time zone to convert another time zone. PHP provide some readymade timezone conversion classes but it a very complecated. so we have try to define this function simple way. You can createe a simple class and write one function into the class. then you able to use this function everywere. <pre class="language-php"> class convertTimezone { function convert_timezone() // Constructor of the class { } function converToTime($conv_fr_zon=0,$conv_fr_time="",$conv_to_zon=0) { //echo $conv_fr_zon; $cd = strtotime($conv_fr_t.....

By Hardik Savani | February 17, 2016 | | 1176 Viewer | Category : Laravel
READ MORE

laravel 5 change date format using carbon example

Sometimes you require to change date format in your laravel app. we have to use Carbon class for change format in laravel, because it provide many date function for like change date formate, count diffrence between two dates in days etc. So, Basically i am going to show you change date format using Carbon. we will use createFromFormat() and format(), createFromFormat() will take two argument first give format of date and second one date and format() take one argument give formate as you want. you can see bellow example: <strong>Example:</strong> <pre class="language-php"> $date = date('Y-m-d H.....

By Hardik Savani | February 16, 2016 | | 9667 Viewer | Category : Laravel
READ MORE

Laravel 5.2 and AngularJS CRUD with Search and Pagination Example.

Now i show you how to create CRUD(Create, Read, Update, Delete) using AngularJS and Laravel 5. In Following step by step you can create web application of create, edit, delete, lists, search with pagination of items modules. In this post through you can make simple crud, search and pagination module and easily use in your laravel project. I am going to show preview of items module that we will do using angularJS and Laravel 5.2. <strong>Preview</strong> <img src="/upload/laravel-angular.png" width="100%" style="border:2px solid cadetblue" /> <strong class="step">Step 1: Create items table an.....

By Hardik Savani | February 15, 2016 | | 175415 Viewer | Category : Laravel
READ MORE

How to get hours difference between two dates in laravel?

Whenever you need to get difference between two dates in hours in laravel 5 then you can get easily using Carbon. Laravel by default provide Carbon class. Carbon class throught you can calculate difference between two dates in hours. In Following example you can see, we have a two dates, first $to variable and second one $from variable. Carbon class diffInhours function using you can get difference between two dates. I hope you will find your solution. <strong>Example:</strong> <pre class="language-php"> $to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', '2015-5-5 3:30:34'); $from = \Carb.....

By Hardik Savani | February 13, 2016 | | 6186 Viewer | Category : Laravel
READ MORE

How to store all record in laravel5 Cache

if you are work with large application which depend on large query and required large number of record at that time your application performence littel bit down. that problem overcome with laravel Cache functionality. Laravel Cache provide to you store your large query in cache so your application performence improve. first of all you must write <stong>"use Cache"</strong> keyword on top of the your class Here is an example using Laravel’s Fluent Query Builder: <pre class="language-php"> $users = DB::table('order') ->orderBy('price', 'desc') ->take(10) ->.....

By Hardik Savani | February 11, 2016 | | 2642 Viewer | Category : Laravel
READ MORE

How to create custom facade in laravel 5.2?

Sometimes we are use repeat code and repeatedly use function at that time we can create custom facade for our project, that way you can create functions and use it.So, How to generate custom facade, I give you the few step to create custom facade: <strong>Step 1:Create class file app/ItSolution/DemoClass.php</strong> In Following step, first you should create "ItSolution" directory in app folder and create file DemoClass.php(<strong style="color:red">app/ItSolution/DemoClass.php</strong>).now copy the following code in your DemoClass.php file. <strong>app/ItSolution/DemoClass.php</strong> <pr.....

By Hardik Savani | February 10, 2016 | | 28538 Viewer | Category : Laravel
READ MORE

    Laravel 5 - Create modular structure application example using L5Modular package

    Laravel 5 - Create modular structure application example using L5Modular package

    Open Post

    Laravel 5 Twitter OAuth using Socialite Package

    Laravel 5 Twitter OAuth using Socialite Package

    Open Post

    Laravel 5 Google OAuth authentication using Socialite Package

    Laravel 5 Google OAuth authentication using Socialite Package

    Open Post

    Paytm payment gateway integration example in Laravel 5

    Paytm payment gateway integration example in Laravel 5

    Open Post

    How to create quick apache virtual host in Ubuntu?

    How to create quick apache virtual host in Ubuntu?

    Open Post

    How to copy to clipboard without flash in AngularJS ?

    How to copy to clipboard without flash in AngularJS ?

    Open Post