empty laravel app
This commit is contained in:
1
database/.gitignore
vendored
Normal file
1
database/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.sqlite*
|
||||
44
database/factories/UserFactory.php
Normal file
44
database/factories/UserFactory.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The current password being used by the factory.
|
||||
*/
|
||||
protected static ?string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*/
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
49
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
49
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?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('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
$table->integer('last_activity')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
};
|
||||
35
database/migrations/0001_01_01_000001_create_cache_table.php
Normal file
35
database/migrations/0001_01_01_000001_create_cache_table.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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('cache', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->mediumText('value');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
||||
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?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('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
|
||||
Schema::create('job_batches', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->string('name');
|
||||
$table->integer('total_jobs');
|
||||
$table->integer('pending_jobs');
|
||||
$table->integer('failed_jobs');
|
||||
$table->longText('failed_job_ids');
|
||||
$table->mediumText('options')->nullable();
|
||||
$table->integer('cancelled_at')->nullable();
|
||||
$table->integer('created_at');
|
||||
$table->integer('finished_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
Schema::dropIfExists('job_batches');
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
};
|
||||
@@ -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::table('users', function (Blueprint $table) {
|
||||
$table->text('two_factor_secret')
|
||||
->after('password')
|
||||
->nullable();
|
||||
|
||||
$table->text('two_factor_recovery_codes')
|
||||
->after('two_factor_secret')
|
||||
->nullable();
|
||||
|
||||
$table->timestamp('two_factor_confirmed_at')
|
||||
->after('two_factor_recovery_codes')
|
||||
->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'two_factor_secret',
|
||||
'two_factor_recovery_codes',
|
||||
'two_factor_confirmed_at',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
208
database/schema.md
Normal file
208
database/schema.md
Normal file
@@ -0,0 +1,208 @@
|
||||
# Database Schema Documentation
|
||||
|
||||
> Generated: 2026-02-03 05:38:33
|
||||
> Database: go-no-go
|
||||
> Total Tables: 13
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [action_events](#action_events)
|
||||
- [cache](#cache)
|
||||
- [cache_locks](#cache_locks)
|
||||
- [failed_jobs](#failed_jobs)
|
||||
- [job_batches](#job_batches)
|
||||
- [jobs](#jobs)
|
||||
- [migrations](#migrations)
|
||||
- [nova_field_attachments](#nova_field_attachments)
|
||||
- [nova_notifications](#nova_notifications)
|
||||
- [nova_pending_field_attachments](#nova_pending_field_attachments)
|
||||
- [password_reset_tokens](#password_reset_tokens)
|
||||
- [sessions](#sessions)
|
||||
- [users](#users)
|
||||
|
||||
---
|
||||
|
||||
## action_events
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | bigint unsigned | NO | PRI | NULL | auto_increment | |
|
||||
| batch_id | char(36) | NO | MUL | NULL | | |
|
||||
| user_id | bigint unsigned | NO | MUL | NULL | | |
|
||||
| name | varchar(255) | NO | | NULL | | |
|
||||
| actionable_type | varchar(255) | NO | MUL | NULL | | |
|
||||
| actionable_id | bigint unsigned | NO | | NULL | | |
|
||||
| target_type | varchar(255) | NO | MUL | NULL | | |
|
||||
| target_id | bigint unsigned | NO | | NULL | | |
|
||||
| model_type | varchar(255) | NO | | NULL | | |
|
||||
| model_id | bigint unsigned | YES | | NULL | | |
|
||||
| fields | text | NO | | NULL | | |
|
||||
| status | varchar(25) | NO | | running | | |
|
||||
| exception | text | NO | | NULL | | |
|
||||
| created_at | timestamp | YES | | NULL | | |
|
||||
| updated_at | timestamp | YES | | NULL | | |
|
||||
| original | mediumtext | YES | | NULL | | |
|
||||
| changes | mediumtext | YES | | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## cache
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| key | varchar(255) | NO | PRI | NULL | | |
|
||||
| value | mediumtext | NO | | NULL | | |
|
||||
| expiration | int | NO | MUL | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## cache_locks
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| key | varchar(255) | NO | PRI | NULL | | |
|
||||
| owner | varchar(255) | NO | | NULL | | |
|
||||
| expiration | int | NO | MUL | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## failed_jobs
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | bigint unsigned | NO | PRI | NULL | auto_increment | |
|
||||
| uuid | varchar(255) | NO | UNI | NULL | | |
|
||||
| connection | text | NO | | NULL | | |
|
||||
| queue | text | NO | | NULL | | |
|
||||
| payload | longtext | NO | | NULL | | |
|
||||
| exception | longtext | NO | | NULL | | |
|
||||
| failed_at | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED | |
|
||||
|
||||
---
|
||||
|
||||
## job_batches
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | varchar(255) | NO | PRI | NULL | | |
|
||||
| name | varchar(255) | NO | | NULL | | |
|
||||
| total_jobs | int | NO | | NULL | | |
|
||||
| pending_jobs | int | NO | | NULL | | |
|
||||
| failed_jobs | int | NO | | NULL | | |
|
||||
| failed_job_ids | longtext | NO | | NULL | | |
|
||||
| options | mediumtext | YES | | NULL | | |
|
||||
| cancelled_at | int | YES | | NULL | | |
|
||||
| created_at | int | NO | | NULL | | |
|
||||
| finished_at | int | YES | | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## jobs
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | bigint unsigned | NO | PRI | NULL | auto_increment | |
|
||||
| queue | varchar(255) | NO | MUL | NULL | | |
|
||||
| payload | longtext | NO | | NULL | | |
|
||||
| attempts | tinyint unsigned | NO | | NULL | | |
|
||||
| reserved_at | int unsigned | YES | | NULL | | |
|
||||
| available_at | int unsigned | NO | | NULL | | |
|
||||
| created_at | int unsigned | NO | | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## migrations
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | int unsigned | NO | PRI | NULL | auto_increment | |
|
||||
| migration | varchar(255) | NO | | NULL | | |
|
||||
| batch | int | NO | | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## nova_field_attachments
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | int unsigned | NO | PRI | NULL | auto_increment | |
|
||||
| attachable_type | varchar(255) | NO | MUL | NULL | | |
|
||||
| attachable_id | bigint unsigned | NO | | NULL | | |
|
||||
| attachment | varchar(255) | NO | | NULL | | |
|
||||
| disk | varchar(255) | NO | | NULL | | |
|
||||
| url | varchar(255) | NO | MUL | NULL | | |
|
||||
| created_at | timestamp | YES | | NULL | | |
|
||||
| updated_at | timestamp | YES | | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## nova_notifications
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | char(36) | NO | PRI | NULL | | |
|
||||
| type | varchar(255) | NO | | NULL | | |
|
||||
| notifiable_type | varchar(255) | NO | MUL | NULL | | |
|
||||
| notifiable_id | bigint unsigned | NO | | NULL | | |
|
||||
| data | text | NO | | NULL | | |
|
||||
| read_at | timestamp | YES | | NULL | | |
|
||||
| created_at | timestamp | YES | | NULL | | |
|
||||
| updated_at | timestamp | YES | | NULL | | |
|
||||
| deleted_at | timestamp | YES | | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## nova_pending_field_attachments
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | int unsigned | NO | PRI | NULL | auto_increment | |
|
||||
| draft_id | varchar(255) | NO | MUL | NULL | | |
|
||||
| attachment | varchar(255) | NO | | NULL | | |
|
||||
| disk | varchar(255) | NO | | NULL | | |
|
||||
| created_at | timestamp | YES | | NULL | | |
|
||||
| updated_at | timestamp | YES | | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## password_reset_tokens
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| email | varchar(255) | NO | PRI | NULL | | |
|
||||
| token | varchar(255) | NO | | NULL | | |
|
||||
| created_at | timestamp | YES | | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## sessions
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | varchar(255) | NO | PRI | NULL | | |
|
||||
| user_id | bigint unsigned | YES | MUL | NULL | | |
|
||||
| ip_address | varchar(45) | YES | | NULL | | |
|
||||
| user_agent | text | YES | | NULL | | |
|
||||
| payload | longtext | NO | | NULL | | |
|
||||
| last_activity | int | NO | MUL | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
## users
|
||||
|
||||
| Field | Type | Null | Key | Default | Extra | Foreign Key |
|
||||
|-------|------|------|-----|---------|-------|-------------|
|
||||
| id | bigint unsigned | NO | PRI | NULL | auto_increment | |
|
||||
| name | varchar(255) | NO | | NULL | | |
|
||||
| email | varchar(255) | NO | UNI | NULL | | |
|
||||
| email_verified_at | timestamp | YES | | NULL | | |
|
||||
| password | varchar(255) | NO | | NULL | | |
|
||||
| two_factor_secret | text | YES | | NULL | | |
|
||||
| two_factor_recovery_codes | text | YES | | NULL | | |
|
||||
| two_factor_confirmed_at | timestamp | YES | | NULL | | |
|
||||
| remember_token | varchar(100) | YES | | NULL | | |
|
||||
| created_at | timestamp | YES | | NULL | | |
|
||||
| updated_at | timestamp | YES | | NULL | | |
|
||||
|
||||
---
|
||||
|
||||
20
database/seeders/DatabaseSeeder.php
Normal file
20
database/seeders/DatabaseSeeder.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
use WithoutModelEvents;
|
||||
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$this->call(JonathanSeeder::class);
|
||||
}
|
||||
}
|
||||
22
database/seeders/JonathanSeeder.php
Normal file
22
database/seeders/JonathanSeeder.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class JonathanSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
User::factory()->create([
|
||||
'name' => 'Jonathan',
|
||||
'email' => 'jonathan@blijnder.nl',
|
||||
'password' => bcrypt('secret'),
|
||||
'email_verified_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user