Skip to content

Commit d655589

Browse files
authored
feat: events and sponsors module (#85)
close #79 still in progress
1 parent 99d66be commit d655589

61 files changed

Lines changed: 2332 additions & 5 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎app-modules/events/composer.json‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "he4rt/events",
3+
"description": "",
4+
"type": "library",
5+
"version": "1.0",
6+
"license": "proprietary",
7+
"require": {},
8+
"autoload": {
9+
"psr-4": {
10+
"He4rt\\Events\\": "src/",
11+
"He4rt\\Events\\Tests\\": "tests/",
12+
"He4rt\\Events\\Database\\Factories\\": "database/factories/",
13+
"He4rt\\Events\\Database\\Seeders\\": "database/seeders/"
14+
}
15+
},
16+
"minimum-stability": "stable",
17+
"extra": {
18+
"laravel": {
19+
"providers": [
20+
"He4rt\\Events\\Providers\\EventsServiceProvider"
21+
]
22+
}
23+
}
24+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace He4rt\Events\Database\Factories;
6+
7+
use He4rt\Events\Enums\EventTypeEnum;
8+
use He4rt\Events\Models\Event;
9+
use He4rt\Tenant\Models\Tenant;
10+
use Illuminate\Database\Eloquent\Factories\Factory;
11+
use Illuminate\Support\Facades\Date;
12+
13+
class EventFactory extends Factory
14+
{
15+
protected $model = Event::class;
16+
17+
public function definition(): array
18+
{
19+
return [
20+
'tenant_id' => Tenant::factory(),
21+
'event_type' => fake()->randomElement(EventTypeEnum::cases()),
22+
'slug' => fake()->slug(),
23+
'active' => true,
24+
'title' => fake()->word(),
25+
'description' => fake()->text(),
26+
'event_at' => Date::now(),
27+
'start_at' => Date::now(),
28+
'end_at' => Date::now(),
29+
'location' => fake()->word(),
30+
'max_attendees' => fake()->randomNumber(),
31+
'attendees_count' => 0,
32+
'waitlist_count' => 0,
33+
'created_at' => Date::now(),
34+
'updated_at' => Date::now(),
35+
];
36+
}
37+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace He4rt\Events\Database\Factories;
6+
7+
use He4rt\Events\Models\Event;
8+
use He4rt\Events\Models\Talk;
9+
use He4rt\Tenant\Models\Tenant;
10+
use He4rt\User\Models\User;
11+
use Illuminate\Database\Eloquent\Factories\Factory;
12+
use Illuminate\Support\Facades\Date;
13+
14+
class TalkFactory extends Factory
15+
{
16+
protected $model = Talk::class;
17+
18+
public function definition(): array
19+
{
20+
return [
21+
'tenant_id' => Tenant::factory(),
22+
'event_id' => Event::factory(),
23+
'user_id' => User::factory(),
24+
'status' => fake()->word(),
25+
'field_type' => fake()->word(),
26+
'title' => fake()->word(),
27+
'description' => fake()->text(),
28+
'created_at' => Date::now(),
29+
'updated_at' => Date::now(),
30+
];
31+
}
32+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Illuminate\Database\Migrations\Migration;
6+
use Illuminate\Database\Schema\Blueprint;
7+
use Illuminate\Support\Facades\Schema;
8+
9+
return new class extends Migration
10+
{
11+
/**
12+
* Run the migrations.
13+
*/
14+
public function up(): void
15+
{
16+
Schema::create('events', function (Blueprint $table): void {
17+
$table->id();
18+
$table->foreignId('tenant_id')
19+
->constrained('tenants')
20+
->nullOnDelete();
21+
$table->string('event_type'); // Meetup or Workshop
22+
$table->boolean('active');
23+
$table->string('slug');
24+
$table->string('title');
25+
$table->text('description');
26+
$table->timestamp('event_at'); // Date
27+
$table->timestamp('start_at');
28+
$table->timestamp('end_at');
29+
$table->string('location');
30+
$table->integer('max_attendees');
31+
$table->integer('attendees_count')->default(0);
32+
$table->integer('waitlist_count')->default(0);
33+
$table->timestamps();
34+
});
35+
}
36+
37+
/**
38+
* Reverse the migrations.
39+
*/
40+
public function down(): void
41+
{
42+
// Schema::dropIfExists('events');
43+
}
44+
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Illuminate\Database\Migrations\Migration;
6+
use Illuminate\Database\Schema\Blueprint;
7+
use Illuminate\Support\Facades\Schema;
8+
9+
return new class extends Migration
10+
{
11+
/**
12+
* Run the migrations.
13+
*/
14+
public function up(): void
15+
{
16+
Schema::create('events_talks', function (Blueprint $table): void {
17+
$table->id();
18+
$table->foreignId('event_id')->constrained('events')->onDelete('cascade');
19+
$table->foreignId('user_id')->constrained('users')->onDelete('cascade');
20+
$table->foreignId('tenant_id')
21+
->constrained('tenants')
22+
->nullOnDelete();
23+
$table->string('status');
24+
$table->string('field_type'); // IA, Dev, Design, etc.
25+
$table->string('title');
26+
$table->text('description');
27+
$table->timestamps();
28+
});
29+
}
30+
31+
/**
32+
* Reverse the migrations.
33+
*/
34+
public function down(): void
35+
{
36+
// Schema::dropIfExists('events_c4p');
37+
}
38+
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Illuminate\Database\Migrations\Migration;
6+
use Illuminate\Database\Schema\Blueprint;
7+
use Illuminate\Support\Facades\Schema;
8+
9+
return new class extends Migration
10+
{
11+
/**
12+
* Run the migrations.
13+
*/
14+
public function up(): void
15+
{
16+
Schema::create('events_attendees', function (Blueprint $table): void {
17+
$table->foreignId('event_id')->constrained('events')->onDelete('cascade');
18+
$table->foreignId('user_id')->constrained('users')->onDelete('cascade');
19+
$table->string('status'); // Pending, Confirmed, Rejected
20+
$table->timestamps();
21+
});
22+
}
23+
24+
/**
25+
* Reverse the migrations.
26+
*/
27+
public function down(): void
28+
{
29+
// Schema::dropIfExists('events_attendees');
30+
}
31+
};

‎app-modules/events/database/seeders/.gitkeep‎

Whitespace-only changes.

‎app-modules/events/resources/views/.gitkeep‎

Whitespace-only changes.

‎app-modules/events/routes/.gitkeep‎

Whitespace-only changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace He4rt\Events;
6+
7+
use Filament\Contracts\Plugin;
8+
use Filament\Panel;
9+
use He4rt\Events\Filament\Resources\Events\EventResource;
10+
use He4rt\Events\Filament\Resources\Talks\TalkResource;
11+
12+
class AdminEventPanelPlugin implements Plugin
13+
{
14+
public function getId(): string
15+
{
16+
return 'admin-event';
17+
}
18+
19+
public function register(Panel $panel): void
20+
{
21+
$panel->resources([
22+
EventResource::class,
23+
TalkResource::class,
24+
]);
25+
}
26+
27+
public function boot(Panel $panel): void {}
28+
}

0 commit comments

Comments
 (0)