<commit_before><?php

namespace TypiCMS\Modules\Galleries\Composers;

use Illuminate\Contracts\View\View;
use Maatwebsite\Sidebar\SidebarGroup;
use Maatwebsite\Sidebar\SidebarItem;

class SidebarViewComposer
{
    public function compose(View $view)
    {
        $view->sidebar->group(trans('global.menus.media'), function (SidebarGroup $group) {
            $group->id = 'media';
            $group->weight = 40;
            $group->addItem(trans('galleries::global.name'), function (SidebarItem $item) {
                $item->icon = config('typicms.galleries.sidebar.icon', 'icon fa fa-fw fa-photo');
                $item->weight = config('typicms.galleries.sidebar.weight');
                $item->route('admin::index-galleries');
                $item->append('admin::create-galleries');
                $item->authorize(
                    auth()->user()->can('index-galleries')
                );
            });
        });
    }
}<commit_msg>Gate in place of auth<commit_after><?php

namespace TypiCMS\Modules\Galleries\Composers;

use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Gate;
use Maatwebsite\Sidebar\SidebarGroup;
use Maatwebsite\Sidebar\SidebarItem;

class SidebarViewComposer
{
    public function compose(View $view)
    {
        $view->sidebar->group(trans('global.menus.media'), function (SidebarGroup $group) {
            $group->id = 'media';
            $group->weight = 40;
            $group->addItem(trans('galleries::global.name'), function (SidebarItem $item) {
                $item->icon = config('typicms.galleries.sidebar.icon', 'icon fa fa-fw fa-photo');
                $item->weight = config('typicms.galleries.sidebar.weight');
                $item->route('admin::index-galleries');
                $item->append('admin::create-galleries');
                $item->authorize(
                    Gate::allows('index-galleries')
                );
            });
        });
    }
}
{'fraction_non_alphanumeric': 0.1500513874614594, 'fraction_numerical': 0.0020554984583761563, 'mean_word_length': 2.4038461538461537, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '959258', 'n_tokens_mistral': 597, 'n_tokens_neox': 564, 'n_words': 84}