Image

Upload Image From Subdomain to Root Public Folder Laravel

Upload image or file from subdomain to the main/root domain in laravel.

If you have a subdomain like subdomain.abc.com and you want to upload file to abc.com in laravel then you can use the following code.

if ($request->hasFile('slider')) {
				$techImage          	= $request->file('slider');
				$techImageFile        	= str_slug($request->input('title'), "-").'-'.$techImage->getClientOriginalName();
				$destinationPath 		= '/home/abc/public_html/public/slider_img/';
				$techImage->move($destinationPath, $techImageFile);
	         }

$destinationPath         = '/home/abc/public_html/public/blogs_img/';

destinationPath  which is basically full path and here abc is your main domain name

Categories: PHP Tags: #Laravel, #PHP 7,

Newsletter Subcribe

Receive updates and latest news direct from our team. Simply enter your email.