I'm trying to start in Laravel
, and I'm having problems with requests
, when I only do request
like localhost:8000/hoteis
everything works it fetches the page and works perfectly, but if% it is not working, the route file is as follows:
Route::get('/hoteis', 'HotelCrontroller@listarHoteis');
Route::get('/hoteis/{nome}', 'HotelCrontroller@mostraHotel');
My controller is programmed like this:
namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use Request;
class HotelCrontroller extends Controller
{
public function listarHoteis()
{
//DB::select('Aqui vem a query');
$hoteis = 'Aqui vem os hoteis.';
return view('hotel')->with('hoteis', $hoteis);
}
public function mostraHotel(){
$nomeHotel = Request::route('name');
return view('detalhehotel')->with('hotel', $nomeHotel);
}
}
and on my page it looks like this:
@extends('index')
@section('conteudo')
<?php
$hoteis = $hotel;
echo $hoteis;
?>
@stop
What will be the problem? For testing I tried to go straight to the page and it worked perfectly.
I found that there might be something with css or something, since all the pages I write
localhost:8000/hoteis/nomedohotel
it has the 404 error page stylized but when I put/algo
it appears the same page but without being stylized.I have seen that the files he is getting are thus
/algo/algo
so this is why the whole style is coming in the wrong way, how do he only loadhttp://localhost:8000/aa/css/app_2.min.css
. This will work what I want.