Laravel 5 调用未定义函数 App\Http\Controllers\riderect() 错误

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

我是 laravel 的新手,我正在开发一个文件上传系统。文件上传并存储到数据库就好了,但是当我尝试调用删除方法时,它给出了这个错误:

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

这是 FileUpload 控制器及其删除方法:

<?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');
    }
}

如何避免这个错误?

这是一个拼写错误,这个:

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

应该是:

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

riderect()->to('uploaded');替换为redirect()->to('uploaded');