Category Archives: Laravel

php artisan –version not working in laravel it throws error-In UrlGenerator.php line 111: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in

C:\xampp\htdocs\myproj>php artisan –version While executing this command it throws the below error. Solution: Normaly this issue will happen if the config files contains url(). Please remove all the url() related things from the config.php Or comment all the code and try the above command once more it will show properly. In UrlGenerator.php line 111: Argument… Read More »

Usage of SoftDelete in laravel 5.6

This is explained here using the below model,controller files EmpMaster.php


Getting the error in laravel SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘updated_at’ in ‘field list’

Getting the error in laravel SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘updated_at’ in ‘field list’ (SQL: update emp_details set testID = 999, updated_at = 2018-09-03 14:50:09 where (testID = 1)) This error usually comes when the updated_at field missing in the laravel table.if the fields are not in the table in the database we… Read More »

Dynamicallay generated Checkbox validation using jquery

Laravel blade

Jquery code

Ajax based File upload using Form data not working in laravel

Below is my ajax code to upload the file

Please add the below code to work the fileupload proper

if the issue still exists add the following extra things in the ajax call

json writer adding extra slash to the serialized file

if you are getting the serialize result with extra slash like below {“uploaded_path”:”C:\\xampp\\htdocs\\myproject\\public\\assets\\uploads\\myimages This issue normaly occurs when missed the json_decode function in the code For example Refer the below lines of code $upload_data = array(‘uploaded_path’ => $destinationPath); $jsonformat=serialize(json_encode($upload_data)); print_r($jsonformat); // this will output as, {“uploaded_path”:”C:\\xampp\\htdocs\\myproject\\public\\assets\\uploads\\myimages To remove the double slashes you can use the… Read More »

Laravel Ajax call showing 302 error/Response as response payload

This issue comes because of missing csrf token please add the below code if its not there.

Laravel redirects to public/login after logout.or trying to access dashboard

Below code explains the laravel redirection afterlogout. After logout if you try to access home/dashboard, it will redirect to following url http://localhost/schoolidcard/public/index if we try to access the below url http://localhost/schoolidcard/public/superadmin/dashboard it should redirect to http://localhost/schoolidcard/public/superadmin/ instead of this it is redirecting to below path http://localhost/schoolidcard/public/index Solution:for redirecting to superadmin/login .Add the below lines of… Read More »