/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $programs = [['titleStrong' => 'Hotel & Casino Employee', 'title' => 'Home Assistance Program', 'secondHead' => NULL, 'bullet1' => 'For Hotel & Casino Employees and their families', 'bullet2' => 'Discounts offered for Hotel & Casino Employee selling their homes too!', 'disclaimerAdd' => NULL, 'slug' => 'hotel-casino-employee-home-assistance-program'], ['titleStrong' => 'Home Assistance Program', 'title' => 'offered to Cosmopolitan Employees', 'secondHead' => 'Presented by The Jacobs Group', 'bullet1' => 'For Team Members And Their Families', 'bullet2' => 'Discounts offered for Hotel & Casino Employee selling their homes too!', 'disclaimerAdd' => 'The program is for team members, but is not in any way represented by, associated with, or sponsored by the Cosmopolitan.', 'slug' => 'home-assistance-program-offered-to-cosmopolitan-employees'], ['titleStrong' => 'Las Vegas Incentive', 'title' => 'Home Assistance Program', 'secondHead' => NULL, 'bullet1' => ' For Las Vegas Hotel/Resort and Casino Professionals and their families', 'bullet2' => 'Discounts offered for Las Vegas employees selling their homes too!', 'disclaimerAdd' => NULL, 'slug' => 'las-vegas-incentive-home-assistance-program'], ['titleStrong' => 'Teachers', 'title' => 'Home Assistance Program', 'secondHead' => NULL, 'bullet1' => 'For Teachers and their families', 'bullet2' => 'Discounts offered for Teachers selling their homes too!', 'disclaimerAdd' => NULL, 'slug' => 'teachers-home-assistance-program'], ['titleStrong' => 'Clear Skies', 'title' => 'Housing Assistance Program', 'secondHead' => 'US Airways, Boeing, Southwest Airlines', 'bullet1' => 'For Airline team members and their families', 'bullet2' => 'Discounts offered for Airline employees selling their homes too!', 'disclaimerAdd' => 'The program is for team members, but is not in any way represented by, associated with, or sponsored by the Airlines.', 'slug' => 'clear-skies-housing-assistance-program'], ['titleStrong' => 'Doctor's Reward', 'title' => 'Home Assistance Program', 'secondHead' => NULL, 'bullet1' => 'For Doctor's and their families', 'bullet2' => 'Discounts offered for Doctor's selling their homes too!', 'disclaimerAdd' => NULL, 'slug' => 'doctor-s-reward-home-assistance-program'], ['titleStrong' => 'Nurses', 'title' => 'Home Assistance Program', 'secondHead' => NULL, 'bullet1' => 'For Nurses and their families', 'bullet2' => 'Discounts offered for Nurses selling their homes too!', 'disclaimerAdd' => NULL, 'slug' => 'nurses-home-assistance-program'], ['titleStrong' => 'Newlywed', 'title' => 'Home Assistance Program', 'secondHead' => NULL, 'bullet1' => 'For Newlyweds and their families', 'bullet2' => 'Discounts offered for Newlyweds selling their homes too!', 'disclaimerAdd' => NULL, 'slug' => 'newlywed-home-assistance-program']];
     foreach ($programs as $program) {
         $program = Program::create($program);
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     if (!Input::get('name')) {
         return $this->respondUnprocessableEntity('Parameters failed validation for a program.');
     }
     Program::create(Input::all());
     return $this->respondCreated('Program successfully created.');
 }
Exemplo n.º 3
0
 public function run()
 {
     // clear table
     DB::table('programs')->delete();
     // add 1st row
     Program::create(['name' => 'Hannah']);
     // add 2nd row
     Program::create(['name' => 'Silvia']);
     // add 3rd row
     Program::create(['name' => 'Naomi (M)']);
     // add 4th row
     Program::create(['name' => 'Naomi (W)']);
     // add 5th row
     Program::create(['name' => 'Outreach']);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $createData = $request->all();
     $createData['slug'] = CrudHelper::slugify($createData['titleStrong'] . ' ' . $createData['title']);
     $program = Program::create($createData);
     return redirect()->route('program.edit', $program['slug'])->with('success_message', 'New Program Added, next add your image and manage your ad');
 }