config/filesystem : 'public2' => [ 'driver' => 'local', 'root' => storage_path('app'), 'url' => env('APP_URL') . '/public', 'visibility' => 'public', ], UploadImage : namespace App\Utils;
use Illuminate\Http\Request; use Illuminate\Support\Str;
class ImageUpload { public static function upload(Request $request, $image, $directory = 'images') { $filename = Str::uuid() . $request->title . '.' . $image->extension(); $image->store('app/public/' . $directory, $filename);
return $image . '/' . $directory . '/' . $filename;
}
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community