/** * Delete model by id * @param int $id * * @return Domain */ public function destroy($id) { $domain = $this->model->find($id); if ($domain) { $domain->delete(); } return $domain; }
/** * 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]); } }