Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jun 7, 2024
2 parents 7797464 + a714ee4 commit bd92738
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion database/factories/PostFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Models\Author;
use App\Models\Post;
use Closure;
use Illuminate\Database\Eloquent\Factories\Factory;

class PostFactory extends Factory
Expand All @@ -27,6 +26,7 @@ public function configure()
return $this->afterCreating(function (Post $post) {
$tags = ['php', 'laravel', 'javascript'];


$post->attachTags(
$this->faker->randomElements($tags, faker()->numberBetween(1, 3))
);
Expand Down
3 changes: 1 addition & 2 deletions database/migrations/2024_06_06_121323_create_posts_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class () extends Migration {
public function up()
{
Schema::create('posts', function (Blueprint $table) {
Expand Down
3 changes: 1 addition & 2 deletions database/migrations/2024_06_06_122130_create_tag_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class () extends Migration {
public function up(): void
{
Schema::create('tags', function (Blueprint $table) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class () extends Migration {
public function up()
{
Schema::create('authors', function (Blueprint $table) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class () extends Migration {
public function up()
{
Schema::create('author_post', function (Blueprint $table) {
Expand Down

0 comments on commit bd92738

Please sign in to comment.