Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public static function current()
 {
     return WorkWheel::where('week_id', Week::getLatestID())->get();
 }
Exemplo n.º 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');
 }
Exemplo n.º 4
0
 /**
  * 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);
 }
Exemplo n.º 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'));
 }
Exemplo n.º 6
0
 public static function getLatestID()
 {
     return Week::temporalOrder('desc')->first()->id;
 }
Exemplo n.º 7
0
 public function getChangePassword()
 {
     $weeks = Week::all();
     return view('frontend.user.doimatkhau')->with('weeks', $weeks);
 }