Stop using FQCNs in AuthServiceProvider
MODIFY
app/Providers/AuthServiceProvider.php
app/Providers/AuthServiceProvider.php
namespace App\Providers;
+use App\Earning;
use App\Import;
+use App\Policies\EarningPolicy;
use App\Policies\ImportPolicy;
+use App\Policies\SpendingPolicy;
+use App\Policies\TagPolicy;
+use App\Spending;
+use App\Tag;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use App\Policies\RecurringPolicy;
@@ -18,10 +24,10 @@ class AuthServiceProvider extends ServiceProvider
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
- 'App\Earning' => 'App\Policies\EarningPolicy',
- 'App\Spending' => 'App\Policies\SpendingPolicy',
+ Earning::class => EarningPolicy::class,
+ Spending::class => SpendingPolicy::class,
Recurring::class => RecurringPolicy::class,
- 'App\Tag' => 'App\Policies\TagPolicy',
+ Tag::class => TagPolicy::class,
Import::class => ImportPolicy::class
];

Stop using FQCNs in AuthServiceProvider