jeffgreco13 / filament-breezy

MIT License
649 stars 121 forks source link

How can I change the navigation page icon? #354

Open Maru-Yasa opened 3 months ago

Maru-Yasa commented 3 months ago

I can't figure out how to change navigation page icon

image

krognome commented 2 months ago

Yes I would love this to but I do not believe the programmer set any option for this

krognome commented 2 months ago

Since everyone has to been careless to answer this I will since i finally found something that works (plus this answer would have saved me a decent amount of time). After you publish the assets for this package you may edit: resources/views/vendor/filament-breezy/filament/pages/my-profile.blade.php. This is the code that is working for me:

@php self::$navigationIcon = 'healthicons-f-ui-user-profile'; // <----- THIS IS IT @endphp
@foreach ($this->getRegisteredMyProfileComponents() as $component) @unless(is_null($component)) @livewire($component) @endunless @endforeach
krognome commented 2 months ago

Since everyone has to been careless to answer this I will since i finally found something that works (plus this answer would have saved me a decent amount of time). After you publish the assets for this package you may edit: resources/views/vendor/filament-breezy/filament/pages/my-profile.blade.php. This is the code that is working for me:

x-filament::page @php self::$navigationIcon = 'healthicons-f-ui-user-profile'; // <----- THIS IS IT @endphp

@foreach ($this->getRegisteredMyProfileComponents() as $component) @unless(is_null($component)) @livewire($component) @endunless @Endforeach

</x-filament::page>

Well shit dang if you are not on the my profile page this code does not work :'( finding better solution now....

krognome commented 2 months ago

OK now I have the right answer which is not in the documentation at all! What I did was:

  1. Open /var/www/vendor/jeffgreco13/filament-breezy/src/Pages/MyProfilePage.php
  2. save As: /var/www/app/Filament/Pages/MyProfilePage.php
  3. change the icon in the code on that page.
  4. Add this to you panel provider where you do the make for this package: ->customMyProfilePage(\App\Filament\Pages\MyProfilePage::class)

This worked well for me and costed me hours of work. I appreciate the package but it sucks when something so little cost so much time.

krognome commented 2 months ago

Oh hey guys please note: you will have to update the namespace on the file that you save as in Step 1 and 2 above to: namespace App\Filament\Pages;

Uhasith commented 1 month ago

Create New Page => App\Filament\Pages\MyProfileCustomPage.php Then extend MyProfilePage from FilamentBreezy package.

Overide the icon as you need and you are Good to Go.

<?php

namespace App\Filament\Pages;

use Jeffgreco13\FilamentBreezy\Pages\MyProfilePage;

class MyProfileCustomPage extends MyProfilePage
{
    protected static ?string $navigationIcon = 'heroicon-s-cog-6-tooth';
}
LeandroBerlin commented 4 weeks ago

If you want to change the Profile icon:

<?php

namespace App\Filament\Pages;

use Jeffgreco13\FilamentBreezy\Pages\MyProfilePage;

class MyProfileCustomPage extends MyProfilePage
{
    protected static ?string $navigationIcon = 'heroicon-o-user';
}
BreezyCore::make()->myProfile(
                        shouldRegisterUserMenu: true,
                        shouldRegisterNavigation: true,
                        navigationGroup: 'Your Profile',
                        hasAvatars: true,
                        slug: 'profile'
                    )
                    ->customMyProfilePage(\App\Filament\Pages\MyProfileCustomPage::class)

profile-icon