public function make(Request $request)
 {
     if (!$request->has('title') || !$request->has('description') || !$request->has('noOfPeople') || !$request->has('noOfDays') || !$request->has('budget') || !$request->has('start_date') || !$request->has('end_date')) {
         return view('error')->with('error', 'Please provide all the fields.');
     }
     $task = new \App\Task();
     $input = $request->all();
     $task->employer_id = \Auth::id();
     $task->title = $input['title'];
     $task->description = $input['description'];
     $task->noOfPeople = $input['noOfPeople'];
     $task->noOfDays = $input['noOfDays'];
     $task->budget = $input['budget'];
     $task->start_date = $input['start_date'];
     $task->end_date = $input['end_date'];
     $task->preferred_gender = $input['preferred_gender'];
     $task->workFromHome = $input['workFromHome'];
     if (isset($input['min_age'])) {
         $task->min_age = $input['min_age'];
     }
     if (isset($input['max_age'])) {
         $task->max_age = $input['max_age'];
     }
     $task->save();
     // return response()->json(['success' => $task->id]);
     return redirect('/tasks');
 }
Пример #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $tasks = [['title' => 'Garbage', 'slug' => 'garbage', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'daily', 'description' => "<li>Check the main kitchen garbage once a day.</li> " . "<li>If full, take the garbage out of the office immediately. Bring the garbage bag to the end of the corridor on the first floor near the men's washroom. The building will clear this area.</li>" . "<li>Every friday end of day, take out the garbage regardless of \"fullness\" level. This is to avoid odors building up over the weekend, especially in summer months.</li>" . "<li>Coordinate with the Fridge Cleaning task at the end of the week, and the Kitchen Supplies task if you run low on bags.</li>"], ['title' => 'Clean Small Kitchen Applicances', 'slug' => 'appliances', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'daily', 'description' => "<li>Clean the coffee machines every couple days. This involves WASHING all removable parts thoroughly and cleaning the machine itself with a rag or scott towel.</li> " . "<li>Please be careful with your choice of cleaning products and the quality of the rinsing as this may end up in someone's drink.</li>" . "<li>Clean the toaster oven once a week. If needed, change the aluminium foil at the bottom. Empty out all crumbs and scrub anything which has melted into the machine.</li>" . "<li>Clean the kettle once a week.</li>" . "<li>Wipe down the microwave inside and out.</li>"], ['title' => 'Clean and Clear the Boardroom', 'slug' => 'boardroom', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'daily', 'description' => "<li>Remove any items left behind after a meeting. The table should be clear of everything except the keyboard, mouse and conference phone.</li> " . "<li>Clean the surface of the table as needed. You may use the cleaning wipes kept in the kitchen area.</li>" . "<li>Return all chairs in their respective places, especially after the cleaners have come through.</li>" . "<li>Close down any programs which were used on the Mac Mini. Turn the TV off if it was left on.</li>" . "<li>Clean off the whiteboard if it was used. Check to make sure the information isn’t needed first if the meeting just ended.</li>"], ['title' => 'Empty the Dishwasher', 'slug' => 'dishes', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'daily', 'description' => "<li>Empty the dishwasher as soon as possible when you arrive in the morning.</li>"], ['title' => 'Empty the fridge', 'slug' => 'empty-fridge', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'Th Fr', 'description' => "<li>Toss all abandoned food, especially take-out containers.</li>" . "<li>Toss any empty containers (juice, etc..)</li>" . "<li>Check all other food items for expiry dates, toss anything which looks questionable.</li>" . "<li>Clean up any spills, especially in the door where most spills happen.</li>" . "<li>Move items around to make space for next week.</li>" . "<li>Any rotten food in a reusable container is to be tossed immediately, do not open it, this is not your responsibility.</li>"], ['title' => 'Water the plants', 'slug' => 'plants', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'twice a week', 'description' => "<li>Fill the green watering can with cold water and water every plant in the office.</li> " . "<li>Check every desk and corner of the office for small plants.</li>" . "<li>During the summer months, this must be done twice a week. For winter months, once a week is acceptable."], ['title' => 'Recycling', 'slug' => 'recycling', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'we', 'description' => "<li>Collect all recycling from the kitchen, keeping the \"returnables\" (soda cans, beer bottles = things worth money when returned) separate from the regular recycling.</li> " . "<li>Replace the bags, which are stored underneath the sink.</li>" . "<li>Empty all personal recycling bins found at each island. When possible, continue to separate the \"returnables\" from the paper, etc.." . "<li>Empty all shedder bins.</li>" . "<li>Be sure to check for random shipping boxes which were abandoned throughout the office. Make sure they don't contain anything important.</li>" . "<li>Bring all recycling you've collected down to street level on Ste Catherine. Pile them with the other recycling from other units (ex: Pharmaprix).</li>"], ['title' => 'Restock the fridge', 'slug' => 'restock-fridge', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'daily', 'description' => "<li>Keep a constant stock of all different types of drinks provided by Plank.</li> " . "<li>Coordinate with Steve or Colin once drinks stocks are low to have more ordered at their discretion.</li>" . "<li>Restocking should happen every morning in the summer months, and every couple days in the winter months."], ['title' => 'Clean and Clear the Sink', 'slug' => 'sink', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'daily', 'description' => "<li>Fill the dishwasher with any dishes left in the sink.</li> " . "<li>Once a week, wash the sink down with cleaning products or dish soap.</li>"], ['title' => 'Kitchen Counters', 'slug' => 'surfaces', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'daily', 'description' => "<li>Wipe down all counters in the kitchen. This includes the coffee station, and the kitchen table.</li> " . "<li>Should be done once a day. Most important around 1pm after everyone has finished lunch.</li>"], ['title' => 'Coffee & Cleaning supplies', 'slug' => 'supplies', 'reminder_time' => null, 'reminder_day' => null, 'timing' => 'daily', 'description' => "Colin will take care of any supply ordering which would come from Staples, example: paper supplies, printer ink toner, pens, pencils and so on.<br> " . "This task involves replenishing all stock related to the kitchen and is usually purchased from Pharmaprix downstairs.<br>" . "The office should maintain an abundance of the following items:<br>" . "<li>Coffee, ground (Melitta Traditional Premium Roast)</li>" . "<li>Milk (Skim, 2%, and Cream)</li>" . "<li>Blue recycling bags</li>" . "<li>Garbage bags (for the kitchen, 83L bags)</li>" . "<li>Kleenex boxes</li>" . "<li>Scott towels</li>" . "<li>Dish soap</li>" . "<li>Hand soap</li>" . "<li>Pads for the dish cleaning tool</li>" . "<li>Disinfectant wipes</li>" . "Buy these items as often as needed to keep a constant stock in the office. You are expected to pay for these items yourself. Keep your receipts and provide them to Colin for a full reimbursement. Place the receipts in the orange folder on Colin’s desk."]];
     foreach ($tasks as $str_task) {
         $task = new App\Task($str_task);
         $task->save();
     }
 }
