public function __construct()
 {
     $popup = Popup::where('status', 1)->first();
     $head_cats = Category::where('type', HEADER_CAT)->where('status', 1)->get();
     $bottom_cats = Category::where('type', BOTTOM_CAT)->where('status', 1)->get();
     $top_navs = Category::where('type', TOP_NAV)->where('status', 1)->get();
     $weeks = Week::all();
     $clans = Clan::all();
     view()->share('popup', $popup);
     view()->share('weeks', $weeks);
     view()->share('head_cats', $head_cats);
     view()->share('bottom_cats', $bottom_cats);
     view()->share('top_navs', $top_navs);
     view()->share('clans', $clans);
 }
Exemple #2
0
 public static function current()
 {
     return WorkWheel::where('week_id', Week::getLatestID())->get();
 }
Exemple #3
0
 /**
  * The tasks this user has this week.
  *
  * @return \Illuminate\Database\Eloquent\Collection
  * @return boolean
  */
 public function currentTasks()
 {
     return $this->hasMany(WorkWheel::class)->where('week_id', Week::getLatestID())->pluck('task_id');
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Week::truncate();
     $data = [['name' => '2'], ['name' => '3'], ['name' => '4'], ['name' => '5'], ['name' => '6'], ['name' => '7'], ['name' => 'CN']];
     Week::insert($data);
 }
Exemple #5
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $event = DailyEvent::findOrFail($id);
     $weeks = Week::all();
     return view('admin.events.edit')->with(compact('event', 'weeks'));
 }
Exemple #6
0
 public static function getLatestID()
 {
     return Week::temporalOrder('desc')->first()->id;
 }
 public function getChangePassword()
 {
     $weeks = Week::all();
     return view('frontend.user.doimatkhau')->with('weeks', $weeks);
 }