I generated my Controllers, models and views with infyom and everything is perfect but when I create a function and call it with a route
in a view it tells me that it is not defined
I have in my file web.php
the following line
Route::resource('facturas', 'FacturaController');
And in the view I try to call my function obtenerproductos
and nothing
I have it implemented like this{{ route('facturas.obtenerproductos') }}
the error is the following:
Route [invoices.getproducts] not defined. (View: C:\xampp\htdocs\products_sales2\resources\views\invoices\create_sale.blade.php)
The error would be solved simply by adding the
name
to its route and being able to call it later from the view.Hello if you are using Jetstream and have the following path from the web.php folder:
And they get the error:
Just add this line of code:
And ready problem solved credits to the first answer.