prepare model done

dev
Aji Kamaludin 1 year ago
parent 09c27352f5
commit 6731e8fd47
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -1,4 +1,4 @@
APP_NAME='Voucher Shop'
APP_NAME='Voucher App'
APP_ENV=local
APP_KEY=
APP_DEBUG=true

@ -32,8 +32,13 @@ RUN apt-get update && apt-get dist-upgrade -y && \
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install pdo mysqli pdo_mysql mbstring exif pcntl bcmath gd intl zip pgsql pdo_pgsql curl xml
# Install PHP extensions (default version)
# RUN docker-php-ext-install pdo mysqli pdo_mysql mbstring exif pcntl bcmath gd intl zip pgsql pdo_pgsql curl xml
# Install PHP extension with install php extension
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions
RUN install-php-extensions pdo mysqli pdo_mysql mbstring exif pcntl bcmath gd intl zip pgsql pdo_pgsql curl xml
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

@ -1,15 +1,14 @@
# Voucher Online Shop
[fill desc here]
# Laravel Template - Flowbite
This just a laravel template with breeze react, user role based access crud with setup flowbite admin template
## Support me
<a href="https://trakteer.id/ajikamaludin" target="_blank"><img id="wse-buttons-preview" src="https://cdn.trakteer.id/images/embed/trbtn-blue-2.png" height="40" style="border:0px;height:40px;" alt="Trakteer Saya"></a>
## Requirements
- PHP 8.1 or latest
- Node 16+ or latest
- PHP 8.1 or latest
- Node 16+ or latest
## How to run

@ -41,7 +41,7 @@ class RoleController extends Controller
$request->validate([
'name' => 'string|required|max:255',
'permissions' => 'array|required',
'permissions.*.id' => 'uuid|required|exists:permissions,id',
'permissions.*.id' => 'ulid|required|exists:permissions,id',
]);
DB::beginTransaction();
@ -71,7 +71,7 @@ class RoleController extends Controller
$request->validate([
'name' => 'string|required|max:255',
'permissions' => 'array|required',
'permissions.*.id' => 'uuid|required|exists:permissions,id',
'permissions.*.id' => 'ulid|required|exists:permissions,id',
]);
if ($role->flag == 1) {

@ -30,7 +30,7 @@ class UserController extends Controller
'name' => 'required|string|max:255',
'email' => 'required|email|unique:users,email',
'password' => 'required|string|max:255',
'role_id' => 'required|uuid|exists:roles,id',
'role_id' => 'required|ulid|exists:roles,id',
]);
User::create([
@ -54,7 +54,7 @@ class UserController extends Controller
if ($user->role != null) {
$request->validate([
'role_id' => 'required|uuid|exists:roles,id',
'role_id' => 'required|ulid|exists:roles,id',
]);
}

@ -23,4 +23,4 @@ class HttpSecureAware
return $next($request);
}
}
}

@ -0,0 +1,14 @@
<?php
namespace App\Models;
class Banner extends Model
{
protected $fillable = [
'image',
'title',
'description',
'destination',
'type',
];
}

@ -0,0 +1,15 @@
<?php
namespace App\Models;
class CoinHistory extends Model
{
protected $fillable = [
'debit',
'credit',
'description',
'customer_id',
'related_type',
'related_id',
];
}

@ -0,0 +1,22 @@
<?php
namespace App\Models;
class Customer extends Model
{
protected $fillable = [
'email',
'password',
'name',
'fullname',
'address',
'phone',
'image',
'referral_code',
'google_id',
'deposit_balance',
'coin_balance',
'identity_verified',
'identity_image',
];
}

@ -0,0 +1,12 @@
<?php
namespace App\Models;
class CustomerLevel extends Model
{
protected $fillable = [
'name',
'description',
'key',
];
}

@ -0,0 +1,12 @@
<?php
namespace App\Models;
class CustomerLevelHistory extends Model
{
protected $fillable = [
'customer_id',
'customer_level_id',
'date_time',
];
}

@ -0,0 +1,12 @@
<?php
namespace App\Models;
class CustomerRefferal extends Model
{
protected $fillable = [
'customer_id',
'refferal_id',
'customer_code',
];
}

@ -0,0 +1,15 @@
<?php
namespace App\Models;
class DepositHistory extends Model
{
protected $fillable = [
'debit',
'credit',
'description',
'customer_id',
'related_type',
'related_id',
];
}

@ -0,0 +1,12 @@
<?php
namespace App\Models;
class Location extends Model
{
protected $fillable = [
'name',
'description',
'logo',
];
}

