This issue will fix after doing composer update,orelse clear the cache. After doing this steps it will work
again it is not woking restart the server/or your machine
This issue will fix after doing composer update,orelse clear the cache. After doing this steps it will work
again it is not woking restart the server/or your machine
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 below function
dd(json_decode(unserialize($jsonformat)));
If you are using Xampp server then use the following method
go to the below folder
phpmyadmin/libraries/config.default.php
inside config.default.php edit the line as like below
$cfg[‘ExecTimeLimit’] = 0;
Retrieve all input data as an array using the following method
$input = $request->all();
28.Directory structure in laravel
1.Root directory
2.App directory
Root directory contains the below directories.
app,bootstrap,config,database,public,resources,routes,storage,test,vendor
App directory contains the below directories
Broadcasting,Console,events,Exceptions,Http,Jobs,Listeners,Mail,Notifications,Policies,Providers,Rules
The method method will return the HTTP verb for the request.
You may use the isMethod method to verify that the HTTP verb matches a given string:
$method = $request->method();
if ($request->isMethod(‘post’)) {
//
}
url() method retrieve the full url with out querystring and fullUrl() retrieves the url with query string
// Without Query String…
$url = $request->url();
// With Query String…
$url = $request->fullUrl();
if the incoming request is http://mydoubts.in/admin/login
$uri=$request->path();
this will return admin/login
is method verify the incoming request path matches the given pattern.we can use * character for this
if($request->is(‘admin/*’))
{
}
$path=$request->photo->path();
$extension=$request->photo->extension();
To verify there were no problems while uploading the file using isValid() function
if ($request->file(‘photo’)->isValid()) {
//
}
Access the uploaded file using Illuminate\Http\Request instance.
$file=$request->file(‘photo’) //File method
$file=$request->photo; //dynamic properties
here file method returns an instance of the Illuminate\Http\UploadedFile class, which extends the PHP SplFileInfo
A File is present on the request using has method
if ($request->hasFile(‘photo’)) {
//
}