refactor + fixes
This commit is contained in:
@@ -30,7 +30,7 @@ class Controller extends BaseController
|
||||
if (!is_cloud()) {
|
||||
abort(404);
|
||||
}
|
||||
return view('subscription.show', [
|
||||
return view('subscription.index', [
|
||||
'settings' => InstanceSettings::get(),
|
||||
]);
|
||||
}
|
||||
@@ -80,7 +80,7 @@ class Controller extends BaseController
|
||||
if (auth()->user()->isAdminFromSession()) {
|
||||
$invitations = TeamInvitation::whereTeamId(currentTeam()->id)->get();
|
||||
}
|
||||
return view('team.show', [
|
||||
return view('team.index', [
|
||||
'invitations' => $invitations,
|
||||
]);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ class Controller extends BaseController
|
||||
if ($diff <= config('constants.invitation.link.expiration')) {
|
||||
$user->teams()->attach($invitation->team->id, ['role' => $invitation->role]);
|
||||
$invitation->delete();
|
||||
return redirect()->route('team.show');
|
||||
return redirect()->route('team.index');
|
||||
} else {
|
||||
$invitation->delete();
|
||||
abort(401);
|
||||
@@ -151,7 +151,7 @@ class Controller extends BaseController
|
||||
abort(401);
|
||||
}
|
||||
$invitation->delete();
|
||||
return redirect()->route('team.show');
|
||||
return redirect()->route('team.index');
|
||||
} catch (Throwable $th) {
|
||||
throw $th;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class Kernel extends HttpKernel
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\App\Http\Middleware\CheckForcePasswordReset::class,
|
||||
\App\Http\Middleware\SubscriptionValid::class,
|
||||
\App\Http\Middleware\IsSubscriptionValid::class,
|
||||
\App\Http\Middleware\IsBoardingFlow::class,
|
||||
|
||||
],
|
||||
|
||||
@@ -49,7 +49,7 @@ class PricingPlans extends Component
|
||||
],
|
||||
'mode' => 'subscription',
|
||||
'success_url' => route('subscription.success'),
|
||||
'cancel_url' => route('subscription.show',['cancelled' => true]),
|
||||
'cancel_url' => route('subscription.index',['cancelled' => true]),
|
||||
];
|
||||
$customer = currentTeam()->subscription?->stripe_customer_id ?? null;
|
||||
if ($customer) {
|
||||
|
||||
@@ -30,7 +30,7 @@ class Create extends Component
|
||||
]);
|
||||
auth()->user()->teams()->attach($team, ['role' => 'admin']);
|
||||
refreshSession();
|
||||
return redirect()->route('team.show');
|
||||
return redirect()->route('team.index');
|
||||
} catch (\Throwable $th) {
|
||||
return general_error_handler($th, $this);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@ class Delete extends Component
|
||||
});
|
||||
|
||||
refreshSession();
|
||||
return redirect()->route('team.show');
|
||||
return redirect()->route('team.index');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ class Form extends Component
|
||||
try {
|
||||
$this->team->save();
|
||||
refreshSession();
|
||||
$this->emit('reloadWindow');
|
||||
} catch (\Throwable $th) {
|
||||
return general_error_handler($th, $this);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class SubscriptionValid
|
||||
class IsSubscriptionValid
|
||||
{
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
@@ -32,6 +32,7 @@ class User extends Authenticatable implements SendsEmail
|
||||
$team = [
|
||||
'name' => $user->name . "'s Team",
|
||||
'personal_team' => true,
|
||||
'boarding' => true
|
||||
];
|
||||
if ($user->id === 0) {
|
||||
$team['id'] = 0;
|
||||
|
||||
Reference in New Issue
Block a user