### Install laravel-favicon with Composer Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/resources/boost/skills/favicon-development/SKILL.md Install the laravel-favicon package via Composer. ```bash composer require jeffersongoncalves/laravel-favicon ``` -------------------------------- ### Run tests, coverage, phpstan, and pint Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/resources/boost/skills/favicon-development/SKILL.md Commands to run the test suite, coverage, static analysis, and code formatting for the package. ```bash # Run all tests vendor/bin/pest # Run with coverage vendor/bin/pest --coverage # Static analysis vendor/bin/phpstan analyse # Code formatting vendor/bin/pint ``` -------------------------------- ### Run tests with composer test Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/README.md Run the package's test suite. ```bash composer test ``` -------------------------------- ### Required icon asset files Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/README.md Expected file structure for icon assets under resources/favicon/. ```text resources/favicon/ android-icon-192x192.png favicon-32x32.png favicon-96x96.png favicon-16x16.png apple-icon-57x57.png ... apple-icon-180x180.png ms-icon-70x70.png ms-icon-144x144.png ms-icon-150x150.png ms-icon-310x310.png favicon.ico ``` -------------------------------- ### Register routes in packageBooted() Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/resources/boost/skills/favicon-development/SKILL.md Registers the favicon routes from the service provider's packageBooted() method, guarded by the 'favicon.enabled' config flag. Favicon::routes() also re-checks the flag, so it is safe to call directly. ```php public function packageBooted(): void { if (config('favicon.enabled', false)) { Favicon::routes(); } } ``` -------------------------------- ### Mock Vite for tests Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/resources/boost/skills/favicon-development/SKILL.md Swaps the Vite facade with a mock in tests because Vite::asset() has no compiled manifest. The fake returns a CDN URL for asset() and 'fake' for content(). ```php use Illuminate\Foundation\Vite as FoundationVite; use Illuminate\Support\Facades\Vite; beforeEach(function () { $vite = Mockery::mock(FoundationVite::class); $vite->shouldReceive('asset')->andReturnUsing(fn (string $p) => 'https://cdn.test/'.$p); $vite->shouldReceive('content')->andReturnUsing(fn (string $p) => 'fake'); Vite::swap($vite); }); ``` -------------------------------- ### Test browserconfig and disabled routes Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/resources/boost/skills/favicon-development/SKILL.md Pest tests for the favicon endpoints. The first test enables the routes and asserts the browserconfig.xml response is OK with content type application/xml. The second test disables the routes and asserts both endpoints return 404. ```php use JeffersonGoncalves\Favicon\Favicon; it('serves browserconfig.xml', function () { config()->set('favicon.enabled', true); Favicon::routes(); $response = $this->get('/browserconfig.xml'); $response->assertOk(); expect($response->headers->get('Content-Type'))->toContain('application/xml'); }); it('404s every route when disabled', function () { config()->set('favicon.enabled', false); $this->get('/browserconfig.xml')->assertNotFound(); $this->get('/favicon.ico')->assertNotFound(); }); ``` -------------------------------- ### Publish favicon-config tag Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/resources/boost/skills/favicon-development/SKILL.md Publish the package configuration file (config/favicon.php) to the consuming application. ```bash php artisan vendor:publish --tag="favicon-config" ``` -------------------------------- ### Published favicon config file Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/README.md Default configuration for the package. Set 'favicon' to null to disable the PHP /favicon.ico route. ```php return [ 'enabled' => true, 'favicon' => 'resources/favicon/favicon.ico', 'browserconfig_url' => '/browserconfig.xml', 'tile_color' => '#ffffff', ]; ``` -------------------------------- ### Include favicon::head with custom browserConfigUrl Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/README.md Include the favicon head view with a custom browserConfigUrl parameter. ```blade @include('favicon::head', ['browserConfigUrl' => '/browserconfig.xml']) ``` -------------------------------- ### Generate Apple touch icon links Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/README.md Generate Apple touch icon link tags using the Favicon::appleHeadLinks() method. ```php use JeffersonGoncalves\Favicon\Favicon; @foreach (Favicon::appleHeadLinks() as $link) @endforeach ``` -------------------------------- ### Include favicon::head in Blade layout Source: https://github.com/jeffersongoncalves/laravel-favicon/blob/master/README.md Include the favicon head view to render all icon-related head tags. ```blade {{-- ... --}} @include('favicon::head') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.