new functions
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
2025-12-14 23:59:32 +01:00
parent e42ce8b092
commit 047e155238
11 changed files with 1324 additions and 481 deletions

View File

@@ -8,6 +8,9 @@ use App\Livewire\PdfViewer;
use App\Livewire\ProjectShow;
use App\Livewire\Toolbar;
use App\View\Components\Multiselect;
use App\Services\ProjectCodeService;
use App\Services\ProjectCodeValidator;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Validator;
@@ -21,7 +24,16 @@ class AppServiceProvider extends ServiceProvider
*/
public function register(): void
{
//
// Registrar el Service
$this->app->singleton(ProjectCodeService::class, function ($app) {
return new ProjectCodeService(new ProjectCodeValidator([]));
});
// O si prefieres, registrar el validador por separado
$this->app->bind(ProjectCodeValidator::class, function ($app, $params) {
// $params[0] contendría los datos del proyecto
return new ProjectCodeValidator($params[0] ?? []);
});
}
/**