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);
}
}