-2

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 :)

ps : the error message enter image description here

1 Answers1

-1

Since ypur namespace suggests the said controller resides in the same directory as the extended controller you dont need to specify this.

Also depending on the laravel version you may require running

php artisan dump:autoload
GingaWRATH
  • 98
  • 4