Working with Routes in Laravel

Asked

Viewed 39 times

1

This is the structure of my project where my page is;

inserir a descrição da imagem aqui

This is my controller;

  public function create()
    {
        return view(imoveis.create);
    }

It is configured so my route, is in my file web.php;

Route::resource('imoveis', 'ImovelController');

And it’s returned me this error message in the URL: http://localhost:8000/imoveis/create

inserir a descrição da imagem aqui

I wonder where I went wrong?

  • 2

    The error message explains the problem as constant not defined, ie immobles.create does not exist should have a single or double Apas I believe that solves type view("imoveis.create");

  • 1

    @Virgilionovic, you’re right, it’s missing the Quotation marks.

  • @Virgilionovic can post the answer, because you’re right, it worked!

1 answer

1


Error message explains meaning of error, saying that constant does not exist, what is expected in your code is in quotes, example:

public function create()
{
   return view('imoveis.create');
}
  • 1

    Thanks for saying, it’s because I’m still getting started :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.