Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.6 kB
1
Indexable
Never
      ->join('user_informations', 'members.id', 'user_informations.member_id')

            ->where('members.id', Session::get('id'))->first();

        $categories = Category::select('*', 'categories.title as c_title')->get();

        return view('user.generator.index', ['categories' => $categories, 'title' => "Account Generator", 'user' => $user]);

    }

 

    public function generate($slug, Request $request) {

        if (!session()->has("id"))

            return redirect('/generator?error=login');

        $user = DB::table('members')

            ->select('user_informations.group', 'members.id as m_id', 'members.premium')

            ->join('user_informations', 'members.id', 'user_informations.member_id')

            ->join('member_ads', 'members.id', 'member_ads.member_id')

            ->where('members.id', Session::get('id'))->first();

        if ($user->premium == 0) {

            if (explode('/', request()->headers->get('referer'))[3] == 'redirect?platform=' . $slug) {

                Session::put("redirect", 1);

            }

            if (!session()->has("redirect"))

                return redirect('/redirect?platform=' . $slug);

        }

        if (!session()->has("id"))

            return redirect('/generator?error=login');

        if (!session()->has("generate"))

            return redirect('/generator');

        if (session()->has("refresh")) {

            Session::pull("refresh");

            return redirect('/generator');

        }

        Session::pull("generate");

        Session::put("refresh", 1);