Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ LOG_CHANNEL=stack
LOG_STACK=single,nightwatch
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_CONNECTION=pgsql
DB_HOST=pgsql
DB_PORT=5432
DB_DATABASE=laravelcm
DB_USERNAME=root
DB_PASSWORD=
DB_USERNAME=sail
DB_PASSWORD=password

BROADCAST_DRIVER=log
CACHE_DRIVER=file
Expand Down
14 changes: 14 additions & 0 deletions app/Models/Plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,22 @@
use Illuminate\Database\Eloquent\Builder;
use Laravelcm\Subscriptions\Models\Plan as Model;

/**
* @mixin Model
*
* @property-read PlanType $type
*/
final class Plan extends Model
{
protected $guarded = [];

protected function casts(): array
{
return [
'type' => PlanType::class,
];
}

/**
* @param Builder<Plan> $query
*/
Expand Down
52 changes: 42 additions & 10 deletions database/seeders/ChannelSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ final class ChannelSeeder extends Seeder
{
public function run(): void
{
$authentification = Channel::create(['name' => 'Authentification', 'slug' => 'authentification', 'color' => '#31c48d']);
$authentification = Channel::query()->create([
'name' => 'Authentification',
'slug' => 'authentification',
'color' => '#31c48d',
]);
$authentification->items()->createMany([
['name' => 'Breeze', 'slug' => 'breeze'],
['name' => 'Fortify', 'slug' => 'fortify'],
Expand All @@ -21,14 +25,22 @@ public function run(): void
['name' => 'UI', 'slug' => 'ui'],
]);

$javascript = Channel::create(['name' => 'JavaScript', 'slug' => 'javascript', 'color' => '#fdae3f']);
$javascript = Channel::query()->create([
'name' => 'JavaScript',
'slug' => 'javascript',
'color' => '#fdae3f',
]);
$javascript->items()->createMany([
['name' => 'React', 'slug' => 'react'],
['name' => 'Vue.js', 'slug' => 'vue-js'],
['name' => 'Alpine.js', 'slug' => 'alpine-js'],
]);

$laravel = Channel::create(['name' => 'Laravel', 'slug' => 'laravel', 'color' => '#ff2d20']);
$laravel = Channel::query()->create([
'name' => 'Laravel',
'slug' => 'laravel',
'color' => '#ff2d20',
]);
$laravel->items()->createMany([
['name' => 'Blade', 'slug' => 'blade'],
['name' => 'Eloquent', 'slug' => 'eloquent'],
Expand All @@ -42,14 +54,22 @@ public function run(): void
['name' => 'Laragon', 'slug' => 'laragon'],
]);

$framework = Channel::create(['name' => 'Framework', 'slug' => 'framework', 'color' => '#fb70a9']);
$framework = Channel::query()->create([
'name' => 'Framework',
'slug' => 'framework',
'color' => '#fb70a9',
]);
$framework->items()->createMany([
['name' => 'Inertia', 'slug' => 'inertia'],
['name' => 'Livewire', 'slug' => 'livewire'],
['name' => 'TailwindCSS', 'slug' => 'tailwindcss'],
]);

$hosting = Channel::create(['name' => 'Hosting', 'slug' => 'hosting', 'color' => '#0080ff']);
$hosting = Channel::query()->create([
'name' => 'Hosting',
'slug' => 'hosting',
'color' => '#0080ff',
]);
$hosting->items()->createMany([
['name' => 'Digital Ocean', 'slug' => 'digital-ocean'],
['name' => 'Forge', 'slug' => 'forge'],
Expand All @@ -59,18 +79,30 @@ public function run(): void
['name' => 'AWS', 'slug' => 'aws'],
]);

$outils = Channel::create(['name' => 'Outils', 'slug' => 'outils', 'color' => '#333333']);
$outils->items()->createMany([
$tools = Channel::query()->create([
'name' => 'Outils',
'slug' => 'outils',
'color' => '#333333',
]);
$tools->items()->createMany([
['name' => 'Github Actions', 'slug' => 'github-actions'],
['name' => 'Gitlab', 'slug' => 'gitlab'],
['name' => 'Gitlab CI', 'slug' => 'gitlab-ci'],
]);

$design = Channel::create(['name' => 'Design', 'slug' => 'design', 'color' => '#6D28D9']);
$design = Channel::query()->create([
'name' => 'Design',
'slug' => 'design',
'color' => '#6D28D9',
]);
$design->items()->createMany([
['name' => 'UI/UX', 'slug' => 'ui-ux'],
]);

$divers = Channel::create(['name' => 'Divers', 'slug' => 'divers', 'color' => '#DB2777']);
$divers = Channel::query()->create([
'name' => 'Divers',
'slug' => 'divers',
'color' => '#DB2777',
]);
$divers->items()->createMany([
['name' => 'Laravel.cm', 'slug' => 'laravelcm'],
['name' => 'Gaming', 'slug' => 'gaming'],
Expand Down
12 changes: 6 additions & 6 deletions database/seeders/DeveloperPremiumPlanSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ final class DeveloperPremiumPlanSeeder extends Seeder
{
public function run(): void
{
$rookiePlan = Plan::create([
'name' => 'Le Rookie',
$rookiePlan = Plan::query()->create([
'name' => 'Builder',
'description' => 'Pour tous ceux qui veulent apprendre et avoir le contenu minimal',
'type' => PlanType::DEVELOPER->value,
'type' => PlanType::DEVELOPER,
'price' => 2000,
'signup_fee' => 0,
'invoice_period' => 1,
Expand All @@ -34,10 +34,10 @@ public function run(): void
new Feature(['name' => 'Accès au code source des tutoriels', 'value' => 1, 'sort_order' => 5]),
]);

$proPlan = Plan::create([
'name' => 'Le Pro',
$proPlan = Plan::query()->create([
'name' => 'Artisan',
'description' => 'Pour les professionnels du métier',
'type' => PlanType::DEVELOPER->value,
'type' => PlanType::DEVELOPER,
'price' => 5000,
'signup_fee' => 0,
'invoice_period' => 1,
Expand Down
41 changes: 10 additions & 31 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
services:
laravelcm:
build:
context: '.'
context: .
dockerfile: Dockerfile
args:
NODE_VERSION: '22'
PHP_VERSION: 8.4
image: 'laravelcm/php'
image: laravelcm/php
extra_hosts:
- 'host.docker.internal:host-gateway'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${APP_PORT:-8080}/up"]
test: ['CMD', 'curl', '-f', 'http://localhost:${APP_PORT:-8080}/up']
timeout: 30s
environment:
APP_NAME: ${APP_NAME}
Expand All @@ -21,10 +21,6 @@ services:
APP_DOMAIN: ${APP_DOMAIN}
APP_URL: ${APP_URL}
ASSET_URL: ${ASSET_URL}
APP_LICENCE_DOMAIN: ${APP_LICENCE_DOMAIN}
APP_LICENCE_API: ${APP_LICENCE_API}
ANALYTICS_PROPERTY_ID: ${ANALYTICS_PROPERTY_ID}
APP_DEMO: ${APP_DEMO}
APP_LOCALE: ${APP_LOCALE}
APP_FALLBACK_LOCALE: ${APP_FALLBACK_LOCALE}
APP_FAKER_LOCALE: ${APP_FAKER_LOCALE}
Expand Down Expand Up @@ -75,9 +71,6 @@ services:
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
ANTHROPIC_API_VERSION: ${ANTHROPIC_API_VERSION}
OLLAMA_URL: ${OLLAMA_URL}
GROQ_API_KEY: ${GROQ_API_KEY}
XAI_API_KEY: ${XAI_API_KEY}
GEMINI_API_KEY: ${GEMINI_API_KEY}
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY}
SCOUT_DRIVER: ${SCOUT_DRIVER}
TYPESENSE_HOST: ${TYPESENSE_HOST}
Expand All @@ -88,7 +81,7 @@ services:
STRIPE_VERSION: ${STRIPE_VERSION}
NOTCHPAY_PUBLIC_KEY: ${NOTCHPAY_PUBLIC_KEY}
NOTCHPAY_SECRET_KEY: ${NOTCHPAY_SECRET_KEY}
OCTANE_SERVER: frankenphp
OCTANE_SERVER: 'frankenphp'
CADDY_GLOBAL_OPTIONS: |
servers {
trusted_proxies static private_ranges
Expand All @@ -108,11 +101,11 @@ services:
networks:
- dokploy-network
schedule:
image: 'laravelcm/php'
command: ["artisan", "schedule:work"]
image: laravelcm/php
command: ['artisan', 'schedule:work']
stop_signal: SIGTERM
healthcheck:
test: ["CMD", "healthcheck-schedule"]
test: ['CMD', 'healthcheck-schedule']
start_period: 10s
environment:
APP_NAME: ${APP_NAME}
Expand All @@ -123,10 +116,6 @@ services:
APP_DOMAIN: ${APP_DOMAIN}
APP_URL: ${APP_URL}
ASSET_URL: ${ASSET_URL}
APP_LICENCE_DOMAIN: ${APP_LICENCE_DOMAIN}
APP_LICENCE_API: ${APP_LICENCE_API}
ANALYTICS_PROPERTY_ID: ${ANALYTICS_PROPERTY_ID}
APP_DEMO: ${APP_DEMO}
APP_LOCALE: ${APP_LOCALE}
APP_FALLBACK_LOCALE: ${APP_FALLBACK_LOCALE}
APP_FAKER_LOCALE: ${APP_FAKER_LOCALE}
Expand Down Expand Up @@ -177,9 +166,6 @@ services:
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
ANTHROPIC_API_VERSION: ${ANTHROPIC_API_VERSION}
OLLAMA_URL: ${OLLAMA_URL}
GROQ_API_KEY: ${GROQ_API_KEY}
XAI_API_KEY: ${XAI_API_KEY}
GEMINI_API_KEY: ${GEMINI_API_KEY}
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY}
SCOUT_DRIVER: ${SCOUT_DRIVER}
TYPESENSE_HOST: ${TYPESENSE_HOST}
Expand All @@ -197,11 +183,11 @@ services:
depends_on:
- laravelcm
queue:
image: 'laravelcm/php'
command: ["artisan", "queue:work", "--tries=3", "--queue=default,media"]
image: laravelcm/php
command: ['artisan', 'queue:work', '--tries=3', '--queue=default,media']
stop_signal: SIGTERM
healthcheck:
test: ["CMD", "healthcheck-queue"]
test: ['CMD', 'healthcheck-queue']
start_period: 10s
environment:
APP_NAME: ${APP_NAME}
Expand All @@ -212,10 +198,6 @@ services:
APP_DOMAIN: ${APP_DOMAIN}
APP_URL: ${APP_URL}
ASSET_URL: ${ASSET_URL}
APP_LICENCE_DOMAIN: ${APP_LICENCE_DOMAIN}
APP_LICENCE_API: ${APP_LICENCE_API}
ANALYTICS_PROPERTY_ID: ${ANALYTICS_PROPERTY_ID}
APP_DEMO: ${APP_DEMO}
APP_LOCALE: ${APP_LOCALE}
APP_FALLBACK_LOCALE: ${APP_FALLBACK_LOCALE}
APP_FAKER_LOCALE: ${APP_FAKER_LOCALE}
Expand Down Expand Up @@ -266,9 +248,6 @@ services:
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
ANTHROPIC_API_VERSION: ${ANTHROPIC_API_VERSION}
OLLAMA_URL: ${OLLAMA_URL}
GROQ_API_KEY: ${GROQ_API_KEY}
XAI_API_KEY: ${XAI_API_KEY}
GEMINI_API_KEY: ${GEMINI_API_KEY}
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY}
SCOUT_DRIVER: ${SCOUT_DRIVER}
TYPESENSE_HOST: ${TYPESENSE_HOST}
Expand Down
Loading
Loading