How do I assign a view to an input type like submit?

0

I want to assign a blade to an input in my code. For example: The view is called 'panel.blade' and I wanted an input in the view 'adm.blade' to return it.

Controller

class ClientsController extends Controller {     public function showClient ($ id) {         $ client = \ App \ Clients :: find ($ id);         return view ('showclient') -> with ('client', $ client);     }

public function adm()
{
    $clients = \App\Clients::all();
    return View('/inicioadm')->with('clients', $clients);
}

public function des()
{
    $clients = \App\Clients::all()->where('Tipo', 'Desenvolvedor');
    return View('/iniciodes')->with('clients', $clients);
}

public function painel()
{
    $user = \App\User::all();
    return view('painel', ['users' => $user]);
}

public function ativar($id)
{
    $estado = \App\User::find($id);
    if ($estado->Estado == 0){
        $estado->Estado = 1;
        $estado->save();
    }
    return redirect('/painel');               
}

public function desativar($id)
{
    $estado = \App\User::find($id);
    if ($estado->Estado == 1){
        $estado->Estado = 0;
        $estado->save();
    }
    return redirect ('/painel');
}

inicioadm.blade

<form method="POST" action="inicioadm">

     <h1> BEM VINDO ADMINISTRADOR! </h1> 

</form>

@foreach ($clients as $client)
    <p><a href="/cliente/{{$client->ID}}">{{$client->Nome}}</a></p>
@endforeach

<input type="submit" value="Clientes" id="clientes" name="Clientes">


</body>
    
asked by anonymous 28.03.2017 / 16:32

1 answer

0

I do not know if I understood your question correctly, but if you want to send this application to another page of the blade in the panel case having the created route you could use (I do not know how is the best way):

<input type="submit" value="Clientes" id="clientes" name="Clientes" onclick="location.href='{{ route('informe sua rota aqui') }}'" >

OR still (maybe more recommended in this case)

<a id="btn" href="{{ route('informe sua rota aqui') }}"></a>
    
26.04.2017 / 22:39