Category Archives: Laravel

How to do Ajax form validation In Laravel

Below code shows simple form entry in laravel using Ajax. It uses the server side validation as well as client side validation Code for Routes.php,view and controllers are defined here.. Routes.php

MypageController.php

View page:mylistpage.blade.php

Appending javascript variable to php variable in laravel

For example adding a $employee_id (php variable) to a link with javascript variable

Response::download() laravel not working-shows error-Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?)

In the previous blog entry i explained force download in laravel http://mydoubts.in/blog/force-download-in-laravel-file-download-in-laravel/ if you are getting the below error Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?) No need to change the php.ini settings -php_fileinfo extension below code will works using the header information

Force Download in laravel-file download in laravel

In this Blog i m written the code for force download option in a webpage using laravel. Please check the routes.php,controller and view files In this example one image file is stored inside the folder-public/upload_image/mypic.jpg Routes.php

fileListController.php

filelist.blade.php

undefined variable error in laravel

In the Foolowing scenario you will get the undefined variable error.

in this case we will get the error as ErrorException in c8b54f60da9fa9e08371cc15bab47dba58b6f7b3.php line 3: Undefined variable: test Ans:solution for this error is as below please assing the test varable as $this->test=’some text’;

getClientOrginalName() in Laravel file upload not working

getClientBadMethodCallException in Macroable.php line 81: Method getClientOrginalName does not exist. If you are getting the Above error in laravel while doing file upload. Usualy this error will come because of some fields missing in the form So please add files=true in the form field

Public static usage in Laravel

Insert into a table using laravel/get the last inserted value.

see the below statement for inserting records and to find out last inserted id of the record

Laravel Pagination using Ajax call/Onclick not working in laravel pagination using ajax

Issue:onclick not working in laravel5 if we use external js