<?php

namespace App\Http\Controllers;

use App\CheckinCredits;
use App\FriendsCredits;
use App\VideoadCredits;
use Illuminate\Http\Request;


use App\User;

use App\setting;
class AddedUsersController extends Controller
{
    public function index(){
        $user    = User::get();
        $setting = setting::get();
        $checkin = CheckinCredits::first();
        $videoad = VideoadCredits::first();
        $friends = FriendsCredits::first();
        
        return view('users.user', compact('user', 'checkin', 'videoad', 'friends','setting'));
    }

    public function destroy(Request $request, $id){
        $user_delete = User::where('id', $id)->first();
        $user_delete->delete();

        return back()->withStatus('User Deleted Successfully');
    }
}