Пример #3
0
 /**
  * Create fake task
  *
  * @return \App\Task
  */
 private function createFakeTask()
 {
     $faker = Faker\Factory::create();
     $task = new \App\Task();
     $task->name = $faker->sentence;
     $task->done = $faker->boolean;
     $task->priority = $faker->randomDigit;
     $task->save();
     return $task;
 }
Пример #4
0
 /**
  * Responds to requests to POST /tasks/add
  */
 public function postAddTask(Request $request)
 {
     $this->validate($request, ['description' => 'required|min:4', 'due' => 'required|integer|min:1']);
     $newtask = new \App\Task();
     $user = \Auth::user();
     $newtask->description = $request->description;
     $newtask->due = Carbon::now()->addDays($request->due);
     $newtask->save();
     $user->tasks()->save($newtask);
     \Session::flash('flash_message', 'Successfully added new task!');
     return redirect('/tasks');
 }
Пример #5
0
 public function create(Request $request)
 {
     $inputs = $request->only('name');
     if ($inputs['name'] == null) {
         return redirect('/');
     }
     $task = new \App\Task();
     $task->name = $inputs['name'];
     $task->is_complete = false;
     $task->save();
     return redirect('/');
 }
Пример #6
0
 public function postCreate(Request $request)
 {
     $this->validate($request, ['description' => 'required|max:500', 'year' => 'required', 'month' => 'required', 'day' => 'required']);
     $project_id = $request->project_id;
     $year = $request->year;
     $month = $request->month;
     $day = $request->day;
     $task = new \App\Task();
     $task->project_id = $project_id;
     $task->description = $request->description;
     $task->due_date = Carbon::createFromDate($year, $month, $day);
     $task->save();
     \Session::flash('flash_message', 'Your task was added!');
     return \Redirect::action('TasksController@getShow', array($project_id));
 }
