HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: /var/www/javago-portal-updates/app/Http/Controllers/Cafe/SignupController.php
<?php

namespace App\Http\Controllers\Cafe;

use App\Http\Controllers\Controller;
use App\Http\Requests\SignupCafeRequest;
use App\Models\Cafe;
use App\Services\SignupService;
use Illuminate\Support\Facades\Auth;

class SignupController extends Controller
{
    private $signupService;

    // public function __construct(SignupService $signupService)
    public function __construct()
    {
        // use guard as per role
        $this->middleware('guest:cafe')->except('logout');
        $this->signupService = new SignupService(Cafe::class);
    }

    public function showSignupForm($id = null)
    {
        return $this->signupService->showSignupForm($id);
    }

    protected function guard()
    {
        // use guard as per role
        return Auth::guard('cafe');
    }

    public function signup(SignupCafeRequest $request, $id = null)
    {
        return $this->signupService->signup($request, $id);
    }

    public function signupWithoutApproval(SignupCafeRequest $request, $id = null)
    {
        return $this->signupService->signupWithoutApproval($request, $id);
    }
}