stripe = $stripe; } public function index() { // Get total users $total_users = User::all()->count(); // Get total used space $total_used_space = FileManagerFile::all()->map(function ($item) { return (int)$item->getRawOriginal('filesize'); })->sum(); // Get total premium users $total_premium_users = Subscription::where('stripe_status', 'active')->get()->count(); return [ 'app_version' => config('vuefilemanager.version'), 'total_users' => $total_users, 'total_used_space' => Metric::bytes($total_used_space)->format(), 'total_premium_users' => $total_premium_users, ]; } /** * Get the newest users * * @return UsersCollection */ public function new_registrations() { return new UsersCollection( User::take(5)->orderByDesc('created_at')->get() ); } }