Dasun Dasun - 9 months ago 48
PHP Question

Laravel 5 Call to undefined function App\Http\Controllers\riderect() Error

i

m new to the laravel and i
m developing file uploading system. up-to file upload to the database is OK. but when i try to delete it gives this error.

Call to undefined function App\Http\Controllers\riderect()

here is the FileUpload Controller.and its delete function

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Redirect;
use App\UploadedFile;

class FilesController extends Controller
{
public function deleteFile($id)
{
$file = UploadedFile::find($id);
Storage::delete(config('app.fileDestinationPath').'/'.$file->filename);
return riderect()->to('uploaded');
}
}


can anyone suggest me to solve this error?
Thank you.

Answer Source

It is a spelling error, this:

return riderect()->to('uploaded');

Should be:

return redirect()->to('uploaded');