mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
Ajout Plan de cours vierge
This commit is contained in:
@@ -26,23 +26,7 @@ class AdminController extends Controller
|
||||
{
|
||||
clog('navigate','success','consulte le tableau de bord');
|
||||
|
||||
$futureEvent_to_filtered = \App\Event::all()->sortBy('date_begin');
|
||||
$futureEvent_to_filtered_pass_1 = collect();
|
||||
$futureEvent = collect();
|
||||
|
||||
foreach ($futureEvent_to_filtered as $day) {
|
||||
if (date('U',strtotime($day->date_begin)) >= date('U')) {
|
||||
$futureEvent_to_filtered_pass_1->push($day);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($futureEvent_to_filtered_pass_1 as $day) {
|
||||
if (date('U',strtotime($day->date_begin)) <= date('U',strtotime("+2 week"))) {
|
||||
$futureEvent->push($day);
|
||||
}
|
||||
}
|
||||
|
||||
return view('admin.dashboard',['futureEvent' => $futureEvent->take(3),'userClasse' => \Auth::User()->getClasse()->forPage(1,6)]);
|
||||
return view('admin.dashboard',['futureEvent' => \App\Event::future()->take(3),'userClasse' => \Auth::User()->getClasse()->forPage(1,6)]);
|
||||
}
|
||||
|
||||
public function update()
|
||||
|
||||
13
app/User.php
13
app/User.php
@@ -75,6 +75,19 @@ class User extends Authenticatable
|
||||
return $this->hasMany('App\Course');
|
||||
}
|
||||
|
||||
public function futureCourses()
|
||||
{
|
||||
$filterCourse = collect();
|
||||
foreach (\Auth::user()->courses as $course)
|
||||
{
|
||||
if(date('U',strtotime($course->event->date_begin)) >= date('U'))
|
||||
{
|
||||
$filterCourse->push($course);
|
||||
}
|
||||
}
|
||||
return $filterCourse;
|
||||
}
|
||||
|
||||
public function routeNotificationForNexmo($notification)
|
||||
{
|
||||
return $this->telephone;
|
||||
|
||||
Reference in New Issue
Block a user