Level 10
https://stackoverflow.com/questions/29764102/redactor-image-upload-not-working-on-laravel-5 (that answer worked for me)
I am updating my CMS to laravel 5 from Laravel 4. But redactor image uploading not working . Here All code:
This is Route for Image Upload
//Redactor Image Upload
Route::post('image/upload', function(){
$image = Request::file('file');
$filename = 'bdtimes'.rand(10, 99999999).'.'.$image->getClientOriginalExtension();
$move = Image::make($image->getRealPath())->save('uploads/images/original/'.$filename);
if($move){
return Response::json(['filelink'=>'/uploads/images/original/'. $filename]);
}else{
return Response::json(['error'=>true]);
}
});
This is Script of Redactor:
$(function()
{
$('#redactor').redactor({
focus: true,
imageUpload: '{{ url() }}/image/upload',
imageManagerJson: '{{ url() }}/image.php',
plugins: ['table', 'video','imagemanager','fontcolor','fontsize','fullscreen'],
maxHeight: 300,
minHeight: 300
});
});
N.B. This is working well in laravel 4.
Please or to participate in this conversation.