v1.5.17a Update to controller index
This commit is contained in:
@@ -33,9 +33,11 @@ class MultipleEventsController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
$multiEvents = MultipleEventsParent::query()->join("multiple_events", "multiple_events.multiple_events_parent_id", "=", "multiple_events_parent.id")->orderBY('multiple_events_parent.id' , 'desc')->get();
|
||||
return Response::detect("multiple-events.index", [ "multiEvents" => $multiEvents]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
@@ -64,6 +66,7 @@ class MultipleEventsController extends Controller
|
||||
"name.*" => "max:255",
|
||||
"description.*" => "max:255",
|
||||
"accountable.*" => "max:255",
|
||||
"date.*" => "max:255"
|
||||
]);
|
||||
|
||||
$multipleParent = new MultipleEventsParent();
|
||||
@@ -84,7 +87,7 @@ class MultipleEventsController extends Controller
|
||||
$multi_event->description = $requestBody['description'][$i];
|
||||
$multi_event->accountable = $requestBody['accountable'][$i];
|
||||
$multi_event->name = $requestBody['name'][$i];
|
||||
$multi_event->event_end = "2021-04-04 16:00:00";
|
||||
$multi_event->event_end = "2021-27-04 16:00:00";
|
||||
$multi_event->multiple_events_parent_id = $multipleParent->id;
|
||||
$multi_event->save();
|
||||
}
|
||||
@@ -105,7 +108,7 @@ class MultipleEventsController extends Controller
|
||||
|
||||
}
|
||||
|
||||
return redirect()->route('events.index');
|
||||
return redirect()->route('multiple-events.index', ['multiEvents' => $multiEvents]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user