|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Javaabu\Generators\IconProviders; |
| 4 | + |
| 5 | +class FontAwesomeProvider extends BaseIconProvider |
| 6 | +{ |
| 7 | + public function getDefaultIcon(): string |
| 8 | + { |
| 9 | + return 'file'; |
| 10 | + } |
| 11 | + |
| 12 | + public function getPrefix(): string |
| 13 | + { |
| 14 | + return 'fa-regular fa-'; |
| 15 | + } |
| 16 | + |
| 17 | + protected static array $preset_icons = [ |
| 18 | + 'users' => 'users', |
| 19 | + 'posts' => 'file-alt', |
| 20 | + 'comments' => 'comment', |
| 21 | + 'categories' => 'folder', |
| 22 | + 'tags' => 'tags', |
| 23 | + 'roles' => 'user-shield', |
| 24 | + 'permissions' => 'lock', |
| 25 | + 'profiles' => 'id-badge', |
| 26 | + 'likes' => 'thumbs-up', |
| 27 | + 'followers' => 'user-friends', |
| 28 | + 'favorites' => 'star', |
| 29 | + 'messages' => 'envelope', |
| 30 | + 'notifications' => 'bell', |
| 31 | + 'tasks' => 'tasks', |
| 32 | + 'projects' => 'project-diagram', |
| 33 | + 'teams' => 'users-cog', |
| 34 | + 'members' => 'user', |
| 35 | + 'invoices' => 'file-invoice-dollar', |
| 36 | + 'payments' => 'credit-card', |
| 37 | + 'orders' => 'shopping-basket', |
| 38 | + 'products' => 'shopping-cart', |
| 39 | + 'customers' => 'user-tag', |
| 40 | + 'suppliers' => 'truck', |
| 41 | + 'contacts' => 'address-book', |
| 42 | + 'addresses' => 'map-marker-alt', |
| 43 | + 'countries' => 'globe', |
| 44 | + 'cities' => 'city', |
| 45 | + 'states' => 'map', |
| 46 | + 'employees' => 'user-tie', |
| 47 | + 'departments' => 'building', |
| 48 | + 'positions' => 'briefcase', |
| 49 | + 'assets' => 'boxes', |
| 50 | + 'loans' => 'hand-holding-usd', |
| 51 | + 'expenses' => 'money-bill-wave', |
| 52 | + 'transactions' => 'exchange-alt', |
| 53 | + 'subcategories' => 'folder-open', |
| 54 | + 'services' => 'concierge-bell', |
| 55 | + 'appointments' => 'calendar-check', |
| 56 | + 'bookings' => 'ticket-alt', |
| 57 | + 'events' => 'calendar-alt', |
| 58 | + 'places' => 'map-pin', |
| 59 | + 'reviews' => 'comments', |
| 60 | + 'ratings' => 'star-half-alt', |
| 61 | + 'images' => 'image', |
| 62 | + 'videos' => 'video', |
| 63 | + 'documents' => 'file-alt', |
| 64 | + 'audios' => 'volume-up', |
| 65 | + 'articles' => 'newspaper', |
| 66 | + 'books' => 'book', |
| 67 | + 'authors' => 'user-edit', |
| 68 | + 'genres' => 'bookmark', |
| 69 | + 'chapters' => 'book-open', |
| 70 | + 'sections' => 'list-alt', |
| 71 | + 'questions' => 'question-circle', |
| 72 | + 'answers' => 'comment-dots', |
| 73 | + 'exams' => 'file-signature', |
| 74 | + 'results' => 'poll', |
| 75 | + 'grades' => 'clipboard-check', |
| 76 | + 'students' => 'user-graduate', |
| 77 | + 'teachers' => 'chalkboard-teacher', |
| 78 | + 'courses' => 'graduation-cap', |
| 79 | + 'lessons' => 'file-alt', |
| 80 | + 'assignments' => 'clipboard-list', |
| 81 | + 'submissions' => 'file-upload', |
| 82 | + 'quizzes' => 'question', |
| 83 | + 'options' => 'list', |
| 84 | + 'responses' => 'file-alt', |
| 85 | + 'surveys' => 'poll-h', |
| 86 | + 'polls' => 'poll', |
| 87 | + 'votes' => 'vote-yea', |
| 88 | + 'candidates' => 'user-tie', |
| 89 | + 'parties' => 'users', |
| 90 | + 'constituencies' => 'map-marker', |
| 91 | + 'elections' => 'calendar-day', |
| 92 | + 'winners' => 'trophy', |
| 93 | + 'losers' => 'sad-tear', |
| 94 | + 'contests' => 'flag-checkered', |
| 95 | + 'entries' => 'pen', |
| 96 | + 'judges' => 'gavel', |
| 97 | + 'verdicts' => 'balance-scale', |
| 98 | + 'claims' => 'file-contract', |
| 99 | + 'policies' => 'file-alt', |
| 100 | + 'contracts' => 'file-signature', |
| 101 | + 'clauses' => 'file-alt', |
| 102 | + 'warranties' => 'shield-alt', |
| 103 | + 'agreements' => 'handshake', |
| 104 | + 'proposals' => 'lightbulb', |
| 105 | + 'bids' => 'file-invoice', |
| 106 | + 'tenders' => 'file-contract', |
| 107 | + 'awards' => 'award', |
| 108 | + 'offers' => 'tags', |
| 109 | + 'negotiations' => 'handshake', |
| 110 | + 'deals' => 'hand-holding-usd', |
| 111 | + ]; |
| 112 | + |
| 113 | + protected static array $icons = []; |
| 114 | + |
| 115 | + public static function getIcons(): array |
| 116 | + { |
| 117 | + if (! static::$icons) { |
| 118 | + static::loadIcons(); |
| 119 | + } |
| 120 | + |
| 121 | + return static::$icons; |
| 122 | + } |
| 123 | + |
| 124 | + public static function loadIcons(): void |
| 125 | + { |
| 126 | + static::$icons = file(__DIR__ . '/resources/fontawesome-v7.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
| 127 | + } |
| 128 | +} |
0 commit comments