Após a implementação dos recursos .blade.php
a view detalhes.blade.php
simplesmente parou, recebo a seguinte mensagem:
Sorry, the page you are looking for could not be found.
1/1
NotFoundHttpException in RouteCollection.php line 145:
in RouteCollection.php line 145
at RouteCollection->match(object(Request)) in Router.php line 729
at Router->findRoute(object(Request)) in Router.php line 652
at Router->dispatchToRoute(object(Request)) in Router.php line 628
at Router->dispatch(object(Request)) in Kernel.php line 214
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 43
at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 55
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 61
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 40
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Kernel.php line 115
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84
at Kernel->handle(object(Request)) in index.php line 53
at require_once('/Users/silvanioduartedacruz/estoque/public/index.php') in server.php line 21
Router.php
<?php
//Iniciando as rodas da aplicação estoque
Route::get('/', function()
{
return 'Conectando ao Laravel';
});
Route::get('/produtos', 'ProdutoController@lista'); //Rota produtos
Route::get('/produtos/mostra/{id}','ProdutoController@mostra') -> where('id','[0-9+]'); //Rota para view detalhes de produtos
detalhes.blade.php
@extends('principal')
@section('conteudo')
<h1>Detalhes do produto: {{ $p->nome }} </h1>
<ul>
<li>
<b>Valor:</b> R$ {{$p->valor}}
</li>
<li>
<b>Descrição:</b> R$ {{$p->descricao }}
</li>
<li>
<b>quantidade em estoque:</b> {{$p->quantidade }}
</li>
</ul>
@stop
listagem.blade.php
@extends('principal')
@section('conteudo')
<div class="container">
<h1>Listagem de Podutos</h1>
<table class="table table-striped table-bordered">
</br>
<tr aling="center">
<td>ID</td>
<td>Nome</td>
<td>Valor</td>
<td>Descrição</td>
<td>Quantidade</td>
<td>Detalhes</td>
</tr>
@foreach ($produtos as $p)
<tr class="{{ $p -> quantidade <= 1 ? 'danger' : '' }}">
<td> {{$p->id}} </td>
<td> {{$p->nome}} </td>
<td> {{$p->valor}} </td>
<td> {{$p->descricao}} </td>
<td> {{$p->quantidade}} </td>
<td>
<a href="/produtos/mostra/ {{ $p-> id }} ">
<span class="glyphicon glyphicon-search"></span>
</a>
</td>
</tr>
@endforeach
</table>
</div>
@stop
Principal.blade.php
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/css/app.css">
<meta charset="utf-8">
<title>Controle de Estoque</title>
</head>
<body>
@yield('conteudo')
</body>
</html>