Design Refresh
This commit is contained in:
parent
1dee7ae516
commit
e7202174f7
44 changed files with 593 additions and 228 deletions
|
|
@ -2,20 +2,19 @@
|
|||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\BookmarkCategory;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\BookmarkCategory>
|
||||
* @extends Factory<BookmarkCategory>
|
||||
*/
|
||||
class BookmarkCategoryFactory extends Factory
|
||||
{
|
||||
class BookmarkCategoryFactory extends Factory {
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
public function definition(): array {
|
||||
return [
|
||||
'name' => $this->faker->word,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,21 +2,20 @@
|
|||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\BookmarkSite;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use App\Models\BookmarkCategory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\BookmarkSite>
|
||||
* @extends Factory<BookmarkSite>
|
||||
*/
|
||||
class BookmarkSiteFactory extends Factory
|
||||
{
|
||||
class BookmarkSiteFactory extends Factory {
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
public function definition(): array {
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'description' => $this->faker->sentence,
|
||||
|
|
|
|||
35
database/factories/UserFactory.php
Normal file
35
database/factories/UserFactory.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||
*/
|
||||
class UserFactory extends Factory {
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array {
|
||||
return [
|
||||
'username' => fake()->userName(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // 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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ public function up(): void
|
|||
Schema::create('bookmark__categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->unsignedBigInteger('priority')->nullable();
|
||||
$table->boolean('shuffled');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,11 @@
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
public function up(): void {
|
||||
Schema::create('bookmark__sites', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
|
|
@ -28,8 +26,7 @@ public function up(): void
|
|||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
public function down(): void {
|
||||
Schema::dropIfExists('bookmarks');
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,20 +4,18 @@
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
public function up(): void {
|
||||
Schema::create('guestbook__entries', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('ip');
|
||||
$table->string('agent');
|
||||
$table->longText('message');
|
||||
$table->boolean('admin');
|
||||
$table->boolean('flagged');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
@ -25,8 +23,7 @@ public function up(): void
|
|||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
public function down(): void {
|
||||
Schema::dropIfExists('guestbook__entries');
|
||||
}
|
||||
};
|
||||
|
|
|
|||
29
database/migrations/2026_01_18_004639_create_users_table.php
Normal file
29
database/migrations/2026_01_18_004639_create_users_table.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?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('username');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void {
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
};
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\BookmarkCategory;
|
||||
use App\Models\BookmarkSite;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class BookmarkCategoriesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void {
|
||||
// BookmarkCategory::factory()->count(5)->create()->each(function ($category) {
|
||||
// $category->sites()->saveMany(BookmarkSite::factory()->count(3)->make());
|
||||
// });
|
||||
$category = new BookmarkCategory([
|
||||
'name' => 'cool people',
|
||||
]);
|
||||
$category->save();
|
||||
$site = new BookmarkSite([
|
||||
'name' => 'campos',
|
||||
'description' => 'Cool brazilian dude, does programming and stuff',
|
||||
'url' => 'https://campos02.me/',
|
||||
'category' => 1,
|
||||
]);
|
||||
$site->save();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue