1

I would need to solve this problem, when I press the record button, the program should bring me on the page of the user who has just registered but I get this error:

ERROR:

syntax error, unexpected '__data' (T_STRING), expecting ',' or ')' (View: C:\xampp\htdocs\boxe\resources\views\utenteShow.blade.php)

ROUTES:

Route::post('/registrazione/store','RegistrazioniController@store')->name('registrazione.store');

Route::get('/registrazione/{utente}','RegistrazioniController@show')->name('utente.show');

CONTROLLERS:

public function store(tabella_utenti $utente)
{
    $this->validate (request(),[
        'email' => 'required',
        'password' => 'required',
        'NomeUtente' => 'required'
    ]);
    $utente=tabella_utenti::create(request(['email','password','NomeUtente']));

    //comando che gli passa l'id
    $utente=tabella_utenti::all();
    $utenteId=$utente->id;
    return redirect(route('utente.show',compact('utenteId')));

}

public function show(tabella_utenti $utente)
{
    return view('utenteShow',compact('utente'));
}

VIEW:

@extends('layouts.layout)

@section('body')
    <h1>Pagina Utente</h1>

        @foreach($utente as $value)
        Nome:{{$value->NomeUtente}}

        @endforeach

@endsection
user3783243
  • 5,368
  • 5
  • 22
  • 41
sergioo
  • 331
  • 3
  • 4
  • 13
  • Possible duplicate of [PHP parse/syntax errors; and how to solve them?](https://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – James Aug 18 '18 at 21:38

1 Answers1

14

You are missing the closing quote in your Views' extends parameter.

It should be @extends('layouts.layout')

Gary Thomas
  • 2,291
  • 1
  • 9
  • 21
  • thanks,but now appear this kind of error:'Property [id] does not exist on this collection instance'. – sergioo Aug 18 '18 at 21:32
  • now i have this error:Trying to get property 'NomeUtente' of non-object (View: C:\xampp\htdocs\boxe\resources\views\utenteShow.blade.php) – sergioo Aug 18 '18 at 21:36
  • i solved haha,the error was in foreach, I had to eliminate it,thanks for help – sergioo Aug 18 '18 at 21:39