'Laravel Facade\Ignition\Exceptions\ViewException Route not defined
I have been facing Laravel Route view problem.
The problem comes from the blade.php

Route File:
Route::get('products', [
'as' => 'admin.products.index',
'uses' => 'ProductController@index',
'middleware' => 'can:admin.products.index',
]);
Index.blade.php
@component('admin::components.page.index_table')
@slot('buttons', ['create'])
@slot('resource', 'products')
@slot('name', trans('product::products.product'))
@slot('thead')
@include('product::admin.products.partials.thead', [
'name' => 'products-index',
])
@endslot
@endcomponent
if I remove code @slot('buttons', ['create']) then my blade view working file.
When, I use this @slot('buttons', ['create']) code then mainly I faced these issues.
**admin::components.page.index_table : **
@section('content')
<div class="row">
<div class="btn-group pull-right">
@if (isset($buttons, $name))
@foreach ($buttons as $view)
<a href="{{ route("admin.{$currentUser}.{$view}") }}"
class="btn btn-primary btn-actions btn-{{ $view }}">
{{ trans("admin::resource.{$view}", ['resource' => $name]) }}
</a>
@endforeach
@else
{{ $buttons ?? '' }}
@endif
</div>
</div>
<div class="box box-primary">
<div class="box-body index-table" id="{{ isset($currentUser) ? "{$currentUser}-table" : '' }}">
@if (isset($thead))
@include('admin::components.table')
@else
{{ $slot }}
@endif
</div>
</div>
@endsection
@isset($name)
@push('shortcuts')
@if (isset($buttons) && in_array('create', $buttons))
<dl class="dl-horizontal">
<dt><code>c</code></dt>
<dd>{{ trans('admin::resource.create', ['resource' => $name]) }}</dd>
</dl>
@endif
<dl class="dl-horizontal">
<dt><code>Del</code></dt>
<dd>{{ trans('admin::resource.delete', ['resource' => $name]) }}</dd>
</dl>
@endpush
@push('scripts')
<script>
@if (isset($buttons) && in_array('create', $buttons))
keypressAction([
{ key: 'c', route: '{{ route("admin.{$currentUser}.create") }}'}
]);
@endif
Mousetrap.bind('del', function() {
$('{{ $selector ?? '' }} .btn-delete').trigger('click');
});
@isset($currentUser)
DataTable.setRoutes('#{{ $currentUser }}-table .table', {
index: '{{ "admin.{$currentUser}.index" }}',
edit: '{{ "admin.{$currentUser}.edit" }}',
destroy: '{{ "admin.{$currentUser}.destroy" }}',
});
@endisset
</script>
@endpush
@endisset
Please, Give me a solution how can I solve these issues
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
