Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 8, 2020
1 parent a279cdc commit 42ed0aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Http/Middleware/ShareInertiaData.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public function handle($request, $next)
Inertia::share(array_filter([
'jetstream' => function () use ($request) {
return [
'canCreateTeams' => $request->user() &&
Jetstream::hasTeamFeatures() &&
Gate::forUser($request->user())->authorize('create', Jetstream::newTeamModel()),
'canManageTwoFactorAuthentication' => Features::canManageTwoFactorAuthentication(),
'flash' => $request->session()->get('flash', []),
'hasApiFeatures' => Jetstream::hasApiFeatures(),
Expand All @@ -43,9 +46,6 @@ public function handle($request, $next)
'all_teams' => Jetstream::hasTeamFeatures() ? $request->user()->allTeams() : null,
]), [
'two_factor_enabled' => ! is_null($request->user()->two_factor_secret),
'can' => [
'create_team' => Jetstream::hasTeamFeatures() && Gate::forUser($user)->authorize('create', Jetstream::newTeamModel()),
],
]);
},
'errorBags' => function () {
Expand Down
2 changes: 1 addition & 1 deletion stubs/inertia/resources/js/Layouts/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
Team Settings
</jet-dropdown-link>

<jet-dropdown-link href="/teams/create" v-if="$page.user.can.create_team">
<jet-dropdown-link href="/teams/create" v-if="$page.jetstream.canCreateTeams">
Create New Team
</jet-dropdown-link>

Expand Down
6 changes: 3 additions & 3 deletions stubs/livewire/resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
</x-jet-dropdown-link>

@can('create', Laravel\Jetstream\Jetstream::newTeamModel())
<x-jet-dropdown-link href="/teams/create">
Create New Team
</x-jet-dropdown-link>
<x-jet-dropdown-link href="/teams/create">
Create New Team
</x-jet-dropdown-link>
@endcan

<div class="border-t border-gray-100"></div>
Expand Down

0 comments on commit 42ed0aa

Please sign in to comment.