首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >语法错误,意外的'__data‘(T_STRING),应为',’或')‘(视图: C:\xampp\htdocs\boxe\resources\views\utenteShow.blade.php)

语法错误,意外的'__data‘(T_STRING),应为',’或')‘(视图: C:\xampp\htdocs\boxe\resources\views\utenteShow.blade.php)
EN

Stack Overflow用户
提问于 2018-08-19 05:10:07
回答 1查看 12.8K关注 0票数 1

我需要解决这个问题,当我按下record按钮时,程序应该将我带到刚刚注册的用户的页面,但我得到了这个错误:

错误:

语法错误,意外的'__data‘(T_STRING),应为',’或')‘(视图: C:\xampp\htdocs\boxe\resources\views\utenteShow.blade.php)

路由:

代码语言:javascript
复制
Route::post('/registrazione/store','RegistrazioniController@store')->name('registrazione.store');

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

控制器:

代码语言:javascript
复制
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'));
}

查看:

代码语言:javascript
复制
@extends('layouts.layout)

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

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

        @endforeach

@endsection
EN

回答 1

Stack Overflow用户

发布于 2018-08-19 05:26:29

视图的扩展参数中缺少右引号。

应该是@extends('layouts.layout')

票数 14
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51912573

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档