vanilophp / framework

The truly Laravel E-commerce Framework
https://vanilo.io
MIT License
812 stars 103 forks source link

I can't change default Menu #15

Closed thayronarrais closed 6 years ago

thayronarrais commented 6 years ago

I comment my code, but continuous showing for me in the admin, image CRM, Setting Group is hiding, but shop won't image where is "Shop" Item ?

fulopattila122 commented 6 years ago

Hi, I'm travelling at the moment, and I'll take a look into it tomorrow. The general approach is not to comment out menu items but to search and modify/remove them. Please refer to https://github.com/artkonekt/menu/blob/master/README.md

But I'll give you an example romorrow

fulopattila122 commented 6 years ago

Sorry for the long response, here's the solution:

  1. Update the menu component to v1.1 by running in your project folder: composer update konekt/menu
  2. Add this code to your application's AppServiceProvider boot method:
    $menu = \Menu::get('appshell');
    $menu->removeItem('shop');
    $menu->removeItem('crm');
    $menu->removeItem('settings');
  3. This will remove the menu items: image

Notes

Please also let me add some notes to the screenshots you posted:

Altering Packages

You should never edit files in the vendor/ directory. This applies to any composer package, but Vanilo was especially built with flexibility in mind, so you should be able to replace/modify/disable any part of it. In case not, please submit an issue, like this one :+1: :wink:

Translations

Vanilo, and all underlying components are prepared for translations, there's no need to modify the strings like: __('Configurações'). Actually the __() function is exactly for handling translations.

The basic idea is to:

  1. Create the file resources/lang/pt/messages.php
  2. Add the translations like this to it:
    
    <?php

return [ 'Settings' => 'Configurações', 'Customers' => 'Clientes', // etc ];


3. Set your language in `config/app.php`: `  'language' => 'pt',`

This is a built in Laravel facility, refer to the [documentation](https://laravel.com/docs/5.6/localization) for more details.
thayronarrais commented 6 years ago

thank you!

lucasres commented 4 years ago

@fulopattila122 how is path to override vanilo strings to translate?

i try resource/vendor/vanilo/pt/pt.php but without success

fulopattila122 commented 4 years ago

@mandala21 please open a new issue since this is more than two years old and not even related. I'll answer it there :)