Laravel Popular Post


How to use inject view in Laravel 5?

Nowdays, Laravel is a very popular framework, it has a lots of function and that's why always choose this. In this post you can learn how to use and why we should use inject view, Laravel 5 introduce blade inject view that way you can make your own view file that file will not depend any variable, controller or view, that means like widget. Why we should use blade inject in our project, so if we work on front-end project and we always print categories on left side, i mean in every page so we always share $categories variable for listing. But If we include inject view that way we don't need to.....

By Hardik Savani | June 15, 2016 | | 937 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 | | 929 Viewer | Category : Laravel
READ MORE

How to execute artisan commands from route or controller in Laravel ?

Sometimes we require to run php artisan command from route or controller file in out Laravel Application, However we can do it using Artisan facade. Laravel Artisan facade that way we can easily run all artisan command with argument. Artisan facade have two method call() and queue(), queue() through we can simply make process in queue like email sending etc. So let's see simple example with route. In this example we run "php artisan migrate" command using artisan facade. Here i bellow example you can learn how you can run artisan commands from route. <strong>Example:</strong> <pre class="pre.....

By Hardik Savani | February 12, 2017 | | 886 Viewer | Category : Laravel
READ MORE

How to get config file value in Laravel 5?

Whenever you need to get configuration files value then you can get using config helper in Laravel 5. If you are working on Laravel 4 then you should use Config facade for get and set value of config file. Maybe sometimes we require to get application url from app.php file or database name from database.php file so you can get this way: <strong>Example:</strong> <pre class="prettyprint lang-php"> config('app.url'); OR Config::get('app.url'); </pre>

By Hardik Savani | May 25, 2016 | | 831 Viewer | Category : Laravel
READ MORE

How to execute mysql query in laravel?

Sometimes, we require to run directly mysql query on Laravel for example if you need to copy one table to other table using mysql query. I also need in one project and that's why i am fetching problem. But you can use sql query on laravel using db statement in bellow example you can learn how to run. <strong>Example:</strong> <pre class="prettyprint lang-php"> DB::statement(" INSERT INTO `posts` (repost_of_id,token_id,post_details,user) SELECT id,token_id,post_details,".$loginUserId." FROM `posts` where id = ".$postId." "); </pre>

By Hardik Savani | May 2, 2016 | | 814 Viewer | Category : Laravel
READ MORE

Laravel 5 - Example of Database Seeder with insert sample data

We should know what is database seeder in laravel and why we should use before start example of database seeding. Laravel provides a tool to add sample or dummy data to our databases automatically. that is call it database seeding. Laravel database seeder through we can add simply testing data on our database table. Database seed is extremely useful because testing with various data allows you to likely detect bugs you otherwise would have overlooked. We have to simple make one time seeder with some dummy data, that way we can simply reuse when you deploy project first time. We can make seede.....

By Hardik Savani | February 23, 2017 | | 773 Viewer | Category : Laravel
READ MORE

How to check if View Exists or not in Laravel 5?

In some situations, we require to check if view exists then render view otherwise display something else. But you can perform this task using "exists" function of view helper. It will return true or false. So you can use bellow example. <strong class="example">Example:</strong> <pre class="prettyprint lang-php"> if (view()->exists('users.index')) { .... } </pre>

By Hardik Savani | April 12, 2016 | | 754 Viewer | Category : Laravel
READ MORE

Laravel 5 - How to get difference of time in minutes?

Sometimes we require to calculate minutes difference between two dates in Laravel Application. But Laravel provide Carbon class. Help of Carbon class we can simply calculate minutes difference between two dates. you can simply customize code also. In Following example you can see, we have a two dates, first $to variable and second one $from variable. Carbon class diffInDays function using you can get difference between two dates. So, let's see bellow example, it is pretty simple: <strong>Example:</strong> <pre class="prettyprint lang-php"> $to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i.....

By Hardik Savani | September 14, 2016 | | 739 Viewer | Category : Laravel
READ MORE

How to quick run laravel project?

If you want to run laravel project without virtual host then you can run quickly using laravel artisan command. if you are beginner and you are confuse how to run laravel application then it is very simple to run so just run bellow command in your terminal: <strong>Run Project</strong> <pre>php artisan serve</pre> After this command you can copy this link and check on your browser: <pre>http://localhost:8000/</pre>

By Hardik Savani | April 24, 2016 | | 730 Viewer | Category : Laravel
READ MORE

Solve - no connection could be made target machine actively refused it laravel

I fetched this issue when i was new in laravel and i clone project on my bitbucket. I was tring to run my project, but when i composer update at last i had found this error : no connection could be made because the target machine actively refused it laravel. If you also found this error then <strong class="path">Check your Database Configration (database.php)</strong>. maybe you haven't setting of your database configration details. After this it will run try this, it was worked for me....

By Hardik Savani | June 22, 2016 | | 729 Viewer | Category : Laravel
READ MORE


    Twitter Bootstrap - Digital Clock picker with AM PM example using clockface plugin

    Twitter Bootstrap - Digital Clock picker with AM PM example using clockface plugin

    Open Post

    Bootstrap form validation example with demo using validator.js plugin

    Bootstrap form validation example with demo using validator.js plugin

    Open Post

    Laravel 5 Google OAuth authentication using Socialite Package

    Laravel 5 Google OAuth authentication using Socialite Package

    Open Post

    Bootstrap progress bar animate example using bootstrap-progressbar.js

    Bootstrap progress bar animate example using bootstrap-progressbar.js

    Open Post

    Laravel 5 amazon s3 file upload tutorial - Part 1

    Laravel 5 amazon s3 file upload tutorial - Part 1

    Open Post

    How to create authentication(login and registration) in Laravel 5.2?

    How to create authentication(login and registration) in Laravel 5.2?

    Open Post