I got an error : Route [admin/news] not defined I try to use @component in my create.blade.php
In my Controller I declare variable
public $route = 'admin/news' ;
In web.php
Route::post('admin/news/create', 'Admin\NewsController@store');
Route::resource('admin/news', 'Admin\NewsController');
In my html this return right Url
<a class="btn btn-success" href="{{ asset($route.'/create') }}">add</a>
<a class="btn btn-success" href="{{ route('news.create') }}">add</a>
I check my route by using php artisan r:l
It has a news.create
I try to use other routes both of these work fine not sure what's wrong with my create route
route('news.edit',$t->id)
route('news.destroy',$t->id)
the problem is in my create.blade.php I try to use @component by this
@component('layouts.submitform',
['id'=>'create','method'=> isset($edit) ? 'PUT' : 'POST' ,'action'=> isset($data->id) ? asset($route.'/'.$data->id) : route($route)]
)