예제 #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $prefixes = [1 => 'Продам', 2 => 'Куплю', 3 => 'Меняю', 4 => 'Предложение', 5 => 'Спрос'];
     foreach ($prefixes as $id => $title) {
         Prefix::create(['id' => $id, 'title' => $title]);
     }
 }
예제 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $record = Prefix::find($id);
     $record->delete();
     Session::flash('message', "Record deleted");
     return Redirect::to('/prefix');
 }
예제 #3
0
 public function run()
 {
     DB::table('prefixes')->delete();
     Prefix::create(array('title' => 'Mr.', 'user_id' => 1));
     Prefix::create(array('title' => 'Mrs.', 'user_id' => 1));
 }