├── postcss.config.cjs ├── src ├── Support │ └── Icons │ │ ├── PhosphorWeight.php │ │ └── Phosphor.php └── FilamentPhosphorIconsServiceProvider.php ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── fetch-new-enums.php └── composer.json /postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | "postcss-import": {}, 4 | "tailwindcss/nesting": {}, 5 | tailwindcss: {}, 6 | autoprefixer: {}, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /src/Support/Icons/PhosphorWeight.php: -------------------------------------------------------------------------------- 1 | name(static::$name); 17 | } 18 | 19 | public function packageRegistered(): void {} 20 | 21 | public function packageBooted(): void {} 22 | 23 | protected function getAssetPackageName(): ?string 24 | { 25 | return 'schmeits/filament-4-phosphor-icons'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) schmeits 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Filament 4 Phosphor icons 2 | 3 | [![Latest Version on Packagist](https://img.shields.io/packagist/v/schmeits/filament-4-phosphor-icons.svg?style=flat-square)](https://packagist.org/packages/schmeits/filament-4-phosphor-icons) 4 | [![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/schmeits/filament-4-phosphor-icons/fix-php-code-styling.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/schmeits/filament-4-phosphor-icons/actions?query=workflow%3A"Fix+PHP+code+styling"+branch%3Amain) 5 | [![Total Downloads](https://img.shields.io/packagist/dt/schmeits/filament-4-phosphor-icons.svg?style=flat-square)](https://packagist.org/packages/schmeits/filament-4-phosphor-icons) 6 | 7 | 8 | This is a custom icon pack to be used in Filament v4. You can use it to add Phosphor icons everywhere :) 9 | 10 | ## Installation 11 | 12 | You can install the package via composer: 13 | 14 | ```bash 15 | composer require schmeits/filament-4-phosphor-icons 16 | ``` 17 | 18 | ## Usage 19 | 20 | ```php 21 | Forms\Components\TextInput::make('name') 22 | ->required() 23 | ->prefixIcon(Phosphor::Smiley) 24 | ``` 25 | Check out the Phosphor icons on their website [Phosphor Icons](https://phosphoricons.com/) to find the icon you want to use.gh 26 | 27 | ## Weights 28 | The package comes with the following weights you can use: 29 | 30 | ```php 31 | enum PhosphorWeight: string 32 | { 33 | case Thin = 'thin'; 34 | case Light = 'light'; 35 | case Regular = 'regular'; 36 | case Bold = 'bold'; 37 | case Fill = 'fill'; 38 | case Duotone = 'duotone'; 39 | } 40 | ``` 41 | You can use the weights in the same way as the icons: 42 | 43 | ```php 44 | ->prefixIcon(Phosphor::Smiley->getIconForWeight(PhosphorWeight::Duotone)) 45 | ``` 46 | 47 | ## Changelog 48 | 49 | Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. 50 | 51 | ## Contributing 52 | 53 | Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. 54 | 55 | ## Credits 56 | 57 | - [Tally Schmeits](https://github.com/schmeits) 58 | - [Phosphor icons](https://phosphoricons.com) 59 | - [All Contributors](../../contributors) 60 | 61 | ## License 62 | 63 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 64 | -------------------------------------------------------------------------------- /fetch-new-enums.php: -------------------------------------------------------------------------------- 1 | "phosphor-{$this->value}-thin", 57 | IconSize::Medium => "phosphor-{$this->value}", 58 | IconSize::Large, IconSize::ExtraLarge, IconSize::TwoExtraLarge => "phosphor-{$this->value}-bold", 59 | }; 60 | } 61 | 62 | public function getIconForWeight(PhosphorWeight $weight): string 63 | { 64 | if ($weight === PhosphorWeight::Regular) { 65 | return "phosphor-{$this->value}"; 66 | } 67 | 68 | return "phosphor-{$this->value}-{$weight->value}"; 69 | } 70 | } 71 | '; 72 | 73 | file_put_contents($enumFile, $enumContent); 74 | 75 | echo 'Phosphor Icon enum generated with ' . count($enumCases) . " icons from local vendor directory.\n"; 76 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "schmeits/filament-4-phosphor-icons", 3 | "description": "This is my package filament-4-phosphor-icons", 4 | "keywords": [ 5 | "schmeits", 6 | "laravel", 7 | "filament-4-phosphor-icons" 8 | ], 9 | "homepage": "https://github.com/schmeits/filament-4-phosphor-icons", 10 | "support": { 11 | "issues": "https://github.com/schmeits/filament-4-phosphor-icons/issues", 12 | "source": "https://github.com/schmeits/filament-4-phosphor-icons" 13 | }, 14 | "license": "MIT", 15 | "authors": [ 16 | { 17 | "name": "Tally Schmeits", 18 | "email": "tally@schmeits.com", 19 | "role": "Developer" 20 | } 21 | ], 22 | "require": { 23 | "php": "^8.2", 24 | "codeat3/blade-phosphor-icons": "^2.3", 25 | "filament/filament": "^v4.0.0-beta", 26 | "spatie/laravel-package-tools": "^1.15.0" 27 | }, 28 | "require-dev": { 29 | "laravel/pint": "^1.0", 30 | "nunomaduro/collision": "^8.0", 31 | "larastan/larastan": "^2.9", 32 | "orchestra/testbench": "^9.0", 33 | "pestphp/pest": "^3.2", 34 | "pestphp/pest-plugin-arch": "^3.0", 35 | "pestphp/pest-plugin-laravel": "^3.0", 36 | "phpstan/extension-installer": "^1.1", 37 | "phpstan/phpstan-deprecation-rules": "^1.0", 38 | "phpstan/phpstan-phpunit": "^1.0", 39 | "spatie/laravel-ray": "^1.26" 40 | }, 41 | "autoload": { 42 | "psr-4": { 43 | "Schmeits\\FilamentPhosphorIcons\\": "src/", 44 | "Schmeits\\FilamentPhosphorIcons\\Database\\Factories\\": "database/factories/" 45 | } 46 | }, 47 | "autoload-dev": { 48 | "psr-4": { 49 | "Schmeits\\FilamentPhosphorIcons\\Tests\\": "tests/" 50 | } 51 | }, 52 | "scripts": { 53 | "post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi", 54 | "analyse": "vendor/bin/phpstan analyse", 55 | "test": "vendor/bin/pest", 56 | "test-coverage": "vendor/bin/pest --coverage", 57 | "format": "vendor/bin/pint" 58 | }, 59 | "config": { 60 | "sort-packages": true, 61 | "allow-plugins": { 62 | "pestphp/pest-plugin": true, 63 | "phpstan/extension-installer": true 64 | } 65 | }, 66 | "extra": { 67 | "laravel": { 68 | "providers": [ 69 | "Schmeits\\FilamentPhosphorIcons\\FilamentPhosphorIconsServiceProvider" 70 | ], 71 | "aliases": { 72 | "FilamentPhosphorIcons": "Schmeits\\FilamentPhosphorIcons\\Facades\\FilamentPhosphorIcons" 73 | } 74 | } 75 | }, 76 | "minimum-stability": "beta", 77 | "prefer-stable": true 78 | } 79 | -------------------------------------------------------------------------------- /src/Support/Icons/Phosphor.php: -------------------------------------------------------------------------------- 1 | "phosphor-{$this->value}-thin", 1527 | IconSize::Medium => "phosphor-{$this->value}", 1528 | IconSize::Large, IconSize::ExtraLarge, IconSize::TwoExtraLarge => "phosphor-{$this->value}-bold", 1529 | }; 1530 | } 1531 | 1532 | public function getIconForWeight(PhosphorWeight $weight): string 1533 | { 1534 | if ($weight === PhosphorWeight::Regular) { 1535 | return "phosphor-{$this->value}"; 1536 | } 1537 | 1538 | return "phosphor-{$this->value}-{$weight->value}"; 1539 | } 1540 | } 1541 | --------------------------------------------------------------------------------