public function list_user() { $this->data['css_assets'] = Assets::load('css', ['admin_bootstrap', 'admin_css', 'font-awesome', 'skins', 'dataTables_css']); $this->data['js_assets'] = Assets::load('js', ['jquery', 'admin_js', 'admin_bootstrap-js', 'slimscroll', 'fastclick', 'dataTables_js', 'dataTables_bootsjs']); $this->data['title'] = 'User | List'; $this->data['user'] = User::all(); $this->data['userCount'] = User::all()->count(); return view('admin_layout')->with('data', $this->data)->nest('content', 'admin/user/user_list', array('data' => $this->data)); }
public function main_layout() { $this->data['css_assets'] = AppAssets::load('css', ['bootstrap', 'animate', 'font-awesome', 'icon', 'font', 'app']); $this->data['js_assets'] = AppAssets::load('js', ['jquery', 'bootstrap', 'app', 'jquery-slimscroll', 'app-plugin']); $this->data['title'] = 'Dashboard'; $this->data['member_count'] = User::all()->count(); $this->data['this_month'] = date('Y-m-d', strtotime('-1 Month')); $this->data['new_member_count'] = User::where(DB::raw('DATE(created_at)'), '>=', $this->data['this_month'])->count(); return view('app/components/main_layout')->with('data', $this->data)->nest('content', 'app/home/main', array('data' => $this->data)); }
public function addToDB($collect, $streams, $users) { // Images $collection = collect($collect); $tids = $this->formatCollection(Image::all(['tid'])); $filtered = $collection->filter(function ($item) use($tids) { return !in_array($item['tid'], $tids); }); Image::insert($filtered->toArray()); // Videos $collection = collect($streams); $tids = $this->formatCollection(Video::all(['tid'])); $filtered = $collection->filter(function ($item) use($tids) { return !in_array($item['tid'], $tids); }); Video::insert($filtered->toArray()); // Users $collection = collect($users); $usernames = array_map('strtolower', $this->formatCollection(User::all(['user']), true)); $filtered = $collection->filter(function ($item) use($usernames) { return !in_array(strtolower($item['user']), $usernames); }); User::insert($filtered->toArray()); }