mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
27 lines
790 B
PHP
27 lines
790 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Announcement;//call to announcement controller folder
|
|
use App\Http\Controllers\Controller;//call to controller class
|
|
use Carbon\Carbon;//call to carbon to return the current time with a Carbon instance
|
|
|
|
use App\Models\Announcement;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ViewAnnouncementsController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index()
|
|
{
|
|
//returns the page for this route
|
|
$announcements = Announcement::whereDate('start_date', '<=', Carbon::now())
|
|
->whereDate('end_date', '>=', Carbon::now())
|
|
->get();
|
|
return view('announcement.view_announcements', compact('announcements'));
|
|
}
|
|
|
|
}
|