taktik - laravel

This commit is contained in:
2025-01-23 00:19:07 +01:00
commit 43b6cff880
127 changed files with 15025 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}

View File

@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
namespace App\Providers;
use App\Services\Category\CategoryService;
use App\Services\Category\CategoryServiceInterface;
use App\Services\QueryRequestModifiers\Category\CategoryFilter;
use App\Services\QueryRequestModifiers\Category\CategoryOrder;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
class CategoryServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
$this->app->singleton(CategoryFilter::class, function (Application $app) {
return new CategoryFilter();
});
$this->app->singleton(CategoryOrder::class, function (Application $app) {
return new CategoryOrder();
});
$this->app->singleton(CategoryServiceInterface::class, function (Application $app) {
return new CategoryService(
$this->app->get(CategoryFilter::class),
$this->app->get(CategoryOrder::class),
);
});
}
/**
* Bootstrap services.
*/
public function boot(): void
{
//
}
}

View File

@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
namespace App\Providers;
use App\Services\Comment\PostCommentService;
use App\Services\QueryRequestModifiers\Comment\CommentFilter;
use App\Services\QueryRequestModifiers\Comment\CommentOrder;
use App\Services\QueryRequestModifiers\Comment\CommentOrderDTO;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
class CommentServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
$this->app->singleton(CommentFilter::class, function (Application $app) {
return new CommentFilter();
});
$this->app->singleton(CommentOrder::class, function (Application $app) {
return new CommentOrder();
});
$this->app->singleton(PostCommentService::class, function (Application $app) {
return new PostCommentService(
$this->app->get(CommentFilter::class),
$this->app->get(CommentOrder::class),
);
});
}
/**
* Bootstrap services.
*/
public function boot(): void
{
//
}
}

View File

@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
namespace App\Providers;
use App\Services\Comment\PostCommentService;
use App\Services\Post\CachedPostService;
use App\Services\CacheKeyBuilder;
use App\Services\Post\PostServiceInterface;
use App\Services\QueryRequestModifiers\Post\PostFilter;
use App\Services\QueryRequestModifiers\Post\PostOrder;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
class PostServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
$this->app->singleton(PostFilter::class, function (Application $app) {
return new PostFilter();
});
$this->app->singleton(PostOrder::class, function (Application $app) {
return new PostOrder();
});
$this->app->singleton(PostServiceInterface::class, function (Application $app) {
return new CachedPostService(
$this->app->get(PostFilter::class),
$this->app->get(PostOrder::class),
$this->app->get(CacheKeyBuilder::class),
);
});
}
/**
* Bootstrap services.
*/
public function boot(): void
{
}
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use L5Swagger\L5SwaggerServiceProvider;
use OpenApi\Annotations as OA;
/**
* @OA\Info(
* title="Post API",
* version="1.0.0",
* )
*/
class SwaggerProvider extends ServiceProvider
{
public function register()
{
$this->app->register(L5SwaggerServiceProvider::class);
}
/**
* Bootstrap services.
*/
public function boot(): void
{
//
}
}