Laravel


Laravel schema default current timestamp value example

Some days ago, i was working my laravel 5.4 application and i require to create new migration with create_at column only, update_at was no more require. So i decided to set default current timestamp value to created_at column. But i was thing how is it possible to set default current timestamp to created_at column using laravel schema. i started to read docs and i found useCurrent() of schema bu.....

Posted On August 1, 2017

Guzzle http client GET and POST request example in Laravel 5

today we will learn how to send request to server using Guzzle http client in laravel 5 application. As we know sometimes we require to use api of other website like facebook, instagram, wordpress etc, and we have to use their api then we have to two options curl and another is http guzzle. So i think laravel provide Guzzle http client composer package and it's amazing. we simply use that package .....

Posted On July 31, 2017

Laravel 5 Chart example using Charts Package

It's always good fit for understand if we use some graphical way display our progress report using chart. So if you are working with laravel 5 framework then you can use chart very simple way and best layout. There are several js library available for chart like chartjs, highcharts, google, material, chartist, fusioncharts, morris, plottablejs etc. in this example we will just use one laravel "Con.....

Posted On July 29, 2017

Laravel 5 datatables example from scratch

Data Tables is a plug-in for the jQuery Javascript library. DataTables provide us flexibility to search, list, sort and pagination using jquery. We can also simply use ajax with datatables too. So in this tutorial, i will tell you how to use datatables in laravel 5 application, after this you can simply use with all version like 5.1 to upcomming laravel 5.5 So, in this example i will use yajra/la.....

Posted On July 26, 2017

Laravel - chmod(storage/oauth-private.key): Operation failed: Operation not permitted

It's always make us mud less when we got strange issue or error. Same thing here describe. i got following error when i did work with git repository. I pushed my code and my friend pull that code and when he run he got following error: "chmod(storage/oauth-private.key): Operation failed: Operation not permitted" I google and try to run bellow command: <pre> php artisan passport:install </pre> Bu.....

Posted On July 25, 2017

Laravel generate random unique string example

Sometimes, we require to generate random string for token or something other login in laravel 5 application. if i remember exactly, 1 year ago i was working on my laravel 5 application at that moment i need to create unique string. I search on google and laravel docs i found str_random() helper of php laravel framework to generate random string, we need to just give then number as argument and i.....

Posted On July 25, 2017

How to fix - "Illegal string offset 'w:compatSetting'"

Yesterday, i was working on my php laravel 5 application and i installed PHPOffice/PHPWord package and trying to use it in controller. But when i run my project and see i got following error : "Illegal string offset 'w:compatSetting'" Even i generate docx file, i thought why it's come event file is created successfully. I try to understand deeply but i didn't get well. However i found temporary s.....

Posted On July 21, 2017

PHP Laravel select2 js example from scratch

Here, I will let you know very simple example of generate select box using select2 jquery plugin in laravel application. Bootstrap provide very simple drop-down box. But if you want to add search with select box then you should use select2 js plugin. Select2 plugin provide us select drop-down box with search value and there are several feature available in select2 js. So in this example i am goin.....

Posted On July 19, 2017

Laravel 5 check if file uploaded or not using hasFile or isValid

It is very easy to check if uploaded file or image empty or not if you are using core PHP. But as we know laravel 5 provide us object of file, So we can not determine using empty(). However, we can simply do it using hasFile() and isValid() of laravel predefine. So i am going to give you basic example of both function one by one. So let's simply see both example and use it. <strong class="step-up.....

Posted On July 16, 2017

Laravel 5 global variable in all views file

Here, i will let you know how to set global variable in laravel 5 application. In this article i will set globle variable two way on simple view share and another using composer view share. As we know, every webiste or project there are several things are comman and access it in every page like footer text, logo, site title etc. So it is necessary to define it one time and access it on all views .....

Posted On July 16, 2017