-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2da930a
commit 654420d
Showing
13 changed files
with
152 additions
and
32 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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
/** @var \Illuminate\Database\Eloquent\Factory $factory */ | ||
|
||
use App\Post; | ||
use Faker\Generator as Faker; | ||
use Illuminate\Support\Str; | ||
|
||
$factory->define(Post::class, function (Faker $faker) { | ||
return [ | ||
'user_id' => 1, | ||
'category_id'=> random_int(1,8), | ||
'title' => $faker->sentence($nbWords = 10, $variableNbWords = true), | ||
'slug' => Str::slug($faker->sentence($nbWords = 10, $variableNbWords = true)), | ||
'image' => 'laravel-wiki-5f92a8e71c7bc1603447015.jpg', | ||
'body' => $faker->paragraph($nbSentences = 20, $variableNbSentences = true), | ||
'view_count' => random_int(10,100), | ||
'status' => 1 | ||
]; | ||
}); |
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
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,64 @@ | ||
<?php | ||
|
||
use App\Category; | ||
use Illuminate\Database\Seeder; | ||
|
||
class CategoriesTableSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
Category::create([ | ||
'name' => 'HTML', | ||
'slug' => 'html', | ||
'description' => 'html', | ||
'image' => 'html.JPG', | ||
]); | ||
Category::create([ | ||
'name' => 'CSS', | ||
'slug' => 'css', | ||
'description' => 'css', | ||
'image' => 'css.JPG', | ||
]); | ||
Category::create([ | ||
'name' => 'Javascript', | ||
'slug' => 'javascript', | ||
'description' => 'javascript', | ||
'image' => 'javascript.JPG', | ||
]); | ||
Category::create([ | ||
'name' => 'GIS and Remote Sensing', | ||
'slug' => 'gis', | ||
'description' => 'gis', | ||
'image' => 'gis.JPG', | ||
]); | ||
Category::create([ | ||
'name' => 'Data Base', | ||
'slug' => 'mysql', | ||
'description' => 'mysql', | ||
'image' => 'mysql.JPG', | ||
]); | ||
Category::create([ | ||
'name' => 'Arduino', | ||
'slug' => 'arduino', | ||
'description' => 'arduino', | ||
'image' => 'arduino.JPG', | ||
]); | ||
Category::create([ | ||
'name' => 'Web Mapping', | ||
'slug' => 'webmapping', | ||
'description' => 'webmapping', | ||
'image' => 'webmapping.JPG', | ||
]); | ||
Category::create([ | ||
'name' => 'Web Designe', | ||
'slug' => 'webdesigne', | ||
'description' => 'webdesigne', | ||
'image' => 'webdesigne.JPG', | ||
]); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
use App\Post; | ||
use Illuminate\Database\Seeder; | ||
|
||
class PostsTableSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
$posts = factory(App\Post::class, 20)->create(); | ||
} | ||
} |
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