added minor changes
Cette révision appartient à :
Parent
3d22824a7f
révision
0ba5f6c309
@ -13,7 +13,7 @@ class EventController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$event = Event::get();
|
$event = Event::get();
|
||||||
$data = array();
|
$data = array();
|
||||||
if ($event) {
|
if ($event) {
|
||||||
foreach ($event as $e) {
|
foreach ($event as $e) {
|
||||||
@ -23,30 +23,32 @@ public function index()
|
|||||||
'description' => $e->description,
|
'description' => $e->description,
|
||||||
'image' => asset('public/uploads/event/' . $e->image),
|
'image' => asset('public/uploads/event/' . $e->image),
|
||||||
'location' => $e->location,
|
'location' => $e->location,
|
||||||
|
'topic' => $e->topic,
|
||||||
|
'goal' => $e->goal,
|
||||||
'hosted_by' => $e->hosted_by,
|
'hosted_by' => $e->hosted_by,
|
||||||
'date' => date("F j, l, Y", strtotime($e->date)),
|
'date' => date("F j, l, Y", strtotime($e->date)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return response($data, 200);
|
return response($data, 200);
|
||||||
}
|
}
|
||||||
public function single($id)
|
public function single($id)
|
||||||
{
|
{
|
||||||
$event = Event::find($id);
|
$event = Event::find($id);
|
||||||
$data = array();
|
$data = array();
|
||||||
if ($event) {
|
if ($event) {
|
||||||
$data = array(
|
$data = array(
|
||||||
'id' => $event->id,
|
'id' => $event->id,
|
||||||
'title' => $event->title,
|
'title' => $event->title,
|
||||||
'description' => $event->description,
|
'description' => $event->description,
|
||||||
'image' => asset('public/uploads/event/' . $event->image),
|
'image' => asset('public/uploads/event/' . $event->image),
|
||||||
'location' => $event->location,
|
'location' => $event->location,
|
||||||
'hosted_by' => $event->hosted_by,
|
'topic' => $event->topic,
|
||||||
'date' => date("d m, Y", strtotime($event->date)),
|
'goal' => $event->goal,
|
||||||
);
|
'hosted_by' => $event->hosted_by,
|
||||||
|
'date' => date("F j, l, Y", strtotime($event->date)),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return response($data, 200);
|
return response($data, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Chargement…
Référencer dans un nouveau ticket
Block a user