@ -4,14 +4,14 @@ namespace App\Models;
use App\Models\Traits\CascadeSoftDeletes;
use App\Models\Traits\UserTrackable;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model as BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;
class Model extends BaseModel
{
use HasFactory, HasUuids, UserTrackable, SoftDeletes, CascadeSoftDeletes;
use HasFactory, HasUlids, UserTrackable, SoftDeletes, CascadeSoftDeletes;
public $cascadeDeletes = [];
}

@ -0,0 +1,13 @@
<?php
namespace App\Models;
class Notification extends Model
{
protected $fillable = [
'entity_type',
'entity_id',
'description',
'is_read',
];
}

@ -2,13 +2,13 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Permission extends Model
{
use HasFactory, HasUuids;
use HasFactory, HasUlids;
protected $fillable = [
'name',

@ -2,14 +2,14 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class RolePermission extends Model
{
use HasFactory, SoftDeletes, HasUuids;
use HasFactory, SoftDeletes, HasUlids;
protected $fillable = [
'role_id',

@ -0,0 +1,18 @@
<?php
namespace App\Models;
class Sale extends Model
{
protected $fillable = [
'customer_id',
'date_time',
'amount',
'payed_with',
'payment_token',
'payment_status',
'payment_response',
'payment_channel',
'payment_type',
];
}

@ -0,0 +1,14 @@
<?php
namespace App\Models;
class SaleItem extends Model
{
protected $fillable = [
'sale_id',
'entity_type',
'entity_id',
'price',
'additional_info_json',
];
}

@ -2,14 +2,14 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Setting extends Model
{
use HasFactory, SoftDeletes, HasUuids;
use HasFactory, SoftDeletes, HasUlids;
protected $fillable = [
'key',

@ -4,7 +4,7 @@ namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
@ -12,7 +12,7 @@ use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable, HasUuids;
use HasApiTokens, HasFactory, Notifiable, HasUlids;
/**
* The attributes that are mass assignable.

@ -0,0 +1,21 @@
<?php
namespace App\Models;
class Voucher extends Model
{
protected $fillable = [
'name',
'description',
'location_id',
'username',
'password',
'price',
'discount',
'display_price',
'quota',
'profile',
'comment',
'expired',
];
}

@ -0,0 +1,12 @@
<?php
namespace App\Models;
class VoucherPrice extends Model
{
protected $fillable = [
'customer_level_id',
'voucher_id',
'price',
];
}

@ -14,13 +14,13 @@ return new class extends Migration
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->ulid('id')->primary();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('reset_token')->nullable();
$table->uuid('role_id')->nullable();
$table->ulid('role_id')->nullable();
$table->rememberToken();
$table->timestamps();
});

@ -14,7 +14,7 @@ return new class extends Migration
public function up()
{
Schema::create('settings', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->ulid('id')->primary();
$table->string('key');
$table->text('value');
$table->string('type');

@ -14,13 +14,13 @@ return new class extends Migration
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->ulid('id')->primary();
$table->string('name');
$table->timestamps();
$table->softDeletes();
$table->uuid('created_by')->nullable();
$table->uuid('updated_by')->nullable();
$table->uuid('deleted_by')->nullable();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}

@ -14,9 +14,9 @@ return new class extends Migration
public function up()
{
Schema::create('role_permissions', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->uuid('role_id');
$table->uuid('permission_id');
$table->ulid('id')->primary();
$table->ulid('role_id');
$table->ulid('permission_id');
$table->timestamps();
$table->softDeletes();
});

@ -0,0 +1,38 @@
<?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('banners', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->string('image');
$table->string('title');
$table->string('description')->nullable();
$table->string('destination')->nullable();
$table->string('type')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('banners');
}
};

@ -0,0 +1,37 @@
<?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('notifications', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->string('entity_type')->nullable();
$table->ulid('entity_id')->nullable();
$table->string('description')->nullable();
$table->smallInteger('is_read')->default(0);
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('notifications');
}
};

@ -0,0 +1,45 @@
<?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('vouchers', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->string('name')->nullable();
$table->string('description')->nullable();
$table->ulid('location_id')->nullable();
$table->string('username')->nullable();
$table->string('password')->nullable();
$table->decimal('price', 20, 2)->default(0);
$table->decimal('discount', 20, 0)->default(0);
$table->decimal('display_price', 20, 2)->default(0);
$table->string('quota')->nullable();
$table->string('profile')->nullable();
$table->text('comment')->nullable();
$table->string('expired')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('vouchers');
}
};

@ -0,0 +1,36 @@
<?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('voucher_prices', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->ulid('customer_level_id')->nullable();
$table->ulid('voucher_id')->nullable();
$table->decimal('price', 20, 2)->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('voucher_prices');
}
};

@ -0,0 +1,46 @@
<?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('customers', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->string('email')->nullable();
$table->string('password')->nullable();
$table->string('name')->nullable();
$table->string('fullname')->nullable();
$table->text('address')->nullable();
$table->string('phone')->nullable();
$table->string('image')->nullable();
$table->string('referral_code')->nullable();
$table->string('google_id')->nullable();
$table->decimal('deposit_balance', 20, 2)->default(0);
$table->decimal('coin_balance', 20, 2)->default(0);
$table->smallInteger('identity_verified')->nullable();
$table->string('identity_image')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('customers');
}
};

@ -0,0 +1,36 @@
<?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('locations', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->string('name')->nullable();
$table->string('description')->nullable();
$table->string('logo')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('locations');
}
};

@ -0,0 +1,36 @@
<?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('customer_levels', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->string('name')->nullable();
$table->string('description')->nullable();
$table->string('key')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('customer_levels');
}
};

@ -0,0 +1,36 @@
<?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('customer_level_histories', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->ulid('customer_id')->nullable();
$table->ulid('customer_level_id')->nullable();
$table->timestamp('date_time')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('customer_level_histories');
}
};

@ -0,0 +1,39 @@
<?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('deposit_histories', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->decimal('debit', 20, 2)->default(0);
$table->decimal('credit', 20, 2)->default(0);
$table->text('description')->nullable();
$table->ulid('customer_id')->nullable();
$table->string('related_type')->nullable();
$table->string('related_id')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('deposit_histories');
}
};

@ -0,0 +1,39 @@
<?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('coin_histories', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->decimal('debit', 20, 2)->default(0);
$table->decimal('credit', 20, 2)->default(0);
$table->text('description')->nullable();
$table->ulid('customer_id')->nullable();
$table->string('related_type')->nullable();
$table->string('related_id')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('coin_histories');
}
};

@ -0,0 +1,36 @@
<?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('customer_refferals', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->ulid('customer_id')->nullable();
$table->ulid('refferal_id')->nullable();
$table->string('customer_code')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('customer_refferals');
}
};

@ -0,0 +1,42 @@
<?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('sales', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->ulid('customer_id')->nullable();
$table->timestamp('date_time')->nullable();
$table->decimal('amount', 20, 2)->default(0);
$table->string('payed_with')->nullable();
$table->string('payment_token')->nullable();
$table->string('payment_status')->nullable();
$table->string('payment_response')->nullable();
$table->string('payment_channel')->nullable();
$table->string('payment_type')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sales');
}
};

@ -0,0 +1,38 @@
<?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('sale_items', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->ulid('sale_id')->nullable();
$table->string('entity_type')->nullable();
$table->ulid('entity_id')->nullable();
$table->decimal('price', 20, 2)->default(0);
$table->text('additional_info_json')->nullable();
$table->timestamps();
$table->softDeletes();
$table->ulid('created_by')->nullable();
$table->ulid('updated_by')->nullable();
$table->ulid('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sale_items');
}
};

@ -19,27 +19,27 @@ class PermissionSeeder extends Seeder
public function run()
{
$permissions = [
['id' => Str::uuid(), 'label' => 'View Dashboard', 'name' => 'view-dashboard'],
['id' => Str::ulid(), 'label' => 'View Dashboard', 'name' => 'view-dashboard'],
['id' => Str::uuid(), 'label' => 'Create User', 'name' => 'create-user'],
['id' => Str::uuid(), 'label' => 'Update User', 'name' => 'update-user'],
['id' => Str::uuid(), 'label' => 'View User', 'name' => 'view-user'],
['id' => Str::uuid(), 'label' => 'Delete User', 'name' => 'delete-user'],
['id' => Str::ulid(), 'label' => 'Create User', 'name' => 'create-user'],
['id' => Str::ulid(), 'label' => 'Update User', 'name' => 'update-user'],
['id' => Str::ulid(), 'label' => 'View User', 'name' => 'view-user'],
['id' => Str::ulid(), 'label' => 'Delete User', 'name' => 'delete-user'],
['id' => Str::uuid(), 'label' => 'Create Role', 'name' => 'create-role'],
['id' => Str::uuid(), 'label' => 'Update Role', 'name' => 'update-role'],
['id' => Str::uuid(), 'label' => 'View Role', 'name' => 'view-role'],
['id' => Str::uuid(), 'label' => 'Delete Role', 'name' => 'delete-role'],
['id' => Str::ulid(), 'label' => 'Create Role', 'name' => 'create-role'],
['id' => Str::ulid(), 'label' => 'Update Role', 'name' => 'update-role'],
['id' => Str::ulid(), 'label' => 'View Role', 'name' => 'view-role'],
['id' => Str::ulid(), 'label' => 'Delete Role', 'name' => 'delete-role'],
];
foreach($permissions as $permission) {
foreach ($permissions as $permission) {
Permission::insert($permission);
}
$role = Role::create(['name' => 'admin']);
$permissions = Permission::all();
foreach($permissions as $permission) {
foreach ($permissions as $permission) {
$role->rolePermissions()->create(['permission_id' => $permission->id]);
}
@ -56,8 +56,7 @@ class PermissionSeeder extends Seeder
'role_id' => $role->id,
]);
$setting = [
];
$setting = [];
Setting::insert($setting);
}

@ -7,8 +7,8 @@ services:
uid: 1000
context: ./
dockerfile: ./Dockerfile
image: template
container_name: template-app
image: voucher
container_name: voucher-app
working_dir: /var/www/
volumes:
- ./:/var/www
@ -19,10 +19,10 @@ services:
mem_reservation: 128M
cpus: 0.5
networks:
- template
- voucher
nginx:
image: nginx:1.17-alpine
container_name: template-nginx
container_name: voucher-nginx
ports:
- 8000:80
volumes:
@ -32,59 +32,10 @@ services:
mem_reservation: 128M
cpus: 0.5
networks:
- template
mariadb:
image: mariadb:latest
container_name: template-mariadb
ports:
- 3306:3306
volumes:
- mariadb:/var/lib/mysql
- ./database:/database
environment:
MARIADB_DATABASE: app
MARIADB_USER: app
MARIADB_PASSWORD: password
MARIADB_ROOT_PASSWORD: password
mem_limit: 512m
mem_reservation: 128M
cpus: 0.5
networks:
template:
ipv4_address: 10.8.0.99
postgresql:
# image: postgres:latest
image: postgres:14-alpine3.17
container_name: template-postgres
restart: always
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data
- ./database:/database
environment:
POSTGRES_DB: app
POSTGRES_USER: app
POSTGRES_PASSWORD: password
mem_limit: 512m
mem_reservation: 128M
cpus: 0.5
networks:
template:
ipv4_address: 10.8.0.96
redis:
image: redis
container_name: template-redis
ports:
- 6379:6379
mem_limit: 512m
mem_reservation: 128M
cpus: 0.5
networks:
- template
- voucher
nodejs:
image: node:16-alpine
container_name: template-node
container_name: voucher-node
ports:
- 5173:5173
volumes:
@ -95,19 +46,13 @@ services:
mem_reservation: 128M
cpus: 0.5
networks:
- template
volumes:
mariadb:
driver: local
postgres:
driver: local
- voucher
networks:
template:
voucher:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.18.10.0/24
gateway: 10.18.10.1
- subnet: 10.25.10.0/24
gateway: 10.25.10.1

@ -13,47 +13,47 @@ use Illuminate\Support\Facades\Route;
Route::middleware('guest')->group(function () {
Route::get('register', [RegisteredUserController::class, 'create'])
->name('register');
->name('register');
Route::post('register', [RegisteredUserController::class, 'store']);
Route::get('login', [AuthenticatedSessionController::class, 'create'])
->name('login');
->name('login');
Route::post('login', [AuthenticatedSessionController::class, 'store']);
Route::get('forgot-password', [PasswordResetLinkController::class, 'create'])
->name('password.request');
->name('password.request');
Route::post('forgot-password', [PasswordResetLinkController::class, 'store'])
->name('password.email');
->name('password.email');
Route::get('reset-password/{token}', [NewPasswordController::class, 'create'])
->name('password.reset');
->name('password.reset');
Route::post('reset-password', [NewPasswordController::class, 'store'])
->name('password.store');
->name('password.store');
});
Route::middleware('auth')->group(function () {
Route::get('verify-email', [EmailVerificationPromptController::class, '__invoke'])
->name('verification.notice');
->name('verification.notice');
Route::get('verify-email/{id}/{hash}', [VerifyEmailController::class, '__invoke'])
->middleware(['signed', 'throttle:6,1'])
->name('verification.verify');
->middleware(['signed', 'throttle:6,1'])
->name('verification.verify');
Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
->middleware('throttle:6,1')
->name('verification.send');
->middleware('throttle:6,1')
->name('verification.send');
Route::get('confirm-password', [ConfirmablePasswordController::class, 'show'])
->name('password.confirm');
->name('password.confirm');
Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']);
Route::put('password', [PasswordController::class, 'update'])->name('password.update');
Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])
->name('logout');
->name('logout');
});

Loading…
Cancel
Save