-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from HE-Arc/dev
Toggle button in timeline creation form, link to registration in login
- Loading branch information
Showing
7 changed files
with
61 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,22 +17,14 @@ public function run(): void | |
{ | ||
// User::factory(10)->create(); | ||
|
||
DB::table('users')->truncate(); | ||
|
||
User::factory()->create([ | ||
'name' => 'Test User', | ||
'email' => '[email protected]', | ||
'password' => '12345' | ||
]); | ||
|
||
|
||
DB::table('timelines')->insert([ | ||
'name' => "Timeline number one", | ||
'private' => false, | ||
'description' => "an important timeline", | ||
]); | ||
DB::table('timelines')->insert([ | ||
'name' => "Anne's timeline", | ||
'private' => true, | ||
'description' => "Only for Anne's friends", | ||
]); | ||
$this->call(TimelineSeeder::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use App\Models\Timeline; | ||
use Illuminate\Database\Console\Seeds\WithoutModelEvents; | ||
use Illuminate\Database\Seeder; | ||
|
||
class TimelineSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
*/ | ||
public function run(): void | ||
{ | ||
Timeline::truncate(); | ||
|
||
$timelines = [ | ||
['name' => "Timeline number one", 'private' => false, 'description' => "an important timeline"], | ||
['name' => "Anne's timeline", 'private' => true, 'description' => "Only for Anne's friends"], | ||
]; | ||
|
||
foreach ($timelines as $timeline) { | ||
Timeline::create(array( | ||
'name' => $timeline['name'], | ||
'private' => $timeline['private'], | ||
'description' => $timeline['description'] | ||
)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters