Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 448d7344b5 | |||
| 0841ec51f9 | |||
| 6754787c5b | |||
| fd4833bf05 |
28
Makefile
Normal file
28
Makefile
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
up: docker-up
|
||||||
|
down: docker-down
|
||||||
|
init: docker-down-clear docker-pull docker-build docker-up app-init app-db-seed
|
||||||
|
|
||||||
|
docker-up:
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
docker-down:
|
||||||
|
docker compose down --remove-orphans
|
||||||
|
|
||||||
|
docker-down-clear:
|
||||||
|
docker compose down -v --remove-orphans
|
||||||
|
|
||||||
|
docker-pull:
|
||||||
|
docker compose pull
|
||||||
|
|
||||||
|
docker-build:
|
||||||
|
docker compose build
|
||||||
|
|
||||||
|
app-init:
|
||||||
|
docker compose run --rm php composer install
|
||||||
|
docker compose run --rm php chown root:www-data -R storage/
|
||||||
|
docker compose run --rm php chmod 777 -R storage/
|
||||||
|
docker compose run --rm php cp .env.example .env
|
||||||
|
docker compose run --rm php php artisan key:generate
|
||||||
|
|
||||||
|
app-db-seed:
|
||||||
|
docker compose run --rm php-cli php artisan migrate --seed
|
||||||
12
compose.yml
12
compose.yml
@ -10,10 +10,10 @@ services:
|
|||||||
- redis
|
- redis
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
base-svc:
|
php:
|
||||||
container_name: ${PROJECT_NAME}-base-local
|
container_name: ${PROJECT_NAME}-backend-local
|
||||||
build:
|
build:
|
||||||
context: ./docker/base
|
context: ./docker/php
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
- UID=${UID:-1000}
|
- UID=${UID:-1000}
|
||||||
@ -26,10 +26,10 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
back_net:
|
back_net:
|
||||||
aliases:
|
aliases:
|
||||||
- base
|
- backend
|
||||||
redis_net:
|
redis_net:
|
||||||
aliases:
|
aliases:
|
||||||
- base
|
- backend
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
container_name: ${PROJECT_NAME}-nginx-local
|
container_name: ${PROJECT_NAME}-nginx-local
|
||||||
@ -46,7 +46,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./src:/app
|
- ./src:/app
|
||||||
depends_on:
|
depends_on:
|
||||||
- base-svc
|
- php
|
||||||
networks:
|
networks:
|
||||||
back_net:
|
back_net:
|
||||||
aliases:
|
aliases:
|
||||||
|
|||||||
@ -16,7 +16,7 @@ server {
|
|||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass base-svc:9000;
|
fastcgi_pass php:9000;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
|||||||
@ -33,7 +33,10 @@ RUN apk del --no-cache .build-deps
|
|||||||
|
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
||||||
|
|
||||||
USER ${USER}
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
||||||
|
RUN chown -R ${USER}:${USER} /app
|
||||||
|
USER ${USER}
|
||||||
|
|
||||||
CMD ["php-fpm", "-y", "/usr/local/etc/php-fpm.conf", "-R"]
|
CMD ["php-fpm", "-y", "/usr/local/etc/php-fpm.conf", "-R"]
|
||||||
@ -44,7 +44,7 @@ CACHE_STORE=database
|
|||||||
MEMCACHED_HOST=127.0.0.1
|
MEMCACHED_HOST=127.0.0.1
|
||||||
|
|
||||||
REDIS_CLIENT=phpredis
|
REDIS_CLIENT=phpredis
|
||||||
REDIS_HOST=127.0.0.1
|
REDIS_HOST=redis
|
||||||
REDIS_PASSWORD=null
|
REDIS_PASSWORD=null
|
||||||
REDIS_PORT=6379
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Domain\Shared\Repositories;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
abstract class BaseRepository extends Model
|
|
||||||
{
|
|
||||||
public string $model;
|
|
||||||
|
|
||||||
final public function __construct()
|
|
||||||
{
|
|
||||||
if (!isset($this->model)) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Domain\Vacancy\Repositories;
|
|
||||||
|
|
||||||
use App\Domain\Shared\Repositories\BaseRepository;
|
|
||||||
use App\Models\Vacancy;
|
|
||||||
|
|
||||||
class VacancyRepository extends BaseRepository
|
|
||||||
{
|
|
||||||
public string $model = Vacancy::class;
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class VacancyController extends Controller
|
|
||||||
{
|
|
||||||
public function store() {}
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class BaseModel extends Model
|
|
||||||
{
|
|
||||||
use HasUuids;
|
|
||||||
use HasFactory;
|
|
||||||
|
|
||||||
protected static function boot()
|
|
||||||
{
|
|
||||||
parent::boot();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getKeyName()
|
|
||||||
{
|
|
||||||
return 'uuid';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getKeyType()
|
|
||||||
{
|
|
||||||
return 'string';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -5,8 +5,6 @@ declare(strict_types=1);
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
@ -14,9 +12,8 @@ use Illuminate\Notifications\Notifiable;
|
|||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||||
use Notifiable;
|
|
||||||
use HasUuids;
|
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
use Notifiable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
@ -39,8 +36,6 @@ class User extends Authenticatable
|
|||||||
'remember_token',
|
'remember_token',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $primaryKey = 'uuid';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the attributes that should be cast.
|
* Get the attributes that should be cast.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @property string $uuid
|
|
||||||
* @property string $title
|
|
||||||
* @property string $description
|
|
||||||
* @property Carbon $created_at
|
|
||||||
* @property Carbon $updated_at
|
|
||||||
* @property Carbon $deleted_at
|
|
||||||
*/
|
|
||||||
class Vacancy extends BaseModel
|
|
||||||
{
|
|
||||||
protected $fillable = [
|
|
||||||
'title',
|
|
||||||
'description',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@ -8,13 +8,12 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2",
|
"php": "^8.2",
|
||||||
"laravel/framework": "^12.0",
|
"laravel/framework": "^12.0",
|
||||||
"laravel/tinker": "^2.10.1",
|
"laravel/tinker": "^2.10.1"
|
||||||
"spatie/laravel-data": "^4.19"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fakerphp/faker": "^1.23",
|
"fakerphp/faker": "^1.23",
|
||||||
"laravel/pail": "^1.2.2",
|
"laravel/pail": "^1.2.2",
|
||||||
"laravel/pint": "^1.24",
|
"laravel/pint": "^1.27",
|
||||||
"laravel/sail": "^1.41",
|
"laravel/sail": "^1.41",
|
||||||
"mockery/mockery": "^1.6",
|
"mockery/mockery": "^1.6",
|
||||||
"nunomaduro/collision": "^8.6",
|
"nunomaduro/collision": "^8.6",
|
||||||
@ -44,7 +43,7 @@
|
|||||||
],
|
],
|
||||||
"dev": [
|
"dev": [
|
||||||
"Composer\\Config::disableProcessTimeout",
|
"Composer\\Config::disableProcessTimeout",
|
||||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
|
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
|
||||||
],
|
],
|
||||||
"post-autoload-dump": [
|
"post-autoload-dump": [
|
||||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
|
|||||||
1282
src/composer.lock
generated
1282
src/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,197 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
/*
|
|
||||||
* The package will use this format when working with dates. If this option
|
|
||||||
* is an array, it will try to convert from the first format that works,
|
|
||||||
* and will serialize dates using the first format from the array.
|
|
||||||
*/
|
|
||||||
'date_format' => DATE_ATOM,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When transforming or casting dates, the following timezone will be used to
|
|
||||||
* convert the date to the correct timezone. If set to null no timezone will
|
|
||||||
* be passed.
|
|
||||||
*/
|
|
||||||
'date_timezone' => null,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* It is possible to enable certain features of the package, these would otherwise
|
|
||||||
* be breaking changes, and thus they are disabled by default. In the next major
|
|
||||||
* version of the package, these features will be enabled by default.
|
|
||||||
*/
|
|
||||||
'features' => [
|
|
||||||
'cast_and_transform_iterables' => false,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When trying to set a computed property value, the package will throw an exception.
|
|
||||||
* You can disable this behaviour by setting this option to true, which will then just
|
|
||||||
* ignore the value being passed into the computed property and recalculate it.
|
|
||||||
*/
|
|
||||||
'ignore_exception_when_trying_to_set_computed_property_value' => false,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Global transformers will take complex types and transform them into simple
|
|
||||||
* types.
|
|
||||||
*/
|
|
||||||
'transformers' => [
|
|
||||||
DateTimeInterface::class => \Spatie\LaravelData\Transformers\DateTimeInterfaceTransformer::class,
|
|
||||||
\Illuminate\Contracts\Support\Arrayable::class => \Spatie\LaravelData\Transformers\ArrayableTransformer::class,
|
|
||||||
BackedEnum::class => Spatie\LaravelData\Transformers\EnumTransformer::class,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Global casts will cast values into complex types when creating a data
|
|
||||||
* object from simple types.
|
|
||||||
*/
|
|
||||||
'casts' => [
|
|
||||||
DateTimeInterface::class => Spatie\LaravelData\Casts\DateTimeInterfaceCast::class,
|
|
||||||
BackedEnum::class => Spatie\LaravelData\Casts\EnumCast::class,
|
|
||||||
// Enumerable::class => Spatie\LaravelData\Casts\EnumerableCast::class,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Rule inferrers can be configured here. They will automatically add
|
|
||||||
* validation rules to properties of a data object based upon
|
|
||||||
* the type of the property.
|
|
||||||
*/
|
|
||||||
'rule_inferrers' => [
|
|
||||||
Spatie\LaravelData\RuleInferrers\SometimesRuleInferrer::class,
|
|
||||||
Spatie\LaravelData\RuleInferrers\NullableRuleInferrer::class,
|
|
||||||
Spatie\LaravelData\RuleInferrers\RequiredRuleInferrer::class,
|
|
||||||
Spatie\LaravelData\RuleInferrers\BuiltInTypesRuleInferrer::class,
|
|
||||||
Spatie\LaravelData\RuleInferrers\AttributesRuleInferrer::class,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Normalizers return an array representation of the payload, or null if
|
|
||||||
* it cannot normalize the payload. The normalizers below are used for
|
|
||||||
* every data object, unless overridden in a specific data object class.
|
|
||||||
*/
|
|
||||||
'normalizers' => [
|
|
||||||
Spatie\LaravelData\Normalizers\ModelNormalizer::class,
|
|
||||||
// Spatie\LaravelData\Normalizers\FormRequestNormalizer::class,
|
|
||||||
Spatie\LaravelData\Normalizers\ArrayableNormalizer::class,
|
|
||||||
Spatie\LaravelData\Normalizers\ObjectNormalizer::class,
|
|
||||||
Spatie\LaravelData\Normalizers\ArrayNormalizer::class,
|
|
||||||
Spatie\LaravelData\Normalizers\JsonNormalizer::class,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Data objects can be wrapped into a key like 'data' when used as a resource,
|
|
||||||
* this key can be set globally here for all data objects. You can pass in
|
|
||||||
* `null` if you want to disable wrapping.
|
|
||||||
*/
|
|
||||||
'wrap' => null,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Adds a specific caster to the Symphony VarDumper component which hides
|
|
||||||
* some properties from data objects and collections when being dumped
|
|
||||||
* by `dump` or `dd`. Can be 'enabled', 'disabled' or 'development'
|
|
||||||
* which will only enable the caster locally.
|
|
||||||
*/
|
|
||||||
'var_dumper_caster_mode' => 'development',
|
|
||||||
|
|
||||||
/*
|
|
||||||
* It is possible to skip the PHP reflection analysis of data objects
|
|
||||||
* when running in production. This will speed up the package. You
|
|
||||||
* can configure where data objects are stored and which cache
|
|
||||||
* store should be used.
|
|
||||||
*
|
|
||||||
* Structures are cached forever as they'll become stale when your
|
|
||||||
* application is deployed with changes. You can set a duration
|
|
||||||
* in seconds if you want the cache to clear after a certain
|
|
||||||
* timeframe.
|
|
||||||
*/
|
|
||||||
'structure_caching' => [
|
|
||||||
'enabled' => true,
|
|
||||||
'directories' => [app_path('Data')],
|
|
||||||
'cache' => [
|
|
||||||
'store' => env('CACHE_STORE', env('CACHE_DRIVER', 'file')),
|
|
||||||
'prefix' => 'laravel-data',
|
|
||||||
'duration' => null,
|
|
||||||
],
|
|
||||||
'reflection_discovery' => [
|
|
||||||
'enabled' => true,
|
|
||||||
'base_path' => base_path(),
|
|
||||||
'root_namespace' => null,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* A data object can be validated when created using a factory or when calling the from
|
|
||||||
* method. By default, only when a request is passed the data is being validated. This
|
|
||||||
* behaviour can be changed to always validate or to completely disable validation.
|
|
||||||
*/
|
|
||||||
'validation_strategy' => \Spatie\LaravelData\Support\Creation\ValidationStrategy::OnlyRequests->value,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* A data object can map the names of its properties when transforming (output) or when
|
|
||||||
* creating (input). By default, the package will not map any names. You can set a
|
|
||||||
* global strategy here, or override it on a specific data object.
|
|
||||||
*/
|
|
||||||
'name_mapping_strategy' => [
|
|
||||||
'input' => null,
|
|
||||||
'output' => null,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When using an invalid include, exclude, only or except partial, the package will
|
|
||||||
* throw an exception. You can disable this behaviour by setting this option to true.
|
|
||||||
*/
|
|
||||||
'ignore_invalid_partials' => false,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When transforming a nested chain of data objects, the package can end up in an infinite
|
|
||||||
* loop when including a recursive relationship. The max transformation depth can be
|
|
||||||
* set as a safety measure to prevent this from happening. When set to null, the
|
|
||||||
* package will not enforce a maximum depth.
|
|
||||||
*/
|
|
||||||
'max_transformation_depth' => null,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When the maximum transformation depth is reached, the package will throw an exception.
|
|
||||||
* You can disable this behaviour by setting this option to true which will return an
|
|
||||||
* empty array.
|
|
||||||
*/
|
|
||||||
'throw_when_max_transformation_depth_reached' => true,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When using the `make:data` command, the package will use these settings to generate
|
|
||||||
* the data classes. You can override these settings by passing options to the command.
|
|
||||||
*/
|
|
||||||
'commands' => [
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Provides default configuration for the `make:data` command. These settings can be overridden with options
|
|
||||||
* passed directly to the `make:data` command for generating single Data classes, or if not set they will
|
|
||||||
* automatically fall back to these defaults. See `php artisan make:data --help` for more information
|
|
||||||
*/
|
|
||||||
'make' => [
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The default namespace for generated Data classes. This exists under the application's root namespace,
|
|
||||||
* so the default 'Data` will end up as '\App\Data', and generated Data classes will be placed in the
|
|
||||||
* app/Data/ folder. Data classes can live anywhere, but this is where `make:data` will put them.
|
|
||||||
*/
|
|
||||||
'namespace' => 'Data',
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This suffix will be appended to all data classes generated by make:data, so that they are less likely
|
|
||||||
* to conflict with other related classes, controllers or models with a similar name without resorting
|
|
||||||
* to adding an alias for the Data object. Set to a blank string (not null) to disable.
|
|
||||||
*/
|
|
||||||
'suffix' => 'Data',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When using Livewire, the package allows you to enable or disable the synths
|
|
||||||
* these synths will automatically handle the data objects and their
|
|
||||||
* properties when used in a Livewire component.
|
|
||||||
*/
|
|
||||||
'livewire' => [
|
|
||||||
'enable_synths' => false,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
@ -97,7 +97,7 @@ return [
|
|||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
'prefix_indexes' => true,
|
'prefix_indexes' => true,
|
||||||
'search_path' => 'public',
|
'search_path' => 'public',
|
||||||
'sslmode' => 'prefer',
|
'sslmode' => env('DB_SSLMODE', 'prefer'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'sqlsrv' => [
|
'sqlsrv' => [
|
||||||
|
|||||||
@ -43,7 +43,7 @@ return [
|
|||||||
'public' => [
|
'public' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'root' => storage_path('app/public'),
|
'root' => storage_path('app/public'),
|
||||||
'url' => env('APP_URL') . '/storage',
|
'url' => rtrim(env('APP_URL', 'http://localhost'), '/') . '/storage',
|
||||||
'visibility' => 'public',
|
'visibility' => 'public',
|
||||||
'throw' => false,
|
'throw' => false,
|
||||||
'report' => false,
|
'report' => false,
|
||||||
|
|||||||
@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Database\Factories;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Vacancy>
|
|
||||||
*/
|
|
||||||
class VacancyFactory extends Factory
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Define the model's default state.
|
|
||||||
*
|
|
||||||
* @return array<string, mixed>
|
|
||||||
*/
|
|
||||||
public function definition(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
//
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -12,7 +12,7 @@ return new class extends Migration
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('users', function (Blueprint $table) {
|
Schema::create('users', function (Blueprint $table) {
|
||||||
$table->uuid()->primary();
|
$table->id();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('email')->unique();
|
$table->string('email')->unique();
|
||||||
$table->timestamp('email_verified_at')->nullable();
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
|
|||||||
@ -14,13 +14,13 @@ return new class extends Migration
|
|||||||
Schema::create('cache', function (Blueprint $table) {
|
Schema::create('cache', function (Blueprint $table) {
|
||||||
$table->string('key')->primary();
|
$table->string('key')->primary();
|
||||||
$table->mediumText('value');
|
$table->mediumText('value');
|
||||||
$table->integer('expiration');
|
$table->integer('expiration')->index();
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('cache_locks', function (Blueprint $table) {
|
Schema::create('cache_locks', function (Blueprint $table) {
|
||||||
$table->string('key')->primary();
|
$table->string('key')->primary();
|
||||||
$table->string('owner');
|
$table->string('owner');
|
||||||
$table->integer('expiration');
|
$table->integer('expiration')->index();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*/
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
Schema::create('vacancies', function (Blueprint $table) {
|
|
||||||
$table->uuid()->primary();
|
|
||||||
$table->string('title');
|
|
||||||
$table->text('description');
|
|
||||||
$table->string('status');
|
|
||||||
$table->boolean('is_favorite')->default(false);
|
|
||||||
|
|
||||||
$table->timestamps();
|
|
||||||
$table->softDeletes();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('vacancies');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@ -15,8 +15,11 @@ class DatabaseSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
$this->call([
|
// User::factory(10)->create();
|
||||||
UserSeeder::class,
|
|
||||||
|
User::factory()->create([
|
||||||
|
'name' => 'Test User',
|
||||||
|
'email' => 'test@example.com',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Database\Seeders;
|
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
|
|
||||||
class UserSeeder extends Seeder
|
|
||||||
{
|
|
||||||
public function run(): void
|
|
||||||
{
|
|
||||||
if (!User::where('name', 'admin')->exists()) {
|
|
||||||
User::factory()->create([
|
|
||||||
'name' => 'admin',
|
|
||||||
'email' => 'admin@example.com',
|
|
||||||
'password' => bcrypt('password'),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
User::factory(10)->create();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Database\Seeders;
|
|
||||||
|
|
||||||
use App\Models\Vacancy;
|
|
||||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
|
|
||||||
class VacancySeeder extends Seeder
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the database seeds.
|
|
||||||
*/
|
|
||||||
public function run(): void
|
|
||||||
{
|
|
||||||
Vacancy::factory(10)->create();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
test('the application runs', function () {
|
it('returns a successful response', function () {
|
||||||
$response = $this->get('/up');
|
$response = $this->get('/');
|
||||||
|
|
||||||
$response->assertStatus(200);
|
$response->assertStatus(200);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -8,5 +8,5 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
|||||||
|
|
||||||
abstract class TestCase extends BaseTestCase
|
abstract class TestCase extends BaseTestCase
|
||||||
{
|
{
|
||||||
use CreateApplication;
|
//
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user