Проблема с PHP-кодом
<?php use Illuminate\Support\Facades\Route; use Illuminate\Http\Request; /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::get('/', function () { return View::make('home'); }); Route::get('/about', function () { return View::make('about'); }); Route::get('/contact', function () { return View::make('contact'); }); Route::post('contact', function() { $data = Request::all(); $rules = array( 'subject' => 'required', 'message' => 'required' ); $validator = Validator::make($data, $rules); if($validator-> fails()) { return Redirect::to('contact')->withErrors($validator)->withInput(); } return 'Your message has been sent'; });
Приведенный выше код Laravel возвращает приведенную ниже ошибку
Non-static method Illuminate\Http\Request::all() should not be called statically
Что я уже пробовал:
Я попробовал изменить $request->Все();