Php 页面重定向问题laravel 5.2

Php 页面重定向问题laravel 5.2,php,laravel-5.2,Php,Laravel 5.2,大家好,我是laravel的新手,我正在创建一个页面,我可以在其中添加一个用户,然后它必须重定向到管理员/用户(用户列表页面),但问题是它重定向到管理员/用户,但没有我的母版页的列表显示或UI。但当我刷新页面时,列表会显示出来 这是必须显示列表的页面index.blade.php @extends('layouts.admin') @section('content') <table class="table"> <thead>

大家好,我是laravel的新手,我正在创建一个页面,我可以在其中添加一个用户,然后它必须重定向到管理员/用户(用户列表页面),但问题是它重定向到管理员/用户,但没有我的母版页的列表显示或UI。但当我刷新页面时,列表会显示出来

这是必须显示列表的页面index.blade.php

@extends('layouts.admin')

@section('content')


         <table class="table">
    <thead>
      <tr>
        <th>Name</th>
        <th>Email</th>
        <th>Role</th>
        <th>Status</th>
        <th>Created</th>
        <th>Updated</th>
      </tr>
    </thead>
    <tbody>
  @if($showUsers)
    @foreach($showUsers as $users)
      <tr>
        <td>{{$users->name}}</td>
        <td>{{$users->email}}</td>
        <td>{{$users->role->name}}</td>
        <td>{{$users->is_active == 1 ? 'Active' : 'Not Active'}}</td>
        <td>{{$users->created_at->diffForHumans()}}</td>
        <td>{{$users->updated_at->diffForHumans()}}</td>
      </tr>
    @endforeach
    @endif
    </tbody>
        </table>
@stop
@extends('layouts.admin')

@section('content')

    {!! Form::open(['method'=>'POST', 'action'=>'AdminUserController@store', 'files'=>true]) !!}

    <div class="form-group">
        {!! Form::label('name', 'Name') !!}
        {!! Form::text('name', null, ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('email', 'Email') !!}
        {!! Form::email('email', null, ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('is_active', 'Status') !!}
        {!! Form::select('is_active', array(1=>'Active', 0=>'Not Active'), null, ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('role_id', 'Role') !!}
        {!! Form::select('role_id', [''=>'Choose Options'] + $showRoles, null, ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('file', 'Upload User Image') !!}
        {!! Form::file('file', ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('password', 'Password') !!}
        {!! Form::password('password', ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::submit('Create User', ['class'=>'btn btn-primary']) !!}
    </div>

    {!! Form::close() !!}

    @include('includes.formErrors')

@stop
Routes.php

Route::resource('admin/users', 'AdminUserController');
并创建.blade.php

@extends('layouts.admin')

@section('content')


         <table class="table">
    <thead>
      <tr>
        <th>Name</th>
        <th>Email</th>
        <th>Role</th>
        <th>Status</th>
        <th>Created</th>
        <th>Updated</th>
      </tr>
    </thead>
    <tbody>
  @if($showUsers)
    @foreach($showUsers as $users)
      <tr>
        <td>{{$users->name}}</td>
        <td>{{$users->email}}</td>
        <td>{{$users->role->name}}</td>
        <td>{{$users->is_active == 1 ? 'Active' : 'Not Active'}}</td>
        <td>{{$users->created_at->diffForHumans()}}</td>
        <td>{{$users->updated_at->diffForHumans()}}</td>
      </tr>
    @endforeach
    @endif
    </tbody>
        </table>
@stop
@extends('layouts.admin')

@section('content')

    {!! Form::open(['method'=>'POST', 'action'=>'AdminUserController@store', 'files'=>true]) !!}

    <div class="form-group">
        {!! Form::label('name', 'Name') !!}
        {!! Form::text('name', null, ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('email', 'Email') !!}
        {!! Form::email('email', null, ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('is_active', 'Status') !!}
        {!! Form::select('is_active', array(1=>'Active', 0=>'Not Active'), null, ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('role_id', 'Role') !!}
        {!! Form::select('role_id', [''=>'Choose Options'] + $showRoles, null, ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('file', 'Upload User Image') !!}
        {!! Form::file('file', ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('password', 'Password') !!}
        {!! Form::password('password', ['class'=>'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::submit('Create User', ['class'=>'btn btn-primary']) !!}
    </div>

    {!! Form::close() !!}

    @include('includes.formErrors')

@stop
@extends('layouts.admin'))
@节(“内容”)
{!!Form::open(['method'=>'POST','action'=>'AdminUserController@store“,”文件“=>true])!!}
{!!Form::label('name','name')
{!!Form::text('name',null,['class'=>'Form-control'])
{!!表单::标签('email','email')
{!!Form::email('email',null,['class'=>'Form-control'])
{!!Form::label('is_active','Status')
{!!Form::select('is_active',array(1=>'active',0=>'notactive'),null,['class'=>'Form-control'])!!}
{!!Form::label('role_id','role')
{!!Form::select('role_id',[''=>'Choose Options']+$showRoles,null,['class'=>'Form-control'])
{!!Form::label('file','Upload User Image')!!}
{!!Form::file('file',['class'=>'Form-control'])
{!!Form::label('password','password')!!}
{!!Form::password('password',['class'=>'Form-control'])
{!!表单::提交('Create User',['class'=>'btn btn primary'])
{!!Form::close()!!}
@include('includes.formErrors')
@停止

您可以使用
重定向
助手方法:

return redirect('admin/users');
重定向到包含数据的路由的操作如下:

return redirect()->route('admin/users', ['users' => $users]);

以下是有关

如何返回重定向的文档?您的控制器显示返回的响应不正确。我该如何做?我只是在学习一些教程。谢谢