mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-27 16:24:24 +00:00
Commit although could not run on localhost
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?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'));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user