Eu já tinha olhado, mas nessa classe eu não mexi...
dei uma olhada no arquivo laravel.log e está com essas linhas no fim, pelo que estou entendendo o direcionamento está pra essa pasta q nem existe depois de facades -->App\Providers\AppServiceProvider
[2023-01-05 22:25:51] local.ERROR: Class "Illuminate\Support\Facades\App\Providers\AppServiceProvider" not found {"exception":"[object] (Error(code: 0): Class "Illuminate\Support\Facades\App\Providers\AppServiceProvider" not found at D:\PHP\projetos\controle-series\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:208)
[stacktrace]
#0 D:\PHP\projetos\controle-series\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php(144): Illuminate\Foundation\ProviderRepository->createProvider('Illuminate\\Supp...')
#1 D:\PHP\projetos\controle-series\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php(61): Illuminate\Foundation\ProviderRepository->compileManifest(Array)
#2 D:\PHP\projetos\controle-series\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(666): Illuminate\Foundation\ProviderRepository->load(Array)
#3 D:\PHP\projetos\controle-series\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders()
#4 D:\PHP\projetos\controle-series\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(242): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
#5 D:\PHP\projetos\controle-series\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(383): Illuminate\Foundation\Application->bootstrapWith(Array)
#6 D:\PHP\projetos\controle-series\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(153): Illuminate\Foundation\Console\Kernel->bootstrap()
#7 D:\PHP\projetos\controle-series\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 {main}
<?php
namespace App\Repositories;
use App\Http\Requests\SeriesFormRequest;
use App\Models\Episode;
use App\Models\Season;
use App\Models\Series;
use Illuminate\Support\Facades\DB;
class EloquentSeriesRepository implements SeriesRepository
{
public function add(SeriesFormRequest $request): Series
{
return DB::transaction(function () use ($request) {
$serie = Series::create($request->all());
$seasons = [];
for ($i = 1; $i <= $request->seasonsQty; $i++) {
$seasons[] = [
'series_id' => $serie->id,
'number' => $i,
];
}
Season::insert($seasons);
$episodes = [];
foreach ($serie->seasons as $season) {
for ($j = 1; $j <= $request->episodesPerSeason; $j++) {
$episodes[] = [
'season_id' => $season->id,
'number' => $j
];
}
}
Episode::insert($episodes);
return $serie;
});
}
}
<?php
namespace App\Providers;
use App\Repositories\EloquentSeriesRepository;
use App\Repositories\SeriesRepository;
use Illuminate\Support\ServiceProvider;
class SeriesRepositoryProvider extends ServiceProvider
{
public array $bindings = [
SeriesRepository::class => EloquentSeriesRepository::class
];
}