/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $projectdetails = ['name' => 'shitzu', 'description' => 'frickzena oah auhsdoh vgos'];
     $taskdetails = ['name' => 'joozie', 'description' => 'ahioihd poaiy7u ascihogyfcd pouaou'];
     $taskdetails2 = ['name' => 'ambroze', 'description' => 'shitzu prickzen la frickzen'];
     $statusdetails = ['message' => 'hello wazzup?'];
     DB::table('projects')->delete();
     DB::table('users_projects')->delete();
     DB::table('stories')->delete();
     DB::table('sprints')->delete();
     DB::table('backlogs')->delete();
     // optional
     DB::table('comments')->delete();
     DB::table('statuses')->delete();
     $user1 = User::firstOrFail();
     $user2 = User::all()->last();
     $project = Bus::dispatch(new CreateProject($user1, $projectdetails));
     Bus::dispatch(new AddUserToProject($user1, $project, $user2, 'developer'));
     $users = User::whereIn('id', [$user1->id, $user2->id])->get();
     $backlog = App\Backlog::create(['name' => 'Release Elixir']);
     $user1->backlogs()->save($backlog);
     $project->backlogs()->save($backlog);
     $sprint = App\Sprint::create(['name' => 'Sprint Shikku']);
     $project->sprints()->save($sprint);
     $backlog->sprints()->save($sprint);
     $user1->sprints()->save($sprint);
     $datas = [['name' => 'Refactoring Iceblocks', 'description' => 'Cool tasks are always cool. So do this !!', 'priority' => 1, 'work_hours' => '7'], ['name' => 'Streaming section', 'description' => 'This is one of the besttask ever i ve seen in my life time => )', 'priority' => 0, 'work_hours' => '2'], ['name' => 'Urgent Completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '8'], ['name' => 'Elangent Model shift', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 2, 'work_hours' => '5'], ['name' => 'Bug trakking system', 'description' => 'This task is for powerful people.. Yeah you..! ', 'priority' => 1, 'work_hours' => '2'], ['name' => 'Featured blog completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '6'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Smooth UI Design', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 2, 'work_hours' => '4'], ['name' => 'Refactoring Iceblocks', 'description' => 'Major refactor needed in the sublimentory section of zylanfuzku Masked version.Its all about the stuffs and stone of the rechard steven.', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Urgent Completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '8'], ['name' => 'Elangent Model shift', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 2, 'work_hours' => '5'], ['name' => 'Bug trakking system', 'description' => 'This task is for powerful people.. Yeah you..! ', 'priority' => 1, 'work_hours' => '2'], ['name' => 'Featured blog completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '6'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Smooth UI Design', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 2, 'work_hours' => '4'], ['name' => 'Refactoring Iceblocks', 'description' => 'Major refactor needed in the sublimentory section of zylanfuzku Masked version.Its all about the stuffs and stone of the rechard steven.', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Urgent Completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '8'], ['name' => 'Elangent Model shift', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 2, 'work_hours' => '5'], ['name' => 'Bug trakking system', 'description' => 'This task is for powerful people.. Yeah you..! ', 'priority' => 1, 'work_hours' => '2'], ['name' => 'Featured blog completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '6'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2']];
     foreach ($datas as $data) {
         $story = App\Story::create($data);
         $project->stories()->save($story);
         $user1->createdStories()->save($story);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     $limit = 40;
     for ($i = 0; $i < $limit; $i++) {
         $tag = DB::table('tags')->insert(['value' => $faker->text($maxNbChars = 10)]);
     }
     $stories = App\Story::get();
     foreach ($stories as $story) {
         $tag_id = rand(1, count(App\Tag::get()));
         DB::table('story_tag')->insert(['story_id' => $story->id, 'tag_id' => $tag_id]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     $faker = Faker\Factory::create();
     $limit = 20;
     for ($i = 0; $i < $limit; $i++) {
         echo $faker->city;
         for ($i = 0; $i < $limit; $i++) {
             DB::table('tags')->insert(['value' => $faker->word]);
         }
     }
     $stories = App\Story::get();
     foreach ($stories as $story) {
         $tag_id = $tag_id = rand(1, count(App\Tag::get()));
         DB::table('story_tag')->insert(['story_id' => $story->id, 'tag_id' => $tag_id]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     $limit = 20;
     for ($i = 0; $i < $limit; $i++) {
         //DB::table('tags')->insert([
         //'value' => $faker->word,
         //]);
     }
     $stories = App\Story::get();
     foreach ($stories as $story) {
         //attach 3 random tags to each story
         $numbers = range(1, 20);
         shuffle($numbers);
         $story->tags()->attach($numbers[0]);
         $story->tags()->attach($numbers[1]);
         $story->tags()->attach($numbers[2]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     /*
          //Run faker first and then add tags.  
     		$faker = Faker\Factory::create();
     		$limit = 20;
     		for($i=0;$i<$limit;$i++) {
     			DB::table('tags')->insert([//,
     				'value'=>$faker->word,
     			]);
     		}
     */
     $stories = App\Story::get();
     foreach ($stories as $story) {
         $tag = rand(1, 20);
         $tag2 = rand(1, 20);
         $tag3 = rand(1, 20);
         $story->tags()->attach($tag);
         $story->tags()->attach($tag2);
         $story->tags()->attach($tag3);
     }
 }
Пример #6
0
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
Route::model('projects', 'App\\Project');
Route::model('backlogs', 'App\\Backlog');
Route::model('sprints', 'App\\Sprint');
Route::model('story', 'App\\Story');
Route::model('users', 'App\\User');
Route::model('tasks', 'App\\Task');
Route::model('comments', 'App\\Comment');
Route::model('statuses', 'App\\Status');
Route::model('chats', 'App\\Chat');
Route::bind('stories', function ($value) {
    return App\Story::whereIn('id', explode(',', $value))->get();
});
Route::group(array('prefix' => 'api'), function () {
    Route::post('authenticate', 'AuthController@authenticate');
    Route::get('authenticate/user', 'AuthController@getAuthenticatedUser');
    Route::post('register', 'AuthController@register');
    // TODO changeto something else
    Route::get('authenticate/{user?}', 'AuthController@index');
    Route::group(['middleware' => 'jwt.auth'], function () {
        // HOME
        Route::resource('home', 'HomeController', ['only' => ['index']]);
        // ME : NOT SET
        Route::get('/me/backlogs', 'MeController@backlogs');
        Route::get('/me/bugreports', 'MeController@bugreports');
        Route::get('/me/documents', 'MeController@documents');
        Route::get('/me/forums', 'MeController@forums');