- directory refactor
This commit is contained in:
parent
6854c7a9f8
commit
9ac804545b
@ -1,4 +1,4 @@
|
|||||||
APP_NAME=Laravel
|
APP_NAME="Toby HR applicaiton"
|
||||||
APP_ENV=local
|
APP_ENV=local
|
||||||
APP_KEY=
|
APP_KEY=
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Exceptions;
|
namespace Toby\Architecture;
|
||||||
|
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class ExceptionHandler extends Handler
|
||||||
{
|
{
|
||||||
protected $dontFlash = [
|
protected $dontFlash = [
|
||||||
"current_password",
|
"current_password",
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Providers;
|
namespace Toby\Architecture\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Toby\Models\VacationLimit;
|
use Toby\Eloquent\Models\VacationLimit;
|
||||||
use Toby\Scopes\SelectedYearPeriodScope;
|
use Toby\Eloquent\Scopes\SelectedYearPeriodScope;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Providers;
|
namespace Toby\Architecture\Providers;
|
||||||
|
|
||||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Providers;
|
namespace Toby\Architecture\Providers;
|
||||||
|
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
|
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Providers;
|
namespace Toby\Architecture\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Models\YearPeriod;
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
use Toby\Observers\UserObserver;
|
use Toby\Eloquent\Observers\UserObserver;
|
||||||
use Toby\Observers\YearPeriodObserver;
|
use Toby\Eloquent\Observers\YearPeriodObserver;
|
||||||
|
|
||||||
class ObserverServiceProvider extends ServiceProvider
|
class ObserverServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Providers;
|
namespace Toby\Architecture\Providers;
|
||||||
|
|
||||||
use Illuminate\Cache\RateLimiting\Limit;
|
use Illuminate\Cache\RateLimiting\Limit;
|
||||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Providers;
|
namespace Toby\Architecture\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Enums;
|
namespace Toby\Domain;
|
||||||
|
|
||||||
enum EmploymentForm: string
|
enum EmploymentForm: string
|
||||||
{
|
{
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Helpers;
|
namespace Toby\Eloquent\Helpers;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use LasseRafn\InitialAvatarGenerator\InitialAvatar;
|
use LasseRafn\InitialAvatarGenerator\InitialAvatar;
|
||||||
use SVG\SVG;
|
use SVG\SVG;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class UserAvatarGenerator
|
class UserAvatarGenerator
|
||||||
{
|
{
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Helpers;
|
namespace Toby\Eloquent\Helpers;
|
||||||
|
|
||||||
use Illuminate\Contracts\Session\Session;
|
use Illuminate\Contracts\Session\Session;
|
||||||
use Toby\Models\YearPeriod;
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
|
|
||||||
class YearPeriodRetriever
|
class YearPeriodRetriever
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Models;
|
namespace Toby\Eloquent\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
@ -12,7 +12,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
|||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Toby\Enums\EmploymentForm;
|
use Toby\Domain\EmploymentForm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property int $id
|
* @property int $id
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Models;
|
namespace Toby\Eloquent\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Models;
|
namespace Toby\Eloquent\Models;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Observers;
|
namespace Toby\Eloquent\Observers;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Toby\Helpers\UserAvatarGenerator;
|
use Toby\Eloquent\Helpers\UserAvatarGenerator;
|
||||||
use Toby\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class UserObserver
|
class UserObserver
|
||||||
{
|
{
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Observers;
|
namespace Toby\Eloquent\Observers;
|
||||||
|
|
||||||
use Toby\Helpers\UserAvatarGenerator;
|
use Toby\Eloquent\Helpers\UserAvatarGenerator;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Models\YearPeriod;
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
|
|
||||||
class YearPeriodObserver
|
class YearPeriodObserver
|
||||||
{
|
{
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Scopes;
|
namespace Toby\Eloquent\Scopes;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Scope;
|
use Illuminate\Database\Eloquent\Scope;
|
||||||
use Toby\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
|
|
||||||
class SelectedYearPeriodScope implements Scope
|
class SelectedYearPeriodScope implements Scope
|
||||||
{
|
{
|
@ -2,15 +2,14 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Console\Commands;
|
namespace Toby\Infrastructure\Console\Commands;
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class CreateUserCommand extends Command
|
class CreateUserCommand extends Command
|
||||||
{
|
{
|
||||||
protected $signature = "user:create
|
protected $signature = "user:create {email : an email for the user}";
|
||||||
{email : an email for the user}";
|
|
||||||
protected $description = "Creates a user";
|
protected $description = "Creates a user";
|
||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Console;
|
namespace Toby\Infrastructure\Console;
|
||||||
|
|
||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Contracts\Auth\Factory as AuthFactory;
|
use Illuminate\Contracts\Auth\Factory as AuthFactory;
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||||
use Laravel\Socialite\SocialiteManager;
|
use Laravel\Socialite\SocialiteManager;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class GoogleController extends Controller
|
class GoogleController extends Controller
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Toby\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
use Toby\Models\YearPeriod;
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
|
|
||||||
class SelectYearPeriodController extends Controller
|
class SelectYearPeriodController extends Controller
|
||||||
{
|
{
|
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Inertia\Response;
|
use Inertia\Response;
|
||||||
use Toby\Enums\EmploymentForm;
|
use Toby\Domain\EmploymentForm;
|
||||||
use Toby\Http\Requests\UserRequest;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Http\Resources\UserFormDataResource;
|
use Toby\Infrastructure\Http\Requests\UserRequest;
|
||||||
use Toby\Http\Resources\UserResource;
|
use Toby\Infrastructure\Http\Resources\UserFormDataResource;
|
||||||
use Toby\Models\User;
|
use Toby\Infrastructure\Http\Resources\UserResource;
|
||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Inertia\Response;
|
use Inertia\Response;
|
||||||
use Toby\Http\Requests\VacationLimitRequest;
|
use Toby\Eloquent\Models\VacationLimit;
|
||||||
use Toby\Http\Resources\VacationLimitResource;
|
use Toby\Infrastructure\Http\Requests\VacationLimitRequest;
|
||||||
use Toby\Models\VacationLimit;
|
use Toby\Infrastructure\Http\Resources\VacationLimitResource;
|
||||||
|
|
||||||
class VacationLimitController extends Controller
|
class VacationLimitController extends Controller
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http;
|
namespace Toby\Infrastructure\Http;
|
||||||
|
|
||||||
use Fruitcake\Cors\HandleCors;
|
use Fruitcake\Cors\HandleCors;
|
||||||
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
|
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
|
||||||
@ -23,11 +23,11 @@ use Illuminate\Routing\Middleware\ValidateSignature;
|
|||||||
use Illuminate\Session\Middleware\AuthenticateSession;
|
use Illuminate\Session\Middleware\AuthenticateSession;
|
||||||
use Illuminate\Session\Middleware\StartSession;
|
use Illuminate\Session\Middleware\StartSession;
|
||||||
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
||||||
use Toby\Http\Middleware\Authenticate;
|
use Toby\Infrastructure\Http\Middleware\Authenticate;
|
||||||
use Toby\Http\Middleware\HandleInertiaRequests;
|
use Toby\Infrastructure\Http\Middleware\HandleInertiaRequests;
|
||||||
use Toby\Http\Middleware\RedirectIfAuthenticated;
|
use Toby\Infrastructure\Http\Middleware\RedirectIfAuthenticated;
|
||||||
use Toby\Http\Middleware\TrimStrings;
|
use Toby\Infrastructure\Http\Middleware\TrimStrings;
|
||||||
use Toby\Http\Middleware\TrustProxies;
|
use Toby\Infrastructure\Http\Middleware\TrustProxies;
|
||||||
|
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Middleware;
|
namespace Toby\Infrastructure\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||||
|
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Middleware;
|
namespace Toby\Infrastructure\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Inertia\Middleware;
|
use Inertia\Middleware;
|
||||||
use Toby\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
use Toby\Http\Resources\UserResource;
|
use Toby\Infrastructure\Http\Resources\UserResource;
|
||||||
|
|
||||||
class HandleInertiaRequests extends Middleware
|
class HandleInertiaRequests extends Middleware
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Middleware;
|
namespace Toby\Infrastructure\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Middleware;
|
namespace Toby\Infrastructure\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Middleware;
|
namespace Toby\Infrastructure\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Requests;
|
namespace Toby\Infrastructure\Http\Requests;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
use Illuminate\Validation\Rules\Enum;
|
use Illuminate\Validation\Rules\Enum;
|
||||||
use Toby\Enums\EmploymentForm;
|
use Toby\Domain\EmploymentForm;
|
||||||
|
|
||||||
class UserRequest extends FormRequest
|
class UserRequest extends FormRequest
|
||||||
{
|
{
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Requests;
|
namespace Toby\Infrastructure\Http\Requests;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Toby\Models\VacationLimit;
|
use Toby\Eloquent\Models\VacationLimit;
|
||||||
|
|
||||||
class VacationLimitRequest extends FormRequest
|
class VacationLimitRequest extends FormRequest
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Resources;
|
namespace Toby\Infrastructure\Http\Resources;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Resources;
|
namespace Toby\Infrastructure\Http\Resources;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Http\Resources;
|
namespace Toby\Infrastructure\Http\Resources;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Toby\Jobs;
|
namespace Toby\Infrastructure\Jobs;
|
||||||
|
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Toby\Models\YearPeriod;
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
|
|
||||||
class CheckYearPeriod implements ShouldQueue
|
class CheckYearPeriod implements ShouldQueue
|
||||||
{
|
{
|
52
artisan
52
artisan
@ -1,52 +1,20 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
define('LARAVEL_START', microtime(true));
|
use Illuminate\Contracts\Console\Kernel;
|
||||||
|
use Symfony\Component\Console\Input\ArgvInput;
|
||||||
|
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||||
|
|
||||||
/*
|
define("LARAVEL_START", microtime(true));
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Register The Auto Loader
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Composer provides a convenient, automatically generated class loader
|
|
||||||
| for our application. We just need to utilize it! We'll require it
|
|
||||||
| into the script here so that we do not have to worry about the
|
|
||||||
| loading of any of our classes manually. It's great to relax.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
require __DIR__.'/vendor/autoload.php';
|
require __DIR__ . "/vendor/autoload.php";
|
||||||
|
|
||||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
$app = require_once __DIR__ . "/bootstrap/app.php";
|
||||||
|
/** @var Kernel $kernel */
|
||||||
|
$kernel = $app->make(Kernel::class);
|
||||||
|
|
||||||
/*
|
$input = new ArgvInput();
|
||||||
|--------------------------------------------------------------------------
|
$status = $kernel->handle($input, new ConsoleOutput());
|
||||||
| Run The Artisan Application
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| When we run the console application, the current CLI command will be
|
|
||||||
| executed in this console and the response sent back to a terminal
|
|
||||||
| or another output device for the developers. Here goes nothing!
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
|
||||||
|
|
||||||
$status = $kernel->handle(
|
|
||||||
$input = new Symfony\Component\Console\Input\ArgvInput,
|
|
||||||
new Symfony\Component\Console\Output\ConsoleOutput
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Shutdown The Application
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Once Artisan has finished running, we will fire off the shutdown events
|
|
||||||
| so that any final work may be done by the application before we shut
|
|
||||||
| down the process. This is the last thing to happen to the request.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
$kernel->terminate($input, $status);
|
$kernel->terminate($input, $status);
|
||||||
|
|
||||||
|
@ -6,15 +6,15 @@ use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
|
|||||||
use Illuminate\Contracts\Debug\ExceptionHandler as HandlerContract;
|
use Illuminate\Contracts\Debug\ExceptionHandler as HandlerContract;
|
||||||
use Illuminate\Contracts\Http\Kernel as HttpKernelContract;
|
use Illuminate\Contracts\Http\Kernel as HttpKernelContract;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Toby\Console\Kernel as ConsoleKernel;
|
use Toby\Architecture\ExceptionHandler;
|
||||||
use Toby\Exceptions\Handler;
|
use Toby\Infrastructure\Console\Kernel as ConsoleKernel;
|
||||||
use Toby\Http\Kernel as HttpKernel;
|
use Toby\Infrastructure\Http\Kernel as HttpKernel;
|
||||||
|
|
||||||
$basePath = $_ENV["APP_BASE_PATH"] ?? dirname(__DIR__);
|
$basePath = $_ENV["APP_BASE_PATH"] ?? dirname(__DIR__);
|
||||||
$application = new Application($basePath);
|
$application = new Application($basePath);
|
||||||
|
|
||||||
$application->singleton(HttpKernelContract::class, HttpKernel::class);
|
$application->singleton(HttpKernelContract::class, HttpKernel::class);
|
||||||
$application->singleton(ConsoleKernelContract::class, ConsoleKernel::class);
|
$application->singleton(ConsoleKernelContract::class, ConsoleKernel::class);
|
||||||
$application->singleton(HandlerContract::class, Handler::class);
|
$application->singleton(HandlerContract::class, ExceptionHandler::class);
|
||||||
|
|
||||||
return $application;
|
return $application;
|
||||||
|
@ -37,11 +37,11 @@ return [
|
|||||||
Illuminate\Translation\TranslationServiceProvider::class,
|
Illuminate\Translation\TranslationServiceProvider::class,
|
||||||
Illuminate\Validation\ValidationServiceProvider::class,
|
Illuminate\Validation\ValidationServiceProvider::class,
|
||||||
Illuminate\View\ViewServiceProvider::class,
|
Illuminate\View\ViewServiceProvider::class,
|
||||||
Toby\Providers\AppServiceProvider::class,
|
Toby\Architecture\Providers\AppServiceProvider::class,
|
||||||
Toby\Providers\AuthServiceProvider::class,
|
Toby\Architecture\Providers\AuthServiceProvider::class,
|
||||||
Toby\Providers\EventServiceProvider::class,
|
Toby\Architecture\Providers\EventServiceProvider::class,
|
||||||
Toby\Providers\RouteServiceProvider::class,
|
Toby\Architecture\Providers\RouteServiceProvider::class,
|
||||||
Toby\Providers\TelescopeServiceProvider::class,
|
Toby\Architecture\Providers\TelescopeServiceProvider::class,
|
||||||
Toby\Providers\ObserverServiceProvider::class,
|
Toby\Architecture\Providers\ObserverServiceProvider::class,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
"defaults" => [
|
"defaults" => [
|
||||||
|
@ -43,7 +43,7 @@ services:
|
|||||||
- MYSQL_USER=${DOCKER_DEV_DB_USERNAME}
|
- MYSQL_USER=${DOCKER_DEV_DB_USERNAME}
|
||||||
- MYSQL_PASSWORD=${DOCKER_DEV_DB_PASSWORD}
|
- MYSQL_PASSWORD=${DOCKER_DEV_DB_PASSWORD}
|
||||||
ports:
|
ports:
|
||||||
- ${DOCKER_DB_EXTERNAL_PORT:-3306}:3306
|
- ${DOCKER_DEV_DB_EXTERNAL_PORT:-3306}:3306
|
||||||
volumes:
|
volumes:
|
||||||
- toby-mysql-data:/var/lib/mysql
|
- toby-mysql-data:/var/lib/mysql
|
||||||
networks:
|
networks:
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "toby",
|
"name": "application",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
> HR software you love to hate
|
> HR software you love to hate
|
||||||
|
|
||||||
## Local setup
|
## Local setup
|
||||||
|
- run `sh setup` or:
|
||||||
|
|
||||||
> `dcr` is an alias to `docker-compose run --rm -u "$(id -u):$(id -g)"`
|
> `dcr` is an alias to `docker-compose run --rm -u "$(id -u):$(id -g)"`
|
||||||
|
|
||||||
|
13
setup
Normal file
13
setup
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ! -f ".env" ]; then
|
||||||
|
cp .env.example .env
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker-compose build --no-cache --pull
|
||||||
|
docker-compose up -d
|
||||||
|
docker-compose run --rm -u "$(id -u):$(id -g)" php composer install
|
||||||
|
docker-compose run --rm -u "$(id -u):$(id -g)" php php artisan key:generate
|
||||||
|
docker-compose run --rm -u "$(id -u):$(id -g)" php php artisan migrate --seed
|
||||||
|
docker-compose run --rm -u "$(id -u):$(id -g)" node npm install
|
||||||
|
docker-compose run --rm -u "$(id -u):$(id -g)" node npm run dev
|
@ -8,7 +8,7 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|||||||
use Laravel\Dusk\Browser;
|
use Laravel\Dusk\Browser;
|
||||||
use Tests\Browser\Pages\HomePage;
|
use Tests\Browser\Pages\HomePage;
|
||||||
use Tests\DuskTestCase;
|
use Tests\DuskTestCase;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class AuthenticationTest extends DuskTestCase
|
class AuthenticationTest extends DuskTestCase
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,7 @@ namespace Tests\Feature;
|
|||||||
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
use Tests\FeatureTestCase;
|
use Tests\FeatureTestCase;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class AuthenticationTest extends FeatureTestCase
|
class AuthenticationTest extends FeatureTestCase
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@ namespace Tests\Feature;
|
|||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
use Inertia\Testing\AssertableInertia as Assert;
|
use Inertia\Testing\AssertableInertia as Assert;
|
||||||
use Tests\FeatureTestCase;
|
use Tests\FeatureTestCase;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class InertiaTest extends FeatureTestCase
|
class InertiaTest extends FeatureTestCase
|
||||||
{
|
{
|
||||||
|
@ -7,8 +7,8 @@ namespace Tests\Feature;
|
|||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Tests\FeatureTestCase;
|
use Tests\FeatureTestCase;
|
||||||
use Toby\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class SelectYearPeriodTest extends FeatureTestCase
|
class SelectYearPeriodTest extends FeatureTestCase
|
||||||
{
|
{
|
||||||
|
@ -8,8 +8,8 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Inertia\Testing\AssertableInertia as Assert;
|
use Inertia\Testing\AssertableInertia as Assert;
|
||||||
use Tests\FeatureTestCase;
|
use Tests\FeatureTestCase;
|
||||||
use Toby\Enums\EmploymentForm;
|
use Toby\Domain\EmploymentForm;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class UserTest extends FeatureTestCase
|
class UserTest extends FeatureTestCase
|
||||||
{
|
{
|
||||||
@ -34,21 +34,21 @@ class UserTest extends FeatureTestCase
|
|||||||
public function testAdminCanSearchUsersList(): void
|
public function testAdminCanSearchUsersList(): void
|
||||||
{
|
{
|
||||||
User::factory([
|
User::factory([
|
||||||
"first_name" => "Test",
|
"first_name" => "Test",
|
||||||
"last_name" => "User1",
|
"last_name" => "User1",
|
||||||
])->create();
|
])->create();
|
||||||
User::factory([
|
User::factory([
|
||||||
"first_name" => "Test",
|
"first_name" => "Test",
|
||||||
"last_name" => "User2",
|
"last_name" => "User2",
|
||||||
])->create();
|
])->create();
|
||||||
User::factory([
|
User::factory([
|
||||||
"first_name" => "Test",
|
"first_name" => "Test",
|
||||||
"last_name" => "User3",
|
"last_name" => "User3",
|
||||||
])->create();
|
])->create();
|
||||||
$admin = User::factory([
|
$admin = User::factory([
|
||||||
"first_name" => "John",
|
"first_name" => "John",
|
||||||
"last_name" => "Doe",
|
"last_name" => "Doe",
|
||||||
])->create();
|
])->create();
|
||||||
|
|
||||||
$this->assertDatabaseCount("users", 4);
|
$this->assertDatabaseCount("users", 4);
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ namespace Tests\Feature;
|
|||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
use Inertia\Testing\AssertableInertia as Assert;
|
use Inertia\Testing\AssertableInertia as Assert;
|
||||||
use Tests\FeatureTestCase;
|
use Tests\FeatureTestCase;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Models\VacationLimit;
|
use Toby\Eloquent\Models\VacationLimit;
|
||||||
|
|
||||||
class VacationLimitTest extends FeatureTestCase
|
class VacationLimitTest extends FeatureTestCase
|
||||||
{
|
{
|
||||||
|
@ -6,8 +6,8 @@ namespace Tests\Traits;
|
|||||||
|
|
||||||
use Illuminate\Foundation\Testing\Concerns\InteractsWithSession;
|
use Illuminate\Foundation\Testing\Concerns\InteractsWithSession;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Toby\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
use Toby\Models\YearPeriod;
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
|
|
||||||
trait InteractsWithYearPeriods
|
trait InteractsWithYearPeriods
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use Tests\Traits\InteractsWithYearPeriods;
|
use Tests\Traits\InteractsWithYearPeriods;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
|
|
||||||
class AvatarTest extends TestCase
|
class AvatarTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@ use Illuminate\Foundation\Testing\RefreshDatabase;
|
|||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use Tests\Traits\InteractsWithYearPeriods;
|
use Tests\Traits\InteractsWithYearPeriods;
|
||||||
use Toby\Jobs\CheckYearPeriod;
|
use Toby\Infrastructure\Jobs\CheckYearPeriod;
|
||||||
|
|
||||||
class CheckYearPeriodTest extends TestCase
|
class CheckYearPeriodTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@ -7,8 +7,8 @@ namespace Tests\Unit;
|
|||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use Tests\Traits\InteractsWithYearPeriods;
|
use Tests\Traits\InteractsWithYearPeriods;
|
||||||
use Toby\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Models\YearPeriod;
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
|
|
||||||
class VacationLimitTest extends TestCase
|
class VacationLimitTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@ -9,8 +9,8 @@ use Illuminate\Foundation\Testing\RefreshDatabase;
|
|||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use Tests\Traits\InteractsWithYearPeriods;
|
use Tests\Traits\InteractsWithYearPeriods;
|
||||||
use Toby\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
use Toby\Models\YearPeriod;
|
use Toby\Eloquent\Models\YearPeriod;
|
||||||
|
|
||||||
class YearPeriodRetrieverTest extends TestCase
|
class YearPeriodRetrieverTest extends TestCase
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user