示例#1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('time_entries')->delete();
     $time_entries = array(['user_id' => 1, 'start_time' => '2015-02-21T18:56:48Z', 'end_time' => '2015-02-21T20:33:10Z', 'comment' => 'Initial project setup.'], ['user_id' => 2, 'start_time' => '2015-02-27T10:22:42Z', 'end_time' => '2015-02-27T14:08:10Z', 'comment' => 'Review of project requirements and notes for getting started.'], ['user_id' => 3, 'start_time' => '2015-03-03T09:55:32Z', 'end_time' => '2015-03-03T12:07:09Z', 'comment' => 'Front-end and backend setup.']);
     foreach ($time_entries as $time_entry) {
         TimeEntries::create($time_entry);
     }
 }
示例#2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $timeentry = TimeEntries::find($id);
     $timeentry->delete();
 }