'I can't solve the Error 404 in Laravel Livewire
I have a problem with Laravel. I did a route and a few day ago it worked fine, but now I don't know why not. I'm working whit Livewire, so in the route file this is my code:
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin;
use App\Http\Livewire;
Route::get('/dashboard', [Admin\AdminController::class, 'index']) -> name('admin.dashboard');
Route::get('/productos', Livewire\Admin\ProductList::class) -> name('admin.products');
Route::get('/productos/crear', Livewire\Admin\ProductCreate::class) -> name('admin.products.create');
Route::get('/productos/editar/{product}', Livewire\Admin\ProductEdit::class) -> name('admin.products.edit');
Route::post('/productos/fotos/{product}', [Admin\ProductController::class, 'photos']) -> name('admin.products.photos');
All routes work, but not '/productos/crear'. It appear a 404 error.
And this is my controller:
namespace App\Http\Livewire\Admin;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Builder;
use Livewire\Component;
use App\Models\Product;
use App\Models\Category;
use App\Models\Subcategory;
use App\Models\Brand;
class ProductCreate extends Component
{
public function render()
{
return view('livewire.admin.product-create');
}
}
I reviewed all filenames to make sure that they are correct.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
