You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System: Windows 11
Description: I installed the Laravel Extra Intellisense from the VS Code Extension marketplace. The extension never worked, and the following error message started to occur instead of running properly
PHP Fatal error: Uncaught ReflectionException: Class App\Policies\ModelPolicy does not exist in Command line code:1
Stack trace:
#0 Command line code(1): ReflectionClass->__construct('App\Policies\Mo...') #1 [internal function]: {closure}('App\Policies\Mo...', 'App\Model') #2 Command line code(1): array_map(Object(Closure), Array, Array) #3 {main}
thrown in Command line code on line 1
Because of backward compatibility, I am using PHP 7.4 and Laravel Framework 5.8. Could that be the reason the extension doesn't work?
The text was updated successfully, but these errors were encountered:
For other projects I have tested this extension with all seems to be working normal.
In one though I get the same error as @Ruko97. I'm not sure why, but inside the file app/Providers/AuthServiceProvider.php there was this:
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];
I removed the entry and left the $policies array empty and the error stopped popping up! I don't know if I have inadvertently broken something - I hope not! Does anyone know what that entry could be doing there?
@papandrk I'm pretty sure it's a placeholder that was included with the default Laravel installation at some point - if you look for a class called App\Policies\ModelPolicy, you likely won't find it.
For that reason, I wouldn't consider this a bug with this package - it's doing its job!
System: Windows 11
Description: I installed the Laravel Extra Intellisense from the VS Code Extension marketplace. The extension never worked, and the following error message started to occur instead of running properly
PHP Fatal error: Uncaught ReflectionException: Class App\Policies\ModelPolicy does not exist in Command line code:1
Stack trace:
#0 Command line code(1): ReflectionClass->__construct('App\Policies\Mo...')
#1 [internal function]: {closure}('App\Policies\Mo...', 'App\Model')
#2 Command line code(1): array_map(Object(Closure), Array, Array)
#3 {main}
thrown in Command line code on line 1
Because of backward compatibility, I am using PHP 7.4 and Laravel Framework 5.8. Could that be the reason the extension doesn't work?
The text was updated successfully, but these errors were encountered: