Ho un certo numero di file php nel mio progetto:laravel 5 MethodNotAllowedHttpException in RouteCollection.php linea 201:
admin.blade.php
: questo file contiene il modulo di amministrazione.
Quando definiva visualizza errore seguente:
MethodNotAllowedHttpException in RouteCollection.php line 201
<h2>Please Log In To Manage</h2>
<form id="form1" name="form1" method="post" action="<?=URL::to('/admin')?>">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
User Name:<br />
<input name="username" type="text" id="username" size="40" />
<br /><br />
Password:<br />
<input name="password" type="password" id="password" size="40" />
<br />
<br />
<br />
<input type="submit" name="button" id="button" value="Log In" />
</form>
In route.php
, questa chiamata è costituito:
Route::get('/admin',array('uses'=>'[email protected]'));
Questa è la funzione in student.php
public function admin()
{
return View::make('student.admin');
$validator = Validator::make($data = Input::all() , User::rules());
if ($validator->fails())
{
return Redirect::back()->withErrors($validator)->withInput();
}
else
{
$check = 0;
$check = DB::table('admin')->get();
$username = Input::get('username');
$password = Input::get('password');
if (Auth::attempt(['username' => $username, 'password' => $password]))
{
return Redirect::intended('/');
}
return Redirect::back()->withInput()->withErrors('That username/password combo does not exist.');
}
}
Non so molto sulla creazione di un'area di amministrazione, sto solo cercando di crearlo.
Stai usando 'metodo posto d'sotto forma ma avendo' metodo GET' negli itinerari! –
devo chnge ottenere nella mia forma ?? –
Modificare i percorsi e vedere cosa succede;) –