Laravel 5.5中的页面更新问题

时间:2019-01-10 18:03:56

标签: laravel-5

怎么样,我有一个未解决的特定问题,如下,如果我单击或在URL中输入第一张图片,则更新得很好,

enter image description here

但是,如果在按用户搜索过滤器后,路由发生了变化,并且当我单击“更新完美的上传页面”时,但是当我输入网址时,就会出现异常

enter image description here

这是例外

enter image description here

我不明白为什么会这样,

这些是我的路线,ROUTE1和ROUTE2

Route::get('/panel', 'PanelController@index');
Route::post('/panel/filtusuario', 'CuentaController@filtusuario')->name('usuario.filtusuario');
Route::post('/panel/gestion', 'CuentaController@ugestion')->name('usuario.ugestion');   //ROUTE 2
Route::post('/panel/bestado', 'CuentaController@bestado')->name('usuario.bestado');
Route::post('/panel/selectord', 'CuentaController@selectord')->name('usuario.selectord');
Route::get('/panel/revisar', 'CuentaController@revisar')->name('cuenta.revisar');
Route::post('/panel/estado', 'CuentaController@cestado')->name('cuenta.cestado');
Route::post('/panel/asignar', 'CuentaController@asignar')->name('cuenta.asignar');
Route::get('/panel/tareas', 'CuentaController@tareas')->name('cuenta.tareas');   //ROUTE 1 
Route::get('/panel/inactivo', 'CuentaController@inactivo')->name('cuenta.inactivo');
Route::get('/panel/reportes', 'CuentaController@reportes')->name('cuenta.reportes');
Route::get('panel/descarga', 'CuentaController@excel')->name('products.excel');
Route::resource('/panel/ecuentas', 'CuentaController')->except(['show']);
Route::resource('/panel/registros', 'RegistrosController');
Route::get('/panel/fecha', 'UsuarioController@fecha')->name('usuario.fecha');
Route::post('/panel/selector', 'UsuarioController@selector')->name('usuario.selector');
Route::post('/panel/cedula', 'UsuarioController@cedula')->name('usuario.cedula');
Route::resource('/panel/usuario', 'UsuarioController')->except(['show']);
Auth::routes();

和方法

  
  <?php

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use App\Usuarios;
use App\RoleUser;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Facades\Excel;


class CuentaController extends Controller
{

     /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    } 
 
  
  /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function tareas(Request $request)
    {
         $registrado = \Auth::user()->tipos_usuarios_id;

        if($registrado == 1)
          {

             $request->user()->authorizeRoles(['admin']);
             $userstarea=user::where("tipos_usuarios_id",3)->paginate(6);
             $usuariosOpciones =usuarios::where('asignacion', NULL)->pluck('usuario_ad', 'user_id')->unique(); 
             $conteo=user::where("tipos_usuarios_id",3)->count();
             return view('usuario.tareas')->with(["userstarea" => $userstarea, "usuariosOpciones" => $usuariosOpciones, "conteo" => $conteo]);
           

          }
       
    }
    
    
    
    
* @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function ugestion(Request $request)
    {
        $registrado = \Auth::user()->tipos_usuarios_id;

            if($registrado == 1)

           {

               $request->user()->authorizeRoles(['admin']);
               $valorgestion = (int)$request->valorgestion;
               $userstarea=user::where("username","=",$request->valorgestion)->paginate(6);
               $userstarea->appends(['valorgestion'=>$valorgestion]);
               $usuariosOpciones =usuarios::where('asignacion', NULL)->pluck('usuario_ad', 'user_id')->unique();
               $conteo=user::where("username","=",$request->valorgestion)->count();
               return view('usuario.tareas')->with(["userstarea" => $userstarea, "usuariosOpciones" => $usuariosOpciones, "conteo" => $conteo]);
               
           }
      
    }
    
    
     } 

和视图

@extends('layouts.layout')
@section('content')
<div class="row">
  <section class="content">
    <div class="col-md-10 col-md-offset-1">
      @if(Session::has('success'))
      <div class="alert alert-info">
        {{Session::get('success')}}
      </div>
      @endif
      <div class="panel panel-default">
        <div class="panel-body">
          <h3>Usuarios de gestion: {{ $conteo }}</h3>
          <div class="pull-left">

         
<form action="{{route('usuario.ugestion')}}" method="post">
			<table style="width:100%;" border="0">
			<tr><td style="width:50%;" border="0">  
			
                 
                 <input type="text" name="valorgestion" id="valorgestion" class="form-control input-sm" placeholder="Usuario"></td>

					         {{csrf_field()}}
                  <td style="width:50%;" border="1"><button type="submit" class="btn btn-primary">enviar</button>               
            </td></tr>
         </table> 
			 </form>

				
     <!--           <form action="{{route('usuario.ugestion')}}" method="get">
                    {{csrf_field()}}
  <input type="text" name="valorgestion" id="valorgestion" class="form-control input-sm" placeholder="Usuario">
                    <button class="btn btn-danger btn-xs" type="submit">enviar</button>
                </form> -->
                   
				   
				<br>

         
           
          </div>
          <div class="table-container">
            <table id="mytable" class="table table-bordred table-striped table-bordered">
             <thead>
               <th>Usuario Gestion</th>
               <th>Nombre</th>
               <th>Apellido</th>
               <th>correo</th>
               <th>Usuarios registros</th>
             </thead>
             <tbody>
              @if($userstarea->count()) 
              @foreach($userstarea as $usuario)  
              <tr>
                <td>{{$usuario->username}}</td>
                <td>{{$usuario->name}}</td>
                <td>{{$usuario->last_name}}</td>
                <td>{{$usuario->email}}</td>

                <td> 
                  <form action="{{action('CuentaController@asignar')}}" method="post">

                  <select name="valor" id="valor" class=" form-control"  value="{{ old('tipo') }}" required>
                        @foreach($usuariosOpciones as $user_id => $usuario_ad)
                          <option value="{{ $user_id }}">{{ $usuario_ad }}</option>
                       @endforeach
                   </select> 
                  <input type="text" name="gestion" id="gestion" class="form-control input-sm" placeholder="gestion" value="{{{$usuario->username}}}" readonly="readonly" style="visibility:hidden">
                   {{csrf_field()}}
                   <button class="btn btn-info" type="submit"><span>Asignar tarea</span></button>
                   </form>
                </td>

               </tr>
               @endforeach 
               @else
               <tr>
                <td colspan="8">No hay registro !!</td>
              </tr>
              @endif
            </tbody>
          </table>
        </div>
      </div>
      {{ $userstarea->links() }}
    </div>
  </div>

</section>
 
@endsection

我怎么了?

0 个答案:

没有答案