Пример #7
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('tasks')->delete();
     $sampledata = ['Pospravi sobo', 'Pomij tla', 'Posesaj hodnik, kuhinjo in dnevno sobo', 'Poglej si Laravel', 'Pojdi v Ljubljano', 'Pomagaj sestri pri izbiri okrasitve'];
     foreach ($sampledata as $sample) {
         App\Task::create(['content' => $sample]);
     }
 }
Пример #8
0
 public function run()
 {
     factory(App\User::class, 30)->create();
     //->each(function($u) {});
     factory(App\Task::class, 20)->create();
     factory(App\Job::class, 3)->create();
     $tasks = App\Task::all();
     foreach ($tasks as $task) {
         $task->users()->sync($task->asignees);
         $task->task()->save($tasks->random()->first()->id);
     }
 }
Пример #9
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('tasks')->insert([['description' => 'Implement approved recommendations from the 2015 Public Computing Report', 'date' => Carbon::createFromDate(2016, 3, 1, 'America/Toronto'), 'collaborators' => 'IT Project Team', 'budget' => 1000, 'successMeasured' => 'Relevant recommendations have been implemented', 'progress' => 0, 'action_id' => 1, 'group' => 1, 'userId' => 1], ['description' => 'Upgrade LibOnline to the latest version (4.9)', 'date' => Carbon::createFromDate(2016, 1, 1, 'America/Toronto'), 'collaborators' => 'Active Networks', 'budget' => 500, 'successMeasured' => 'All PCs are upgraded to LibOnline 4.9', 'progress' => 0, 'action_id' => 1, 'group' => 1, 'userId' => 2], ['description' => 'Provide planning assistance to the Customer Payments team to implement the necessary changes to support a Fine Free day', 'date' => Carbon::createFromDate(2016, 3, 1, 'America/Toronto'), 'collaborators' => 'Fund Development, Audit Services', 'budget' => 4300, 'successMeasured' => 'Customer Payments team received assistance to implement changes to support a Fine Free day', 'progress' => 0, 'action_id' => 2, 'group' => 1, 'userId' => 2], ['description' => 'Aid in the selection, purchase, and configuration of equipment for the fourth literacy van', 'date' => Carbon::createFromDate(2016, 9, 9, 'America/Toronto'), 'collaborators' => 'Alex Carruthers, Elaine Jones', 'budget' => 4300, 'successMeasured' => 'Fourth literacy van equipment was purchased', 'progress' => 0, 'action_id' => 3, 'group' => 1, 'userId' => 1], ['description' => 'Get speaker for TED talk', 'date' => Carbon::createFromDate(2016, 8, 9, 'America/Toronto'), 'collaborators' => 'Alex Carruthers, Elaine Jones', 'budget' => 10000, 'successMeasured' => 'A speaker has agreed to speak at EPL', 'progress' => 0, 'action_id' => 9, 'group' => 2, 'userId' => 4], ['description' => 'Promote TED talk', 'date' => Carbon::createFromDate(2016, 8, 9, 'America/Toronto'), 'collaborators' => 'Alex Carruthers, Elaine Jones', 'budget' => 10000, 'successMeasured' => 'A speaker has agreed to speak at EPL', 'progress' => 0, 'action_id' => 9, 'group' => 3, 'userId' => 6], ['description' => 'Review Q3 financial status', 'date' => Carbon::createFromDate(2016, 7, 12, 'America/Toronto'), 'collaborators' => 'Purchasing', 'budget' => 150, 'successMeasured' => 'Q3 Financial Status section in document is completed', 'progress' => 0, 'action_id' => 10, 'group' => 5, 'userId' => 4], ['description' => 'Review Q4 financial status', 'date' => Carbon::createFromDate(2016, 7, 13, 'America/Toronto'), 'collaborators' => 'Purchasing', 'budget' => 150, 'successMeasured' => 'Q4 Financial Status section in document is completed', 'progress' => 0, 'action_id' => 10, 'group' => 5, 'userId' => 4], ['description' => 'Purchase VR kits', 'date' => Carbon::createFromDate(2016, 5, 12, 'America/Toronto'), 'collaborators' => 'Vicky Varga', 'budget' => 25000, 'successMeasured' => '10 VR units have been acquired', 'progress' => 1, 'action_id' => 11, 'group' => 7, 'userId' => 5], ['description' => 'Promote VR Event', 'date' => Carbon::createFromDate(2016, 4, 21, 'America/Toronto'), 'collaborators' => 'Vicky Varga', 'budget' => 10000, 'successMeasured' => '10 VR units have been acquired', 'progress' => 1, 'action_id' => 11, 'group' => 3, 'userId' => 5], ['description' => 'Create internal documentation for each profile (i.e. Early literacy and Mini-makerspace) applied to EPL iPads', 'date' => Carbon::createFromDate(2016, 6, 21, 'America/Toronto'), 'collaborators' => 'Purchasing, DLI', 'budget' => 4000, 'successMeasured' => 'Documentation is created and shared with the IT department', 'progress' => 0, 'action_id' => 17, 'group' => 1, 'userId' => 1], ['description' => 'Develop and implement an implementation plan for rolling EPL\'s Mobile Device Management tool out to all pre-existing kit iPads', 'date' => Carbon::createFromDate(2016, 7, 11, 'America/Toronto'), 'collaborators' => 'Volunteers', 'budget' => 5000, 'successMeasured' => 'MDM implemented on all kit laptops', 'progress' => 0, 'action_id' => 17, 'group' => 1, 'userId' => 1], ['description' => 'Complete a cost/benefit analysis of using EPL\'s MDM to secure manager iPads', 'date' => Carbon::createFromDate(2016, 7, 11, 'America/Toronto'), 'collaborators' => 'Volunteers', 'budget' => 3000, 'successMeasured' => 'Report Completed', 'progress' => 0, 'action_id' => 17, 'group' => 1, 'userId' => 1], ['description' => 'Develop a test plan to determine if EPL is ready to move to Windows 10', 'date' => Carbon::createFromDate(2016, 4, 11, 'America/Toronto'), 'collaborators' => 'Volunteers, DLI', 'budget' => 1200, 'successMeasured' => 'Test plan completed and recommendation forwarded', 'progress' => 1, 'action_id' => 18, 'group' => 1, 'userId' => 1], ['description' => 'Determine the budget implications of upgrading to Windows 10', 'date' => Carbon::createFromDate(2016, 4, 11, 'America/Toronto'), 'collaborators' => 'DLI, J McPhee', 'budget' => 100, 'successMeasured' => 'Analysis completed', 'progress' => 1, 'action_id' => 18, 'group' => 1, 'userId' => 1], ['description' => 'Develop a deployment/upgrade plan to migrate to Windows 10 if appropriate', 'date' => Carbon::createFromDate(2016, 4, 11, 'America/Toronto'), 'collaborators' => 'Project Team, Jody Crilly, Elaine Jones', 'budget' => 100, 'successMeasured' => 'Plan completed', 'progress' => 1, 'action_id' => 18, 'group' => 1, 'userId' => 1], ['description' => 'Order monitors, PCs, and laptops due for replacement in 2016', 'date' => Carbon::createFromDate(2016, 3, 31, 'America/Toronto'), 'collaborators' => 'Active Networks, Marketing', 'budget' => 40000, 'successMeasured' => 'Equipment ordered', 'progress' => 2, 'action_id' => 19, 'group' => 1, 'userId' => 1], ['description' => 'Replace 184 monitors ', 'date' => Carbon::createFromDate(2016, 3, 31, 'America/Toronto'), 'collaborators' => 'Fund Development, Active Networks', 'budget' => 20000, 'successMeasured' => 'Monitors deployed', 'progress' => 2, 'action_id' => 19, 'group' => 1, 'userId' => 1], ['description' => 'Replace 237 PCs', 'date' => Carbon::createFromDate(2016, 5, 31, 'America/Toronto'), 'collaborators' => 'Fund Development', 'budget' => 20000, 'successMeasured' => 'PCs deployed', 'progress' => 1, 'action_id' => 19, 'group' => 1, 'userId' => 1], ['description' => 'Replace 32 laptops', 'date' => Carbon::createFromDate(2016, 7, 31, 'America/Toronto'), 'collaborators' => 'DLI, Fund Development', 'budget' => 10000, 'successMeasured' => 'Laptops deployed', 'progress' => 0, 'action_id' => 19, 'group' => 1, 'userId' => 1], ['description' => 'Collaborate with DLI on how to expend the $5356 allocated for replacing aging sandbox devices', 'date' => Carbon::createFromDate(2016, 9, 31, 'America/Toronto'), 'collaborators' => 'DLI, Audit Services', 'budget' => 100, 'successMeasured' => 'Equipment selected and deployed', 'progress' => 0, 'action_id' => 19, 'group' => 1, 'userId' => 1], ['description' => 'Determine how to expend the $4848 allotted for projector upgrades in IT’s capital budget', 'date' => Carbon::createFromDate(2016, 10, 31, 'America/Toronto'), 'collaborators' => 'Purchasing, Fund Development', 'budget' => 100, 'successMeasured' => 'Equipment selected and deployed', 'progress' => 0, 'action_id' => 19, 'group' => 1, 'userId' => 1], ['description' => 'Support the ELF team\'s evaluation of the early literacy iPad pilot and purchase hardware to replace AWE\'s', 'date' => Carbon::createFromDate(2016, 4, 31, 'America/Toronto'), 'collaborators' => 'Project Team, Events Team', 'budget' => 235, 'successMeasured' => 'Hardware purchased and deployed', 'progress' => 1, 'action_id' => 20, 'group' => 1, 'userId' => 1], ['description' => 'Upgrade Minecraft EDU on the public PCs to match the version used on the kit laptops', 'date' => Carbon::createFromDate(2016, 2, 31, 'America/Toronto'), 'collaborators' => 'DLI, Active Networks', 'budget' => 5000, 'successMeasured' => 'Minecraft upgraded', 'progress' => 2, 'action_id' => 20, 'group' => 1, 'userId' => 1], ['description' => 'Complete configurations to allow access to gaming via Steam over WiFi', 'date' => Carbon::createFromDate(2016, 10, 31, 'America/Toronto'), 'collaborators' => 'DLI', 'budget' => 100, 'successMeasured' => 'Steam access allowed', 'progress' => 0, 'action_id' => 20, 'group' => 1, 'userId' => 1], ['description' => 'Provide support for DLI\'s League of Legends tournament pilot', 'date' => Carbon::createFromDate(2016, 8, 31, 'America/Toronto'), 'collaborators' => 'Audit Services', 'budget' => 4000, 'successMeasured' => 'Equipment selected and deployed', 'progress' => 0, 'action_id' => 20, 'group' => 1, 'userId' => 1]]);
     for ($j = 1; $j <= App\Action::All()->Count(); $j++) {
         global $act;
         $act = DB::table('actions')->where('id', $j)->first();
         for ($i = 1, $k = 1; $i <= App\Task::All()->Count(); $i++) {
             $task = DB::table('tasks')->where('id', $i)->first();
             if ($task->action_id == $act->id) {
                 DB::table('tasks')->where('id', $i)->update(array('ident' => $act->ident . '.' . $k));
                 $k++;
             }
         }
     }
 }
    'auth' => 'Auth\AuthController',
    'password' => 'Auth\PasswordController'
]);
interface BarInterface{}
class Baz{}
class Bar implements BarInterface{}

    App::bind('BarInterface' , 'bar');
