Especific resource is not show #3728
Replies: 7 comments 3 replies
-
Need more info, whats info is needed? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
[Wed Feb 9 11:17:57 2022] PHP Deprecated: Return type of Laravel\Nova\Element::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/igor/projetos/virtuasec-nova/vendor/laravel/nova/src/Element.php on line 78 |
Beta Was this translation helpful? Give feedback.
-
Please provide an example repository we can use to diagnose the issue. |
Beta Was this translation helpful? Give feedback.
-
@davidhemphill https://github.com/IgorDePaula/virtuasec-nova |
Beta Was this translation helpful? Give feedback.
-
I test with laravel nova 3.31, 3.30, 3.39, 3.25, laravel 9. php 8.1, php 8.0...and same error in all. |
Beta Was this translation helpful? Give feedback.
-
<?php
namespace App\Policies;
use App\Models\Ambit;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
class AmbitPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view any models.
*
* @param \App\Models\User $user
* @return \Illuminate\Auth\Access\Response|bool
*/
public function viewAny(User $user)
{
return true;
}
/**
* Determine whether the user can view the model.
*
* @param \App\Models\User $user
* @param \App\Models\Ambit $ambit
* @return \Illuminate\Auth\Access\Response|bool
*/
public function view(User $user, Ambit $ambit)
{
return true;
}
/**
* Determine whether the user can create models.
*
* @param \App\Models\User $user
* @return \Illuminate\Auth\Access\Response|bool
*/
public function create(User $user)
{
return true;
}
/**
* Determine whether the user can update the model.
*
* @param \App\Models\User $user
* @param \App\Models\Ambit $ambit
* @return \Illuminate\Auth\Access\Response|bool
*/
public function update(User $user, Ambit $ambit)
{
return true;
}
/**
* Determine whether the user can delete the model.
*
* @param \App\Models\User $user
* @param \App\Models\Ambit $ambit
* @return \Illuminate\Auth\Access\Response|bool
*/
public function delete(User $user, Ambit $ambit)
{
return true;
}
/**
* Determine whether the user can restore the model.
*
* @param \App\Models\User $user
* @param \App\Models\Ambit $ambit
* @return \Illuminate\Auth\Access\Response|bool
*/
public function restore(User $user, Ambit $ambit)
{
return true;
}
/**
* Determine whether the user can permanently delete the model.
*
* @param \App\Models\User $user
* @param \App\Models\Ambit $ambit
* @return \Illuminate\Auth\Access\Response|bool
*/
public function forceDelete(User $user, Ambit $ambit)
{
return true;
}
} https://nova.laravel.com/docs/3.0/resources/authorization.html#policies
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I created a resource called Ambit, but it is not show in navbar, I changed its name for Ambits, Ambitos, and any results. Simplely not show. I look in laracasts, stack over flow, and none.
Detailed steps to reproduce the issue on a fresh Nova installation:
Only create a Resource called Ambit (file and class)
Beta Was this translation helpful? Give feedback.
All reactions