コード例 #1
0
 /**
  * Delete model by id
  * @param int $id
  *
  * @return Domain
  */
 public function destroy($id)
 {
     $domain = $this->model->find($id);
     if ($domain) {
         $domain->delete();
     }
     return $domain;
 }
コード例 #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // Clear domain table
     DB::table('domains')->delete();
     $domains = ['Domainzter' => 'http://domainzter.com'];
     foreach ($domains as $domainTitle => $domainUrl) {
         Domain::create(['title' => $domainTitle, 'url' => $domainUrl]);
     }
 }