Ejemplo n.º 1
0
 public function store(ChartUnitRequest $request)
 {
     $file = $request->file('icon_path');
     if ($request->hasFile('icon_path') && $file->isValid()) {
         $file->move(public_path() . '/images/icons');
     }
     $chartUnit = ChartUnit::create($request->all());
     Session::flash('success', true);
     Session::flash('message', 'Aðgerð tókst: Ný mælieining');
     return Redirect::back();
 }
Ejemplo n.º 2
0
 public function edit($id)
 {
     $chart = Chart::findOrFail($id);
     $locations = Location::lists('name', 'id');
     $units = ChartUnit::lists('unit', 'id');
     $types = ChartType::lists('type', 'id');
     $auth = $chart->auth;
     $visible = $chart->visible;
     return view('partials.editChart', compact('chart', 'locations', 'units', 'types', 'auth', 'visible'));
 }