コード例 #1
0
 public function run()
 {
     //DB::table('forsidas')->delete();
     Forsida::create(['frettdagsins' => 'ekkert i dag']);
     User::create(['username' => 'administrator', 'password' => bcrypt('root123'), 'email' => '*****@*****.**', 'profilephoto' => '/images/Administrator.jpg', 'firstname' => 'Alfa']);
     User::create(['username' => 'administrator2', 'password' => bcrypt('root1234'), 'email' => '*****@*****.**', 'profilephoto' => '/images/Administrator.jpg', 'firstname' => 'Alfa']);
 }
コード例 #2
0
 public function frettin()
 {
     $input = Request::all();
     $frettedit = Forsida::get()->where('id', 1)->first();
     /*if(count($input) == 4)
     			{
     				$image_name = Request::file('photo')->getClientOriginalName();
     				$inputt = Request::file('photo')->move(base_path().'/public/images/frettir', $image_name);
     				$post = (Request::except(['photo']));
     				$post['photo'] = $image_name;
     				$pathToFile = '/images/frettir/' . $post['photo'];
     
     				$frettedit->frettmynd = $pathToFile;
     				$frettedit->frettdagsins = $input['frettinn'];
     
     			}
     			else*/
     $frettedit = Forsida::get()->where('id', 1)->first();
     $frettedit->frettdagsins = $input['frettinn'];
     $frettedit->save();
     return redirect()->back();
 }