Route::get('bar', function(BarInterface $bar){
    dd($bar);
});

Route::get('foo', 'FooController@foo');

Route::get('apitest/twitter/{message}' , 'ApiTestController@twitter');

Route::resource('users','UserController');
Route::get('user/profile','MemberController@profile');
Route::put('user/profile','MemberController@saveprofile');
*/
Route::model('tasks', 'Task');
Route::model('projects', 'Project');
// Use slugs rather than IDs in URLs
Route::bind('tasks', function ($value, $route) {
    return App\Task::whereSlug($value)->first();
});
Route::bind('projects', function ($value, $route) {
    return App\Project::whereSlug($value)->first();
});
Route::resource('projects', 'ProjectsController');
Route::resource('projects.tasks', 'TasksController');
Пример #11
0
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
    //
    Route::get('/', function () {
        $tasks = App\Task::orderBy('created_at', 'asc')->get();
        return view('task', ['tasks' => $tasks]);
    });
    Route::post('/task', function (\Illuminate\Http\Request $request) {
        $validator = Validator::make($request->all(), ['name' => 'required|max:255']);
        if ($validator->fails()) {
            return redirect('/')->withInput()->withErrors($validator);
        }
        App\Task::create($request->all());
        return redirect('/');
    });
});
Route::group(['middleware' => 'web'], function () {
    Route::auth();
    Route::get('tasks', 'TaskController@index');
    Route::post('task', 'TaskController@store');
    Route::delete('task/{task}', 'TaskController@destroy');
    Route::get('/home', 'HomeController@index');
});
Пример #12
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| 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::get('api/tasks', function () {
    $tasks = App\Task::latest()->get();
});
Route::get('/', function () {
    return view('welcome');
});
Route::resource('tasks', 'TaskController');
Route::get('tasks', 'TaskController@index');
Пример #13
0
 public function create()
 {
     $this->_methodName = 'create';
     $this->resolveParams();
     if ($this->checkAuth() && !Auth::checkAdmin()) {
         throw new \App\Exceptions\ExceptionApiMethodbad($this->_typeName, $this->_methodName, $this->_request_params);
     }
     $arNeed = ['name' => 'required', 'description' => 'required', 'score' => 'required|numeric', 'timer' => 'required', 'userAvailable' => 'required_without:userAll', 'userAll' => 'required_without:userAvailable|in:true,false'];
     $this->checkAttr($arNeed);
     $this->checkAuth();
     $this->checkAuthAdmin();
     $task = new \App\Task();
     $task->name = $this->_request_params['name'];
     $task->description = $this->_request_params['description'];
     $task->point = $this->_request_params['score'];
     $task->timer = $this->_request_params['timer'];
     $task->save();
     if (!isset($this->_request_params['userAvailable'])) {
         $users = \App\Users::all();
     } else {
         $userArray = explode(';', $this->_request_params['userAvailable']);
         $users = \App\Users::whereIn('id', $userArray)->get();
     }
     foreach ($users as $user) {
         $task_user = new \App\UserTask();
         $task_user->id_task = $task->id;
         $task_user->id_user = $user->id;
         $task_user->status = 'available';
         $task_user->save();
         $users_array[] = $user->email;
     }
     $MESSAGE = 'Added new task';
     $url = 'https://api.parse.com/1/push';
     $data = array('where' => ['email' => ['$in' => $users_array]], 'data' => array('alert' => $task->name, 'title' => $MESSAGE));
     $_data = json_encode($data);
     $headers = array('X-Parse-Application-Id: ' . $this->APPLICATION_ID, 'X-Parse-REST-API-Key: ' . $this->REST_API_KEY, 'Content-Type: application/json', 'Content-Length: ' . strlen($_data));
     $curl = curl_init($url);
     curl_setopt($curl, CURLOPT_POST, 1);
     curl_setopt($curl, CURLOPT_POSTFIELDS, $_data);
     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
     curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
     curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
     $response = curl_exec($curl);
     $this->_arData['data']['idTask'] = $task->id;
     return $this;
 }
