├── .github └── FUNDING.yml ├── .gitignore ├── .idea ├── blade.xml ├── codeStyles │ └── codeStyleConfig.xml ├── inspectionProfiles │ └── profiles_settings.xml ├── laravel-blade-components.iml ├── laravel-idea-personal.xml ├── laravel-idea.xml ├── modules.xml ├── php-test-framework.xml ├── php.xml ├── vcs.xml └── workspace.xml ├── .phpunit.result.cache ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── composer.json ├── phpunit.xml ├── src ├── LaravelBladeComponentsServiceProvider.php └── components │ ├── 2col.blade.php │ ├── button.blade.php │ ├── dropdown-link.blade.php │ ├── dropdown.blade.php │ ├── form.blade.php │ ├── form │ ├── checkbox-row.blade.php │ ├── checkbox.blade.php │ ├── ckeditor.blade.php │ ├── date.blade.php │ ├── daterange.blade.php │ ├── datetime.blade.php │ ├── file-upload.blade.php │ ├── group.blade.php │ ├── input.blade.php │ ├── radio.blade.php │ ├── select-option-row.blade.php │ ├── select-option.blade.php │ ├── select-search.blade.php │ ├── select.blade.php │ ├── submit.blade.php │ ├── textarea.blade.php │ ├── time.blade.php │ └── timeday.blade.php │ ├── modal.blade.php │ ├── nav │ ├── droplink.blade.php │ ├── group-item.blade.php │ ├── group.blade.php │ └── link.blade.php │ ├── tab.blade.php │ └── tabs │ ├── div.blade.php │ ├── header.blade.php │ └── link.blade.php └── tests ├── Pest.php ├── TestCase.php └── Unit └── BladeComponents ├── ButtonTest.php ├── Form ├── CheckboxTest.php ├── CkeditorTest.php └── FormTest.php ├── ModalTest.php └── TabTest.php /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [dcblogdev] 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | vendor 3 | .idea -------------------------------------------------------------------------------- /.idea/blade.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/laravel-blade-components.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /.idea/laravel-idea-personal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/laravel-idea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/php-test-framework.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/php.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 132 | 133 | 135 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 61 | 62 | $PROJECT_DIR$/composer.json 63 | 64 | 65 | 66 | 68 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 192 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 222 | 225 | 226 | 227 | 228 | 231 | 234 | 235 | 236 | 237 | 240 | 243 | 244 | 245 | 246 | 249 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 1599552941886 273 | 281 | 282 | 1631255777037 283 | 288 | 291 | 292 | 294 | 295 | 304 | 305 | 306 | 307 | 309 | -------------------------------------------------------------------------------- /.phpunit.result.cache: -------------------------------------------------------------------------------- 1 | {"version":1,"defects":{"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/ButtonTest.php::can":4,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/CheckboxTest.php::can":4,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/CheckboxTest.php::when":4,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/CheckboxTest.php::checkbox":4,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/CkeditorTest.php::can":4,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/FormTest.php::can":4,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/FormTest.php::when":4,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/ModalTest.php::can":4,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/TabTest.php::can":4},"times":{"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/ButtonTest.php::can":0.007,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/CheckboxTest.php::can":0.007,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/CheckboxTest.php::when":0.007,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/CheckboxTest.php::checkbox":0.007,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/CkeditorTest.php::can":0.007,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/FormTest.php::can":0.007,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/Form\/FormTest.php::when":0.008,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/ModalTest.php::can":0.046,"\/Users\/dave\/sites\/not-parked\/packages\/laravel-blade-components\/tests\/Unit\/BladeComponents\/TabTest.php::can":0.008}} -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes will be documented in this file 4 | 5 | ## 1.0.0 6 | 7 | - initial release 8 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | Please read and understand the contribution guide before creating an issue or pull request. 6 | 7 | ## Etiquette 8 | 9 | This project is open source, and as such, the maintainers give their free time to build and maintain the source code 10 | held within. They make the code freely available in the hope that it will be of use to other developers. It would be 11 | extremely unfair for them to suffer abuse or anger for their hard work. 12 | 13 | Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the 14 | world that developers are civilized and selfless people. 15 | 16 | It's the duty of the maintainer to ensure that all submissions to the project are of sufficient 17 | quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. 18 | 19 | ## Viability 20 | 21 | When requesting or submitting new features, first consider whether it might be useful to others. Open 22 | source projects are used by many developers, who may have entirely different needs to your own. Think about 23 | whether or not your feature is likely to be used by other users of the project. 24 | 25 | ## Procedure 26 | 27 | Before filing an issue: 28 | 29 | - Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. 30 | - Check to make sure your feature suggestion isn't already present within the project. 31 | - Check the pull requests tab to ensure that the bug doesn't have a fix in progress. 32 | - Check the pull requests tab to ensure that the feature isn't already in progress. 33 | 34 | Before submitting a pull request: 35 | 36 | - Check the codebase to ensure that your feature doesn't already exist. 37 | - Check the pull requests to ensure that another person hasn't already submitted the feature or fix. 38 | 39 | ## Requirements 40 | 41 | If the project maintainer has any additional requirements, you will find them listed here. 42 | 43 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 44 | 45 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option. 46 | 47 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 48 | 49 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 50 | 51 | **Happy coding**! 52 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) dcblogdev 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 all 13 | 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 THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Community 2 | 3 | There is a Discord community. https://discord.gg/VYau8hgwrm For quick help, ask questions in the appropriate channel. 4 | 5 | # Laravel Blade components collection 6 | 7 | [![Latest Version on Packagist](https://img.shields.io/packagist/v/dcblogdev/laravel-blade-components.svg?style=flat-square)](https://packagist.org/packages/dcblogdev/laravel-blade-components) 8 | [![Total Downloads](https://img.shields.io/packagist/dt/dcblogdev/laravel-blade-components.svg?style=flat-square)](https://packagist.org/packages/dcblogdev/laravel-blade-components) 9 | 10 | Re-usable Laravel Blade components for your projects 11 | 12 | ## Installation 13 | 14 | You can install the package via composer: 15 | 16 | ```bash 17 | composer require dcblogdev/laravel-blade-components 18 | ``` 19 | 20 | ## Usage 21 | 22 | ## Form components 23 | 24 | * [Open](#open) 25 | * [Input](#form-input) 26 | * [Textarea](#form-textarea) 27 | * [Checkbox](#form-checkbox) 28 | * [Radio](#form-radio) 29 | * [Select](#form-select) 30 | * [Button](#form-button) 31 | 32 | All form components accept option parameters that such as class='' style='' 33 | 34 | > When the method is set to PUT, PATCH or DELETE the @method() will be applied automatically. 35 | ### Open 36 | 37 | Defaults to post method and CSRF token 38 | 39 | ``` php 40 | 41 | 42 | 43 | ``` 44 | 45 | The method and actions can be passed: 46 | 47 | ``` php 48 | 49 | 50 | 51 | ``` 52 | 53 | ### Form input 54 | 55 | Create an input with a name, the name will be used as the label as long as the label is not provided. 56 | 57 | ```php 58 | 59 | ``` 60 | 61 | Outputs: 62 | 63 | ```HTML 64 |
65 | 66 | 67 |
68 | ``` 69 | 70 | Use a label 71 | 72 | ```php 73 | 74 | ``` 75 | 76 | Use an id and a class 77 | 78 | ```php 79 | 80 | ``` 81 | 82 | The type is set to test by default, it can be changed 83 | 84 | ```php 85 | 86 | ``` 87 | 88 | Set the input value 89 | 90 | ```php 91 | {{ $username }} 92 | ``` 93 | 94 | ### Form textarea 95 | 96 | ```php 97 | 98 | ``` 99 | 100 | Set the rows and columns 101 | 102 | ```php 103 | 104 | ``` 105 | 106 | Set the textarea data 107 | 108 | ```php 109 | {{ $comments }} 110 | ``` 111 | 112 | ### Form checkbox 113 | 114 | A checkbox can also be defined, set the name and value 115 | 116 | ```php 117 | 118 | ``` 119 | 120 | Check the checkbox by passing its value, as long its a match the checkbox will be checked. 121 | 122 | ```php 123 | 1 124 | ``` 125 | 126 | or 127 | 128 | ```php 129 | {{ $terms }} 130 | ``` 131 | 132 | ### Form radio 133 | 134 | A radio can also be defined, set the name, label and value 135 | 136 | ```php 137 | 138 | 139 | 140 | ``` 141 | 142 | Pass a value which will check the matching radio. 143 | 144 | ```php 145 | {{ $result }} 146 | {{ $result }} 147 | {{ $result }} 148 | ``` 149 | 150 | Check the checkbox by passing its value, as long its a match the checkbox will be checked. 151 | 152 | ```php 153 | 1 154 | ``` 155 | 156 | or 157 | 158 | ```php 159 | {{ $terms }} 160 | ``` 161 | 162 | ### Form select 163 | 164 | create a select menu set the name and placeholder for the initial option 165 | 166 | ```php 167 | 168 | 169 | 170 | ``` 171 | 172 | Leave off the placeholder to have only the select and options that can be selected 173 | 174 | ```php 175 | 176 | 177 | 178 | ``` 179 | 180 | In order to set the option an array is needed and is looped over and then a nested component is used. 181 | 182 | Pass in the key and value from the array 183 | 184 | ```php 185 | @php 186 | $options = [1 => 'one', 2 => 'two', 3 => 'three']; 187 | @endphp 188 | 189 | 190 | @foreach($options as $key => $value) 191 | 192 | @endforeach 193 | 194 | ``` 195 | 196 | ### Form button 197 | 198 | Create a button, defaults to a submit type 199 | 200 | ```php 201 | Submit 202 | ``` 203 | 204 | Create a button, using only the defaults and a label 205 | 206 | ```php 207 | Submit 208 | ``` 209 | 210 | 211 | ### Changelog 212 | 213 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. 214 | 215 | ## Contributing 216 | 217 | Please see [CONTRIBUTING](CONTRIBUTING.md) for details. 218 | 219 | ### Security 220 | 221 | If you discover any security related issues, please email dave@dcblog.dev instead of using the issue tracker. 222 | 223 | ## Credits 224 | 225 | - [David Carr](https://github.com/dcblogdev) 226 | - [All Contributors](../../contributors) 227 | 228 | ## License 229 | 230 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 231 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dcblogdev/laravel-blade-components", 3 | "description": "Laravel Blade components collection", 4 | "keywords": [ 5 | "dcblogdev", 6 | "blade-components-forms" 7 | ], 8 | "homepage": "https://github.com/dcblogdev/laravel-blade-components", 9 | "license": "MIT", 10 | "type": "library", 11 | "authors": [ 12 | { 13 | "name": "David Carr", 14 | "email": "dave@dcblog.dev", 15 | "role": "Developer" 16 | } 17 | ], 18 | "require": { 19 | "orchestra/testbench": "^5.0|^6.23|^7.0|^8.0|^9.0.4|^10.0", 20 | "pestphp/pest": "^1.23|^2.34.7|^3.0", 21 | "pestphp/pest-plugin-laravel": "^2.4|^3.1" 22 | }, 23 | "autoload": { 24 | "psr-4": { 25 | "Dcblogdev\\LaravelBladeComponents\\": "src", 26 | "Dcblogdev\\LaravelBladeComponents\\Tests\\": "tests" 27 | } 28 | }, 29 | "extra": { 30 | "laravel": { 31 | "providers": [ 32 | "Dcblogdev\\LaravelBladeComponents\\LaravelBladeComponentsServiceProvider" 33 | ] 34 | } 35 | }, 36 | "config": { 37 | "allow-plugins": { 38 | "pestphp/pest-plugin": true 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | src/ 19 | 20 | 21 | 22 | 23 | ./tests/Unit 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/LaravelBladeComponentsServiceProvider.php: -------------------------------------------------------------------------------- 1 | loadViewsFrom(__DIR__ . '/components', 'laravelbladecomponents'); 13 | 14 | Blade::component('laravelbladecomponents::tab', 'tab'); 15 | Blade::component('laravelbladecomponents::modal', 'modal'); 16 | Blade::component('laravelbladecomponents::form', 'form'); 17 | Blade::component('laravelbladecomponents::dropdown-link', 'dropdown-link'); 18 | Blade::component('laravelbladecomponents::dropdown', 'dropdown'); 19 | Blade::component('laravelbladecomponents::button', 'button'); 20 | Blade::component('laravelbladecomponents::2col', '2col'); 21 | 22 | Blade::component('laravelbladecomponents::form.input', 'form.input'); 23 | Blade::component('laravelbladecomponents::form.textarea', 'form.textarea'); 24 | Blade::component('laravelbladecomponents::form.checkbox', 'form.checkbox'); 25 | Blade::component('laravelbladecomponents::form.radio', 'form.radio'); 26 | Blade::component('laravelbladecomponents::form.select', 'form.select'); 27 | Blade::component('laravelbladecomponents::form.selectoption', 'form.selectoption'); 28 | 29 | Blade::component('laravelbladecomponents::tabs.div', 'tabs.div'); 30 | Blade::component('laravelbladecomponents::tabs.header', 'tabs.header'); 31 | Blade::component('laravelbladecomponents::tabs.link', 'tabs.link'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/components/2col.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ $left }} 4 |
5 | 6 |
7 | {{ $right }} 8 |
9 |
-------------------------------------------------------------------------------- /src/components/button.blade.php: -------------------------------------------------------------------------------- 1 | @props(['type' => 'submit']) 2 | 3 | -------------------------------------------------------------------------------- /src/components/dropdown-link.blade.php: -------------------------------------------------------------------------------- 1 | merge(['class' => 'block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:text-gray-200 dark:hover:bg-gray-600 focus:outline-none']) }}>{{ $slot }} 2 | -------------------------------------------------------------------------------- /src/components/dropdown.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'label' => '' 3 | ]) 4 | 5 |
6 |
7 | 8 | 15 | 16 |
17 | 18 |
19 | {{ $slot }} 20 |
21 |
22 | -------------------------------------------------------------------------------- /src/components/form.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'method' => 'post' 3 | ]) 4 | 5 | @php 6 | $method = strtolower($method); 7 | @endphp 8 | 9 |
10 | @if ($method != 'get') 11 | @csrf 12 | @endif 13 | 14 | @if (! in_array(strtolower($method), ['get', 'post'])) 15 | @method($method) 16 | @endif 17 | 18 | {{ $slot }} 19 | 20 |
-------------------------------------------------------------------------------- /src/components/form/checkbox-row.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'level' => 0, 3 | 'data' => null, 4 | 'wireName' => null, 5 | 'id' => 'id', 6 | 'label' => 'title' 7 | ]) 8 | @if ($level > 0) {!! str_repeat("  ", $level) !!} @endif {{ $data->$label }}
9 | @foreach ($data->children as $child) 10 | 11 | @endforeach 12 | -------------------------------------------------------------------------------- /src/components/form/checkbox.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'name' => '', 3 | 'id' => '', 4 | 'label' => '', 5 | 'value' => '', 6 | 'selected' => '' 7 | ]) 8 | 9 | @php 10 | if ($id === '') { 11 | $id = $name; 12 | } 13 | @endphp 14 | 15 | @if ($label === '') 16 | @php 17 | //remove underscores from name 18 | $label = str_replace('_', ' ', $name); 19 | //detect subsequent letters starting with a capital 20 | $label = preg_split('/(?=[A-Z])/', $label); 21 | //display capital words with a space 22 | $label = implode(' ', $label); 23 | //uppercase first letter and lower the rest of a word 24 | $label = ucwords(strtolower($label)); 25 | @endphp 26 | @endif 27 | 28 |
29 | 30 | 31 |
32 | -------------------------------------------------------------------------------- /src/components/form/ckeditor.blade.php: -------------------------------------------------------------------------------- 1 | @push('scripts') 2 | 3 | @endpush 4 | 5 | @props([ 6 | 'name' => '', 7 | 'label' => '', 8 | 'required' => false 9 | ]) 10 | 11 | @if ($label == '') 12 | @php 13 | //remove underscores from name 14 | $label = str_replace('_', ' ', $name); 15 | //detect subsequent letters starting with a capital 16 | $label = preg_split('/(?=[A-Z])/', $label); 17 | //display capital words with a space 18 | $label = implode(' ', $label); 19 | //uppercase first letter and lower the rest of a word 20 | $label = ucwords(strtolower($label)); 21 | @endphp 22 | @endif 23 |
24 | @if ($label !='none') 25 | 26 | @endif 27 | 40 |
41 | @error($name) 42 |

{{ $message }}

43 | @enderror 44 | -------------------------------------------------------------------------------- /src/components/form/date.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'options' => [], 3 | 'required' => '', 4 | 'name' => '', 5 | 'label' => '', 6 | 'value' => '', 7 | ]) 8 | 9 | @if ($label === 'none') 10 | 11 | @elseif ($label === '') 12 | @php 13 | //remove underscores from name 14 | $label = str_replace('_', ' ', $name); 15 | //detect subsequent letters starting with a capital 16 | $label = preg_split('/(?=[A-Z])/', $label); 17 | //display capital words with a space 18 | $label = implode(' ', $label); 19 | //uppercase first letter and lower the rest of a word 20 | $label = ucwords(strtolower($label)); 21 | @endphp 22 | @endif 23 | 24 | @php 25 | $options = array_merge([ 26 | 'dateFormat' => 'd-m-Y', 27 | 'enableTime' => false, 28 | 'time_24hr' => true, 29 | ], $options); 30 | @endphp 31 | 32 |
33 | @if ($label !='none') 34 | 35 | @endif 36 |
37 | merge(['class' => 'mt-1 block w-full dark:bg-gray-500 dark:text-gray-200 dark:placeholder-gray-200 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-light-blue-500 focus:border-light-blue-500 sm:text-sm']) }}> 47 | @error($name) 48 |

{{ $message }}

49 | @enderror 50 |
51 |
-------------------------------------------------------------------------------- /src/components/form/daterange.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'options' => [], 3 | 'required' => '', 4 | 'name' => '', 5 | 'label' => '', 6 | 'value' => '', 7 | ]) 8 | 9 | @if ($label === 'none') 10 | 11 | @elseif ($label === '') 12 | @php 13 | //remove underscores from name 14 | $label = str_replace('_', ' ', $name); 15 | //detect subsequent letters starting with a capital 16 | $label = preg_split('/(?=[A-Z])/', $label); 17 | //display capital words with a space 18 | $label = implode(' ', $label); 19 | //uppercase first letter and lower the rest of a word 20 | $label = ucwords(strtolower($label)); 21 | @endphp 22 | @endif 23 | 24 | @php 25 | $options = array_merge([ 26 | 'dateFormat' => 'd-m-Y', 27 | 'enableTime' => false, 28 | 'time_24hr' => true, 29 | 'mode' => 'range', 30 | ], $options); 31 | @endphp 32 | 33 |
34 | @if ($label !='none') 35 | 36 | @endif 37 |
38 | merge(['class' => 'mt-1 block w-full dark:bg-gray-500 dark:text-gray-200 dark:placeholder-gray-200 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-light-blue-500 focus:border-light-blue-500 sm:text-sm']) }}> 48 | @error($name) 49 |

{{ $message }}

50 | @enderror 51 |
52 |
-------------------------------------------------------------------------------- /src/components/form/datetime.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'options' => [], 3 | 'required' => '', 4 | 'name' => '', 5 | 'label' => '', 6 | 'value' => '', 7 | ]) 8 | 9 | @if ($label === 'none') 10 | 11 | @elseif ($label === '') 12 | @php 13 | //remove underscores from name 14 | $label = str_replace('_', ' ', $name); 15 | //detect subsequent letters starting with a capital 16 | $label = preg_split('/(?=[A-Z])/', $label); 17 | //display capital words with a space 18 | $label = implode(' ', $label); 19 | //uppercase first letter and lower the rest of a word 20 | $label = ucwords(strtolower($label)); 21 | @endphp 22 | @endif 23 | 24 | @php 25 | $options = array_merge([ 26 | 'dateFormat' => 'd-m-Y H:i', 27 | 'enableTime' => true, 28 | 'time_24hr' => true 29 | ], $options); 30 | @endphp 31 | 32 |
33 | @if ($label !='none') 34 | 35 | @endif 36 |
37 | merge(['class' => 'mt-1 block w-full dark:bg-gray-500 dark:text-gray-200 dark:placeholder-gray-200 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-light-blue-500 focus:border-light-blue-500 sm:text-sm']) }}> 47 | @error($name) 48 |

{{ $message }}

49 | @enderror 50 |
51 |
-------------------------------------------------------------------------------- /src/components/form/file-upload.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {{ $slot }} 3 | 4 |
5 | 6 | 7 | 10 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /src/components/form/group.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'label' 3 | ]) 4 | 5 |
6 | 7 |
8 | {{ $slot }} 9 |
10 |
11 | -------------------------------------------------------------------------------- /src/components/form/input.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'required' => '', 3 | 'type' => 'text', 4 | 'name' => '', 5 | 'label' => '', 6 | 'value' => '', 7 | ]) 8 | 9 | @if ($label === 'none') 10 | 11 | @elseif ($label === '') 12 | @php 13 | //remove underscores from name 14 | $label = str_replace('_', ' ', $name); 15 | //detect subsequent letters starting with a capital 16 | $label = preg_split('/(?=[A-Z])/', $label); 17 | //display capital words with a space 18 | $label = implode(' ', $label); 19 | //uppercase first letter and lower the rest of a word 20 | $label = ucwords(strtolower($label)); 21 | @endphp 22 | @endif 23 | 24 |
25 | @if ($label !='none') 26 | 27 | @endif 28 |
29 | merge(['class' => 'block w-full dark:bg-gray-500 dark:text-gray-200 dark:placeholder-gray-200 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-light-blue-500 focus:border-light-blue-500 sm:text-sm']) }}> 36 | @error($name) 37 |

{{ $message }}

38 | @enderror 39 |
40 |
41 | 42 | -------------------------------------------------------------------------------- /src/components/form/radio.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'name' => '', 3 | 'id' => '', 4 | 'label' => '', 5 | 'value' => '' 6 | ]) 7 | 8 | @if ($id === '') 9 | @php 10 | $id = $name; 11 | @endphp 12 | @endif 13 | 14 | @if ($label === '') 15 | @php 16 | //remove underscores from name 17 | $label = str_replace('_', ' ', $name); 18 | //detect subsequent letters starting with a capital 19 | $label = preg_split('/(?=[A-Z])/', $label); 20 | //display capital words with a space 21 | $label = implode(' ', $label); 22 | //uppercase first letter and lower the rest of a word 23 | $label = ucwords(strtolower($label)); 24 | @endphp 25 | @endif 26 | 27 |
28 | 29 | 30 |
31 | -------------------------------------------------------------------------------- /src/components/form/select-option-row.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'level' => 0, 3 | 'data' => null, 4 | 'id' => 'id', 5 | 'label' => 'title', 6 | 'value' => '', 7 | 'selected' => '' 8 | ]) 9 | 10 | @php 11 | if ($data->$id !='') { 12 | $value = $data->$id; 13 | } 14 | @endphp 15 | 16 | 17 | @foreach ($data->children as $child) 18 | 19 | @endforeach 20 | -------------------------------------------------------------------------------- /src/components/form/select-option.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'value' => '', 3 | 'selected' => '' 4 | ]) 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/form/select-search.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'data' => [], 3 | 'placeholder' => 'Select an option', 4 | 'limit' => 40, 5 | 'label' => '', 6 | 'required' => '' 7 | ]) 8 | 9 |
merge(['class' => "w-full"]) }} 25 | > 26 | 27 | 28 |
33 |
34 |
 
35 |
36 | @isset($attributes['multiple']) 37 |
38 | 44 |
45 | @else 46 |
47 |
48 |
49 |
50 |
51 |
52 | @endif 53 | 54 |
59 | 60 |
61 | 62 |
63 | 64 |
65 |
Gragr
66 | 83 |
84 |
85 |
86 |
87 | @error($attributes->wire('model')->value) 88 |

{{ $message }}

89 | @enderror 90 | 91 | @once 92 | 206 | 207 | @endonce -------------------------------------------------------------------------------- /src/components/form/select.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'required' => '', 3 | 'name' => '', 4 | 'id' => '', 5 | 'placeholder' => '', 6 | 'label' => '' 7 | ]) 8 | 9 | @if ($label === 'none') 10 | 11 | @elseif ($label === '') 12 | @php 13 | //remove underscores from name 14 | $label = str_replace('_', ' ', $name); 15 | //detect subsequent letters starting with a capital 16 | $label = preg_split('/(?=[A-Z])/', $label); 17 | //display capital words with a space 18 | $label = implode(' ', $label); 19 | //uppercase first letter and lower the rest of a word 20 | $label = ucwords(strtolower($label)); 21 | @endphp 22 | @endif 23 | 24 |
25 | @if ($label !='none') 26 | 27 | @endif 28 | 34 | @error($name) 35 |

{{ $message }}

36 | @enderror 37 |
38 | -------------------------------------------------------------------------------- /src/components/form/submit.blade.php: -------------------------------------------------------------------------------- 1 | merge(['class' => 'mt-5 btn btn-primary']) }}>{{ $slot }} 2 | -------------------------------------------------------------------------------- /src/components/form/textarea.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'name' => '', 3 | 'label' => '', 4 | 'value' => '', 5 | 'required' => '' 6 | ]) 7 | 8 | @if ($label === 'none') 9 | 10 | @elseif ($label === '') 11 | @php 12 | //remove underscores from name 13 | $label = str_replace('_', ' ', $name); 14 | //detect subsequent letters starting with a capital 15 | $label = preg_split('/(?=[A-Z])/', $label); 16 | //display capital words with a space 17 | $label = implode(' ', $label); 18 | //uppercase first letter and lower the rest of a word 19 | $label = ucwords(strtolower($label)); 20 | @endphp 21 | @endif 22 | 23 |
24 | @if ($label !='none') 25 | 26 | @endif 27 |
28 | 29 | @error($name) 30 |

{{ $message }}

31 | @enderror 32 |
33 |
34 | -------------------------------------------------------------------------------- /src/components/form/time.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'options' => [], 3 | 'required' => '', 4 | 'name' => '', 5 | 'label' => '', 6 | 'value' => '', 7 | ]) 8 | 9 | @if ($label === 'none') 10 | 11 | @elseif ($label === '') 12 | @php 13 | //remove underscores from name 14 | $label = str_replace('_', ' ', $name); 15 | //detect subsequent letters starting with a capital 16 | $label = preg_split('/(?=[A-Z])/', $label); 17 | //display capital words with a space 18 | $label = implode(' ', $label); 19 | //uppercase first letter and lower the rest of a word 20 | $label = ucwords(strtolower($label)); 21 | @endphp 22 | @endif 23 | 24 | @php 25 | $options = array_merge([ 26 | 'enableTime' => true, 27 | 'noCalendar' => true, 28 | 'dateFormat' => "H:i", 29 | 'time_24hr' => true 30 | ], $options); 31 | @endphp 32 | 33 |
34 | @if ($label !='none') 35 | 36 | @endif 37 |
38 | merge(['class' => 'mt-1 block w-full dark:bg-gray-500 dark:text-gray-200 dark:placeholder-gray-200 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-light-blue-500 focus:border-light-blue-500 sm:text-sm']) }}> 48 | @error($name) 49 |

{{ $message }}

50 | @enderror 51 |
52 |
-------------------------------------------------------------------------------- /src/components/form/timeday.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'options' => [], 3 | 'required' => '', 4 | 'name' => '', 5 | 'label' => '', 6 | 'value' => '', 7 | ]) 8 | 9 | @if ($label === 'none') 10 | 11 | @elseif ($label === '') 12 | @php 13 | //remove underscores from name 14 | $label = str_replace('_', ' ', $name); 15 | //detect subsequent letters starting with a capital 16 | $label = preg_split('/(?=[A-Z])/', $label); 17 | //display capital words with a space 18 | $label = implode(' ', $label); 19 | //uppercase first letter and lower the rest of a word 20 | $label = ucwords(strtolower($label)); 21 | @endphp 22 | @endif 23 | 24 | @php 25 | $options = array_merge([ 26 | 'enableTime' => true, 27 | 'noCalendar' => true, 28 | 'dateFormat' => "H:i", 29 | 'time_24hr' => true, 30 | 'minTime' => "08:00", 31 | 'maxTime' => "18:00" 32 | ], $options); 33 | @endphp 34 | 35 |
36 | @if ($label !='none') 37 | 38 | @endif 39 |
40 | merge(['class' => 'mt-1 block w-full dark:bg-gray-500 dark:text-gray-200 dark:placeholder-gray-200 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-light-blue-500 focus:border-light-blue-500 sm:text-sm']) }}> 50 | @error($name) 51 |

{{ $message }}

52 | @enderror 53 |
54 |
-------------------------------------------------------------------------------- /src/components/modal.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'title' => '', 3 | 'content' => '', 4 | 'footer' => '', 5 | 'height' => 'lg:w-1/2' 6 | ]) 7 | 8 |
9 | {{ $trigger }} 10 | 11 |
12 | 13 |
25 |
26 |
27 | 28 | 53 | 54 |
55 | 56 |
57 | -------------------------------------------------------------------------------- /src/components/nav/droplink.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | use Illuminate\Support\Str; 3 | @endphp 4 | 5 | @props(['href' => '', 'icon' => '']) 6 | 7 |
8 | @if ($icon) 9 | 10 | @endif 11 | {{ $slot }} 12 |
13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/components/nav/group-item.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'route' => '', 3 | 'icon' => '' 4 | ]) 5 | 7 | @if ($icon) 8 | 9 | @endif 10 | {{ $slot }} 11 | 12 | -------------------------------------------------------------------------------- /src/components/nav/group.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'label' => '', 3 | 'icon' => '', 4 | 'route' => '', 5 | 'open' => false 6 | ]) 7 | 8 | @php 9 | if ($open == true) { 10 | $openState = '{ isOpen: true }'; 11 | } else { 12 | $openState = Route::is($route.'*') ? '{ isOpen: true }' : '{ isOpen: false }'; 13 | } 14 | @endphp 15 | 16 |
17 |
18 |
19 | @if ($icon) 20 | 21 | @endif 22 | {{ $label }} 23 |
24 | 25 | 26 | 27 |
28 |
29 | {{ $slot }} 30 |
31 |
-------------------------------------------------------------------------------- /src/components/nav/link.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'route' => '', 3 | 'icon' => '' 4 | ]) 5 | 7 | @if ($icon) 8 | 9 | @endif 10 | {{ $slot }} 11 | -------------------------------------------------------------------------------- /src/components/tab.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'name' 3 | ]) 4 |
5 | {{ $slot }} 6 |
-------------------------------------------------------------------------------- /src/components/tabs/div.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'name' 3 | ]) 4 |
5 | {{ $slot }} 6 |
-------------------------------------------------------------------------------- /src/components/tabs/header.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 5 |
-------------------------------------------------------------------------------- /src/components/tabs/link.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'name' 3 | ]) 4 | 5 | merge(['class' => "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-300 dark:hover:text-gray-400 dark:hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"]) }} 10 | > 11 | {{ $slot }} 12 | -------------------------------------------------------------------------------- /tests/Pest.php: -------------------------------------------------------------------------------- 1 | in(__DIR__); 6 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | blade('Go') 6 | ->assertSee('button type="submit"', false); 7 | }); 8 | 9 | test('can render button as button type', function () { 10 | $this 11 | ->blade('Go') 12 | ->assertSee('button type="button"', false); 13 | }); 14 | 15 | test('can render button with class', function () { 16 | $this 17 | ->blade('Go') 18 | ->assertSee('button type="submit" class="btn btn-primary"', false); 19 | }); 20 | -------------------------------------------------------------------------------- /tests/Unit/BladeComponents/Form/CheckboxTest.php: -------------------------------------------------------------------------------- 1 | blade('') 6 | ->assertSee("type='checkbox'", false); 7 | }); 8 | 9 | test('can render checkbox with label', function () { 10 | test() 11 | ->blade('') 12 | ->assertSee('Agree to terms'); 13 | }); 14 | 15 | test('when id is not specified and the name is they should both be matched', function () { 16 | test() 17 | ->blade("") 18 | ->assertSee("id='terms'", false); 19 | }); 20 | 21 | test('checkbox is checked', function () { 22 | test() 23 | ->blade("") 24 | ->assertSee("checked='checked'", false); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/Unit/BladeComponents/Form/CkeditorTest.php: -------------------------------------------------------------------------------- 1 | blade('') 6 | ->assertSee("type='checkbox'", false); 7 | }); 8 | -------------------------------------------------------------------------------- /tests/Unit/BladeComponents/Form/FormTest.php: -------------------------------------------------------------------------------- 1 | blade('') 6 | ->assertSee('
blade('') 12 | ->assertSee('blade('') 18 | ->assertSee('blade('') 24 | ->assertSee('', false); 25 | }); 26 | 27 | test('can render form with a put method', function () { 28 | $this 29 | ->blade('') 30 | ->assertSee('', false); 31 | }); 32 | 33 | test('can render form with a delete method', function () { 34 | $this 35 | ->blade('') 36 | ->assertSee('', false); 37 | }); 38 | 39 | test('when using post form has a CSRF token input', function () { 40 | $this 41 | ->blade('') 42 | ->assertSee('', false); 43 | }); 44 | 45 | test('when using get form has not got a CSRF token input', function () { 46 | $this 47 | ->blade('') 48 | ->assertDontSee('', false); 49 | }); 50 | -------------------------------------------------------------------------------- /tests/Unit/BladeComponents/ModalTest.php: -------------------------------------------------------------------------------- 1 | blade(' 6 | 7 | 8 | 9 | Modal Title 10 | 11 |

The content

12 |
13 | 14 | 15 | 16 | 17 | 18 |
19 | ')->assertSee('Modal Title'); 20 | }); 21 | -------------------------------------------------------------------------------- /tests/Unit/BladeComponents/TabTest.php: -------------------------------------------------------------------------------- 1 | blade('') 6 | ->assertSee('sections'); 7 | }); 8 | 9 | test('can see tab header', function () { 10 | $this 11 | ->blade('') 12 | ->assertSee('border-b border-gray-200'); 13 | }); 14 | 15 | test('can see tab link', function () { 16 | $this 17 | ->blade('') 18 | ->assertSee('details'); 19 | }); 20 | 21 | test('can see active div', function () { 22 | $this 23 | ->blade('Some Text') 24 | ->assertSee('Some Text'); 25 | }); 26 | --------------------------------------------------------------------------------