예제 #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $number = $this->ask('Enter Room Number');
     $units = new Units();
     $units->number = $number;
     $units->save();
     $this->info('Success!');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make(Input::all(), Units::$rules);
     if ($validator->passes()) {
         $type = new Units();
         $type->name = Input::get('name');
         $type->save();
         return Redirect::route('units.index')->with('success', 'Unit created successfully');
     } else {
         return Redirect::route('units.create')->withErrors($validator)->withInput(Input::all());
     }
 }