Пример #14
0
 function get_task($company_id)
 {
     $map = ['company_id' => $company_id, 'is_finish' => 0];
     return App\Task::where($map)->count();
 }
Пример #15
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| 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::get('api/tasks', function () {
    return App\Task::latest()->get();
});
Route::get('/', function () {
    return view('welcome');
});
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     App\Task::truncate();
     factory(App\Task::class, 10)->create();
 }
Пример #17
0
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/
$factory->define(App\User::class, function (Faker\Generator $faker) {
    return ['username' => $faker->userName, 'name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt(str_random(10)), 'remember_token' => str_random(10)];
});
$factory->define(App\Task::class, function (Faker\Generator $faker) {
    $users = App\User::all()->lists('id')->all();
    return ['name' => $faker->realText(30), 'description' => $faker->realText(200), 'extra_info' => $faker->realText(200), 'date_expected' => $faker->dateTime('+ 1 month'), 'date_finished' => $faker->dateTime('+ 1 month'), 'duration_expected' => mt_rand(1, 16) * 15, 'duration_finished' => mt_rand(1, 16) * 15, 'done' => $faker->boolean(), 'status' => rand(0, 6), 'asignees' => $faker->randomElements($users, mt_rand(1, 11))];
});
$factory->define(App\Job::class, function (Faker\Generator $faker) {
    $users = App\User::all()->lists('id')->all();
    $tasks = App\Task::all()->lists('id')->all();
    $deliverables = array();
    for ($i = 0; $i < mt_rand(2, 7); $i++) {
        array_push($deliverables, 1);
    }
    $sessions = array();
    for ($i = 0; $i < mt_rand(2, 7); $i++) {
        array_push($sessions, 1);
    }
    $materials = array();
    for ($i = 0; $i < mt_rand(2, 7); $i++) {
        array_push($materials, 1);
    }
    $payments = array();
    for ($i = 0; $i < mt_rand(2, 7); $i++) {
        array_push($payments, 1);
Пример #18
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| 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::get('/', function () {
    return view('welcome');
});
/*
Route::bind('tasks', function($value, $route) {
	return App\Task::whereSlug($value)->first();
});
Route::bind('projects', function($value, $route) {
	return App\Project::whereSlug($value)->first();
});
*/
Route::bind('tasks', function ($value, $route) {
    return App\Task::find($value)->first();
});
Route::bind('projects', function ($value, $route) {
    return App\Project::find($value)->first();
});
Route::resource('projects', 'ProjectsController');
Route::resource('projects.tasks', 'TasksController');
Пример #19
0
 /**
  * Responds to requests to POST /tasks/create
  */
 public function postCreate(Request $request)
 {
     $this->validate($request, ['title' => 'required|min:5', 'detail' => 'required|min:5', 'status' => 'required|min:5']);
     # Enter task into the database
     $task = new \App\Task();
     $task->title = $request->title;
     $task->detail = $request->detail;
     $task->owner_id = $request->owner;
     $task->user_id = \Auth::id();
     $task->status = $request->status;
     $task->save();
     # Done
     \Session::flash('flash_message', 'Success! Your task was added.');
     \Session::flash('flash_type', 'alert-success');
     return redirect('/tasks');
     #return 'Process adding new task: '.$request->input('title');
 }
Пример #20
0
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| 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::get('/', 'WelcomeController@index');
Route::get('dashboard', 'PagesController@dashboard');
Route::get('login', 'PagesController@login');
Route::get('home', function () {
    if (Auth::guest()) {
        return Redirect::to('login');
    } else {
        return view('pages.dashboard')->with('users', App\User::all())->with('task_categories', App\TaskCategory::all())->with('tasks', App\Task::all())->with('companies', App\Company::all())->with('contracts', App\Contract::all())->with('solutions', App\Solution::all())->with('clients', App\Client::all())->with('employees', App\Employee::all());
    }
});
// model routes..
Route::post('tc/store', 'TaskCategoryController@store');
Route::post('tc/edit/{id}', array('uses' => 'TaskCategoryController@edit', 'as' => 'route.edit'));
Route::patch('tc/{id}', array('uses' => 'TaskCategoryController@update', 'as' => 'route.update'));
Route::delete('tc/{id}', array('uses' => 'TaskCategoryController@destroy', 'as' => 'route.destroy'));
Route::post('task/store', 'TaskController@store');
Route::post('task/edit/{id}', array('uses' => 'TaskController@edit', 'as' => 'task.edit'));
Route::post('task/approve/{id}', array('uses' => 'TaskController@approve', 'as' => 'task.approve'));
Route::patch('task/{id}', array('uses' => 'TaskController@update', 'as' => 'task.update'));
Route::delete('task/{id}', array('uses' => 'TaskController@destroy', 'as' => 'task.destroy'));
Route::post('client/store', 'ClientController@store');
Route::post('client/edit/{id}', array('uses' => 'ClientController@edit', 'as' => 'client.edit'));
Route::patch('client/{id}', array('uses' => 'ClientController@update', 'as' => 'client.update'));
Пример #21
0
| Here is where you can register all of the routes for an application.
| 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::get('/', 'PainelController@index');
// Authentication routes...
Route::get('auth/login', 'Auth\\AuthController@getLogin');
Route::post('auth/login', 'Auth\\AuthController@postLogin');
Route::get('auth/logout', 'Auth\\AuthController@getLogout');
// Registration routes...
Route::get('auth/register', 'Auth\\AuthController@getRegister');
Route::post('auth/register', 'Auth\\AuthController@postRegister');
Route::get('painel', 'PainelController@index');
Route::get('tasks/create', 'TasksController@create');
Route::get('tasks', 'TasksController@index');
Route::get('profile/edit/{id}', 'ProfileController@edit');
// Rotas para alterar senha
Route::get('profile/password', 'ProfileController@getPassword');
Route::post('profile/password', 'ProfileController@postPassword');
Route::model('tasks', 'Task');
Route::model('projects', 'Project');
Route::bind('tasks', function ($value, $route) {
    return App\Task::whereId($value)->first();
});
Route::bind('projects', function ($value, $route) {
    return App\Project::whereId($value)->first();
});
Route::resource('projects', 'ProjectsController');
Route::resource('projects.tasks', 'TasksController');
Route::resource('profile', 'ProfileController');
Пример #22
0
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| 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.
|
*/
//Skill Test
Route::get('total', function () {
    return view('total');
});
Route::get('api/total', function () {
    return App\Total::latest()->get();
});
Route::post('api/total', 'TotalController@store');
Route::delete('api/total/{id}', function ($id) {
    App\Total::findOrFail($id)->delete();
});
Route::put('api/update/{id}', 'TotalController@update');
/*add content to DB*/
Route::post('api/tasks', 'ApiController@store');
Route::get('api/tasks', function () {
    return App\Task::latest()->get();
});
Route::delete('api/tasks/{id}', function ($id) {
    App\Task::findOrFail($id)->delete();
});
Route::get('/', function () {
    return view('welcome');
});
Route::get('single', 'SingleController@index');