├── .php-cs-fixer.dist.php ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── composer.json ├── config └── flowbite-laravel.php ├── database ├── factories │ └── ModelFactory.php └── migrations │ └── create_flowbite_laravel_table.php.stub ├── resources └── views │ ├── .gitkeep │ └── components │ └── input │ ├── floated.blade.php │ └── index.blade.php └── src ├── Commands └── FlowbiteLaravelCommand.php ├── Facades └── FlowbiteLaravel.php ├── FlowbiteLaravel.php └── FlowbiteLaravelServiceProvider.php /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | in([ 5 | __DIR__ . '/src', 6 | __DIR__ . '/tests', 7 | ]) 8 | ->name('*.php') 9 | ->notName('*.blade.php') 10 | ->ignoreDotFiles(true) 11 | ->ignoreVCS(true); 12 | 13 | return (new PhpCsFixer\Config()) 14 | ->setRules([ 15 | '@PSR12' => true, 16 | 'array_syntax' => ['syntax' => 'short'], 17 | 'ordered_imports' => ['sort_algorithm' => 'alpha'], 18 | 'no_unused_imports' => true, 19 | 'not_operator_with_successor_space' => true, 20 | 'trailing_comma_in_multiline' => true, 21 | 'phpdoc_scalar' => true, 22 | 'unary_operator_spaces' => true, 23 | 'binary_operator_spaces' => true, 24 | 'blank_line_before_statement' => [ 25 | 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], 26 | ], 27 | 'phpdoc_single_line_var_spacing' => true, 28 | 'phpdoc_var_without_name' => true, 29 | 'class_attributes_separation' => [ 30 | 'elements' => [ 31 | 'method' => 'one', 32 | ], 33 | ], 34 | 'method_argument_space' => [ 35 | 'on_multiline' => 'ensure_fully_multiline', 36 | 'keep_multiple_spaces_after_comma' => true, 37 | ], 38 | 'single_trait_insert_per_statement' => true, 39 | ]) 40 | ->setFinder($finder); 41 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `flowbite-laravel` will be documented in this file. 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) flowbite 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 | 2 | [](https://supportukrainenow.org) 3 | 4 | # Official Laravel Integration and blade components built for Flowbite and Tailwind CSS 5 | 6 | [![Latest Version on Packagist](https://img.shields.io/packagist/v/flowbite/flowbite-laravel.svg?style=flat-square)](https://packagist.org/packages/flowbite/flowbite-laravel) 7 | [![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/flowbite/flowbite-laravel/run-tests?label=tests)](https://github.com/flowbite/flowbite-laravel/actions?query=workflow%3Arun-tests+branch%3Amain) 8 | [![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/flowbite/flowbite-laravel/Check%20&%20fix%20styling?label=code%20style)](https://github.com/flowbite/flowbite-laravel/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain) 9 | [![Total Downloads](https://img.shields.io/packagist/dt/flowbite/flowbite-laravel.svg?style=flat-square)](https://packagist.org/packages/flowbite/flowbite-laravel) 10 | 11 | This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. 12 | 13 | ## Support us 14 | 15 | [](https://spatie.be/github-ad-click/flowbite-laravel) 16 | 17 | We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us). 18 | 19 | We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards). 20 | 21 | ## Installation 22 | 23 | You can install the package via composer: 24 | 25 | ```bash 26 | composer require flowbite/flowbite-laravel 27 | ``` 28 | 29 | You can publish and run the migrations with: 30 | 31 | ```bash 32 | php artisan vendor:publish --tag="flowbite-laravel-migrations" 33 | php artisan migrate 34 | ``` 35 | 36 | You can publish the config file with: 37 | 38 | ```bash 39 | php artisan vendor:publish --tag="flowbite-laravel-config" 40 | ``` 41 | 42 | This is the contents of the published config file: 43 | 44 | ```php 45 | return [ 46 | ]; 47 | ``` 48 | 49 | Optionally, you can publish the views using 50 | 51 | ```bash 52 | php artisan vendor:publish --tag="flowbite-laravel-views" 53 | ``` 54 | 55 | ## Usage 56 | 57 | ```php 58 | $flowbiteLaravel = new Flowbite\FlowbiteLaravel(); 59 | echo $flowbiteLaravel->echoPhrase('Hello, Flowbite!'); 60 | ``` 61 | 62 | ## Testing 63 | 64 | ```bash 65 | composer test 66 | ``` 67 | 68 | ## Changelog 69 | 70 | Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. 71 | 72 | ## Contributing 73 | 74 | Please see [CONTRIBUTING](https://github.com/thomasdominic/.github/blob/main/CONTRIBUTING.md) for details. 75 | 76 | ## Security Vulnerabilities 77 | 78 | Please review [our security policy](../../security/policy) on how to report security vulnerabilities. 79 | 80 | ## Credits 81 | 82 | - [Dominique Thomas](https://github.com/thomasdominic) 83 | - [All Contributors](../../contributors) 84 | 85 | ## License 86 | 87 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 88 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flowbite/flowbite-laravel", 3 | "description": "Official Laravel Integration and blade components built for Flowbite and Tailwind CSS", 4 | "keywords": [ 5 | "flowbite", 6 | "laravel", 7 | "flowbite-laravel" 8 | ], 9 | "homepage": "https://github.com/flowbite/flowbite-laravel", 10 | "license": "MIT", 11 | "authors": [ 12 | { 13 | "name": "Dominique Thomas", 14 | "email": "dthomas@codenco.fr", 15 | "role": "Developer" 16 | } 17 | ], 18 | "require": { 19 | "php": "^8.1", 20 | "spatie/laravel-package-tools": "^1.9.2", 21 | "illuminate/contracts": "^9.0" 22 | }, 23 | "require-dev": { 24 | "friendsofphp/php-cs-fixer": "^3.8", 25 | "nunomaduro/collision": "^6.0", 26 | "nunomaduro/larastan": "^2.0.1", 27 | "orchestra/testbench": "^7.0", 28 | "pestphp/pest": "^1.21", 29 | "pestphp/pest-plugin-laravel": "^1.1", 30 | "phpstan/extension-installer": "^1.1", 31 | "phpstan/phpstan-deprecation-rules": "^1.0", 32 | "phpstan/phpstan-phpunit": "^1.0", 33 | "phpunit/phpunit": "^9.5", 34 | "spatie/laravel-ray": "^1.26" 35 | }, 36 | "autoload": { 37 | "psr-4": { 38 | "Flowbite\\FlowbiteLaravel\\": "src", 39 | "Flowbite\\FlowbiteLaravel\\Database\\Factories\\": "database/factories" 40 | } 41 | }, 42 | "autoload-dev": { 43 | "psr-4": { 44 | "Flowbite\\FlowbiteLaravel\\Tests\\": "tests" 45 | } 46 | }, 47 | "scripts": { 48 | "analyse": "vendor/bin/phpstan analyse", 49 | "test": "vendor/bin/pest", 50 | "test-coverage": "vendor/bin/pest --coverage", 51 | "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" 52 | }, 53 | "config": { 54 | "sort-packages": true, 55 | "allow-plugins": { 56 | "pestphp/pest-plugin": true, 57 | "phpstan/extension-installer": true 58 | } 59 | }, 60 | "extra": { 61 | "laravel": { 62 | "providers": [ 63 | "Flowbite\\FlowbiteLaravel\\FlowbiteLaravelServiceProvider" 64 | ], 65 | "aliases": { 66 | "FlowbiteLaravel": "Flowbite\\FlowbiteLaravel\\Facades\\FlowbiteLaravel" 67 | } 68 | } 69 | }, 70 | "minimum-stability": "dev", 71 | "prefer-stable": true 72 | } 73 | -------------------------------------------------------------------------------- /config/flowbite-laravel.php: -------------------------------------------------------------------------------- 1 | 12 | | If the prefix is defined to null or empty, the use will be: 13 | | 14 | */ 15 | 16 | 'prefix' => 'fbl', 17 | 18 | ]; 19 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | id(); 13 | 14 | // add fields 15 | 16 | $table->timestamps(); 17 | }); 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /resources/views/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themesberg/flowbite-laravel/2d76705aba3660988c9505ba587c16bb1162db54/resources/views/.gitkeep -------------------------------------------------------------------------------- /resources/views/components/input/floated.blade.php: -------------------------------------------------------------------------------- 1 |
2 | test 3 |
4 | -------------------------------------------------------------------------------- /resources/views/components/input/index.blade.php: -------------------------------------------------------------------------------- 1 |
2 | test 3 |
4 | -------------------------------------------------------------------------------- /src/Commands/FlowbiteLaravelCommand.php: -------------------------------------------------------------------------------- 1 | comment('All done'); 16 | 17 | return self::SUCCESS; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Facades/FlowbiteLaravel.php: -------------------------------------------------------------------------------- 1 | name('flowbite-laravel') 23 | ->hasConfigFile() 24 | ->hasViews() 25 | 26 | ->hasMigration('create_flowbite-laravel_table') 27 | ->hasCommand(FlowbiteLaravelCommand::class); 28 | } 29 | 30 | public function packageBooted() 31 | { 32 | $this->loadViewsFrom(__DIR__ . '/../resources/views', 'flowbite-laravel'); 33 | $this->configureComponents(); 34 | } 35 | 36 | protected function configureComponents() 37 | { 38 | $this->callAfterResolving(BladeCompiler::class, function () { 39 | $this->registerComponent('input', 'input.index'); 40 | //$this->registerComponent('input.floated'); 41 | }); 42 | } 43 | 44 | /** 45 | * Register the given component. 46 | * 47 | * @param string $component 48 | * @return void 49 | */ 50 | protected function registerComponent(string $component, ?string $file = null) 51 | { 52 | $prefix = config('flowbite-laravel.prefix', ''); 53 | if (! empty($prefix)) { 54 | $prefix .= "-"; 55 | } 56 | Blade::component('flowbite-laravel::components.'.($file ?? $component), $prefix.$component); 57 | } 58 | } 59 | --------------------------------------------------------------------------------