Merge branch 'master' of https://github.com/sebathefox/skolehjem-webapp
This commit is contained in:
commit
22c578bc4b
|
@ -41,8 +41,13 @@ class MenuPlanController extends Controller
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$requestMenuPlanCreate = $request->validate([
|
$requestMenuPlanCreate = $request->validate([
|
||||||
"name" => "required|max:255",
|
"monday" => "required|max:255",
|
||||||
"link" => "required|max:255"
|
"tuesday" => "required|max:255",
|
||||||
|
"wednesday" => "required|max:255",
|
||||||
|
"thursday" => "required|max:255",
|
||||||
|
"friday" => "required|max:255",
|
||||||
|
"saturday" => "required|max:255",
|
||||||
|
"sunday" => "required|max:255"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$menuPlans = new MenuPlan($requestMenuPlanCreate);
|
$menuPlans = new MenuPlan($requestMenuPlanCreate);
|
||||||
|
@ -59,7 +64,7 @@ class MenuPlanController extends Controller
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
return Response::detect("menu-plan.show", [ "menu-plans" => $id]);
|
return Response::detect("menuplan.show", [ "menuplans" => $id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,7 +76,7 @@ class MenuPlanController extends Controller
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$editLink = MenuPlan::find($id);
|
$editLink = MenuPlan::find($id);
|
||||||
return Response::detect("menu-plans.edit", ["menu-plans" => $editLink]);
|
return Response::detect("menuplans.edit", ["menu-plans" => $editLink]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,7 +96,7 @@ class MenuPlanController extends Controller
|
||||||
$id->update($data);
|
$id->update($data);
|
||||||
$id->save();
|
$id->save();
|
||||||
|
|
||||||
return Response::detect("menu-plans.update");
|
return Response::detect("menuplans.update");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,6 +108,6 @@ class MenuPlanController extends Controller
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
$id->delete();
|
$id->delete();
|
||||||
return Response::detect("menu-plans.destroy");
|
return Response::detect("menuplans.destroy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,5 +6,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class MenuPlan extends Model
|
class MenuPlan extends Model
|
||||||
{
|
{
|
||||||
//
|
protected $fillable = [
|
||||||
|
'monday', "tuesday", 'wednesday', 'thursday', "friday", "saturday", "sunday"
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,15 @@ class CreateMenuPlans extends Migration
|
||||||
{
|
{
|
||||||
Schema::create('menu_plans', function (Blueprint $table) {
|
Schema::create('menu_plans', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
$table->string('monday', 255);
|
||||||
|
$table->string('tuesday', 255);
|
||||||
|
$table->string('wednesday', 255);
|
||||||
|
$table->string('thursday', 255);
|
||||||
|
$table->string('friday', 255);
|
||||||
|
$table->string('saturday', 255);
|
||||||
|
$table->string('sunday', 255);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
//$table->text('description');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,20 +13,20 @@
|
||||||
<h1>Opret Menuplan:</h1>
|
<h1>Opret Menuplan:</h1>
|
||||||
<form action="{{ action('MenuPlanController@store') }}" method="post">
|
<form action="{{ action('MenuPlanController@store') }}" method="post">
|
||||||
@csrf
|
@csrf
|
||||||
<label for="mandag">Mandag:</label>
|
<label for="monday">Mandag:</label>
|
||||||
<input type="text" name="mandag" id="mandag" required>
|
<input type="text" name="monday" id="monday" required>
|
||||||
<label for="tirsdag">Tirsdag:</label>
|
<label for="tuesday">Tirsdag:</label>
|
||||||
<input type="text" name="tirsdag" id="tirsdag" required>
|
<input type="text" name="tuesday" id="tuesday" required>
|
||||||
<label for="onsdag">Onsdag:</label>
|
<label for="wednesday">Onsdag:</label>
|
||||||
<input type="text" name="onsdag" id="onsdag" required>
|
<input type="text" name="wednesday" id="wednesday" required>
|
||||||
<label for="torsdag">Torsdag:</label>
|
<label for="thursday">Torsdag:</label>
|
||||||
<input type="text" name="torsdag" id="torsdag" required>
|
<input type="text" name="thursday" id="thursday" required>
|
||||||
<label for="fredag">Fredag:</label>
|
<label for="friday">Fredag:</label>
|
||||||
<input type="text" name="fredag" id="fredag" required>
|
<input type="text" name="friday" id="friday" required>
|
||||||
<label for="lørdag">Lørdag:</label>
|
<label for="saturday">Lørdag:</label>
|
||||||
<input type="text" name="lørdag" id="lørdag" required>
|
<input type="text" name="saturday" id="saturday" required>
|
||||||
<label for="søndag">Søndag:</label>
|
<label for="sunday">Søndag:</label>
|
||||||
<input type="text" name="søndag" id="søndag" required>
|
<input type="text" name="sunday" id="sunday" required>
|
||||||
|
|
||||||
<input type="submit" class="btn btn-dark text-white" value="Opret Menuplan">
|
<input type="submit" class="btn btn-dark text-white" value="Opret Menuplan">
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -24,13 +24,13 @@
|
||||||
</tr>
|
</tr>
|
||||||
@foreach($menuPlans as $menuplan)
|
@foreach($menuPlans as $menuplan)
|
||||||
<tr>
|
<tr>
|
||||||
<th>{Mandag}</th>
|
<th>{{$menuplan->monday}}</th>
|
||||||
<th>{Tirsdag}</th>
|
<th>{{$menuplan->tuesday}}</th>
|
||||||
<th>{Onsdag}</th>
|
<th>{{$menuplan->wednesday}}</th>
|
||||||
<th>{Torsdag}</th>
|
<th>{{$menuplan->thursday}}</th>
|
||||||
<th>{Fredag}</th>
|
<th>{{$menuplan->friday}}</th>
|
||||||
<th>{Lørdag}</th>
|
<th>{{$menuplan->saturday}}</th>
|
||||||
<th>{Søndag}</th>
|
<th>{{$menuplan->sunday}}</th>
|
||||||
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||||
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td>
|
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue