Skip to content

Commit

Permalink
fixed template not found on resource page
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorenceRandaxhe committed Jun 2, 2022
1 parent cdc9f46 commit fd86953
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Http/Controllers/Option/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class IndexController extends ResourceIndexController
{
/**
* Resource label callback
*
*
* @return string
*/
protected function resourceLabel() {
Expand All @@ -19,10 +19,10 @@ protected function resourceLabel() {

/**
* Callback to retrieve the resource index items
*
*
* @param \Laravel\Nova\Http\Requests\ResourceIndexRequest $request
* @param \Whitecube\NovaPage\Pages\Manager $manager
* @return \Illuminate\Support\Collection
* @return \Illuminate\Support\Collection
*/
protected function resourceIndexItems(ResourceIndexRequest $request, Manager $manager) {
return $manager->queryIndexResources($request, 'option');
Expand Down
2 changes: 1 addition & 1 deletion src/NovaPageTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public function menu(Request $request)
return MenuSection::make('Nova Pages', [
MenuItem::make('Pages')->path('resources/nova-page'),
MenuItem::make('Options')->path('resources/nova-option'),
]);
])->collapsable()->icon('document');
}
}
2 changes: 1 addition & 1 deletion src/NovaPageToolServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function routes()
return;
}

Nova::router(['nova', Authorize::class], 'nova-page')
Nova::router(['nova', Authorize::class], 'resources')
->group(__DIR__.'/../routes/api.php');
}
}
2 changes: 1 addition & 1 deletion src/Pages/StaticResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function subtitle()
*/
public static function newModel()
{
if(request()->resourceId) {
if(\in_array(request()->route('resource'), [PageResource::uriKey(), OptionResource::uriKey()]) && request()->route('resourceId')) {
return resolve(Manager::class)
->newQueryWithoutScopes()
->whereKey(request()->resourceId)
Expand Down

0 comments on commit fd86953

Please sign in to comment.