I try to do a basic form and I did that 1 week ago but this time I have a new bug surely a stupid mistake but...
So here is my UsersController
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class UsersController extends Controller
{
public function getInfos()
{
return view('infos');
}
public function postInfos(Request $request)
{
return 'His name ' . $request->input('firstname');
}
}
My infos.blade
@extends('template')
@section('contenu')
{!! Form::open(['url' => 'users']) !!}
{!! Form::label('frstname', 'Your name : ') !!}
{!! Form::text('firstanme') !!}
{!! Form::submit('Send !') !!}
{!! Form::close() !!}
@endsection
And the web.php
Route::get('users', 'UsersController@getInfos');
Route::post('users', 'UsersController@postInfos');
I use a template but I'm almost sure that's not the problem , I think I do bad routing , I have this error message
syntax error, unexpected 'namespace' (T_NAMESPACE)
Thx to help me :)
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Hu4dcP
via IFTTT
Aucun commentaire:
Enregistrer un commentaire