Repository: nebulapackage/nebula
Branch: master
Commit: 7f57c2c42dcd
Files: 112
Total size: 125.1 KB
Directory structure:
gitextract_2bgbphje/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── CHANGELOG.md
│ ├── CONTRIBUTING.md
│ ├── FUNDING.yml
│ ├── LICENSE.md
│ ├── README.md
│ └── workflows/
│ └── tests.yml
├── .gitignore
├── .php_cs.dist
├── .prettierrc
├── composer.json
├── config/
│ └── nebula.php
├── package.json
├── phpunit.xml.dist
├── public/
│ ├── css/
│ │ └── app.css
│ └── mix-manifest.json
├── resources/
│ ├── css/
│ │ └── app.css
│ ├── lang/
│ │ ├── de.json
│ │ └── nl.json
│ └── views/
│ ├── components/
│ │ ├── card.blade.php
│ │ ├── container.blade.php
│ │ ├── error.blade.php
│ │ ├── fields/
│ │ │ ├── details/
│ │ │ │ ├── boolean.blade.php
│ │ │ │ ├── color.blade.php
│ │ │ │ ├── date.blade.php
│ │ │ │ ├── input.blade.php
│ │ │ │ ├── select.blade.php
│ │ │ │ └── textarea.blade.php
│ │ │ ├── forms/
│ │ │ │ ├── boolean.blade.php
│ │ │ │ ├── color.blade.php
│ │ │ │ ├── date.blade.php
│ │ │ │ ├── input.blade.php
│ │ │ │ ├── select.blade.php
│ │ │ │ └── textarea.blade.php
│ │ │ └── tables/
│ │ │ ├── boolean.blade.php
│ │ │ ├── color.blade.php
│ │ │ ├── date.blade.php
│ │ │ ├── input.blade.php
│ │ │ ├── select.blade.php
│ │ │ └── textarea.blade.php
│ │ ├── form-actions.blade.php
│ │ ├── form-row.blade.php
│ │ ├── form.blade.php
│ │ ├── helper-text.blade.php
│ │ ├── label.blade.php
│ │ ├── layouts/
│ │ │ ├── app.blade.php
│ │ │ └── shell.blade.php
│ │ ├── metric-card.blade.php
│ │ ├── metrics/
│ │ │ └── value.blade.php
│ │ └── pagination.blade.php
│ ├── dashboards/
│ │ ├── default-metrics.blade.php
│ │ ├── default.blade.php
│ │ └── index.blade.php
│ ├── pages/
│ │ └── index.blade.php
│ ├── resources/
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ └── start.blade.php
├── routes/
│ └── web.php
├── src/
│ ├── Console/
│ │ └── Commands/
│ │ ├── InstallCommand.php
│ │ ├── MakeDashboardCommand.php
│ │ ├── MakeFieldCommand.php
│ │ ├── MakeFilterCommand.php
│ │ ├── MakePageCommand.php
│ │ ├── MakeResourceCommand.php
│ │ ├── MakeValueMetricCommand.php
│ │ └── stubs/
│ │ ├── dashboard.stub
│ │ ├── field.stub
│ │ ├── filter.stub
│ │ ├── page.stub
│ │ ├── resource.stub
│ │ └── value.stub
│ ├── Contracts/
│ │ ├── NebulaDashboard.php
│ │ ├── NebulaField.php
│ │ ├── NebulaFilter.php
│ │ ├── NebulaMetric.php
│ │ ├── NebulaPage.php
│ │ ├── NebulaResource.php
│ │ ├── ShouldCache.php
│ │ ├── ShouldRender.php
│ │ └── ShouldSpanCols.php
│ ├── Fields/
│ │ ├── Boolean.php
│ │ ├── Color.php
│ │ ├── Concerns/
│ │ │ ├── HasHelperText.php
│ │ │ └── HasPlaceholder.php
│ │ ├── Date.php
│ │ ├── Input.php
│ │ ├── Select.php
│ │ └── Textarea.php
│ ├── Http/
│ │ ├── Concerns/
│ │ │ └── AuthorizesRequests.php
│ │ ├── Controllers/
│ │ │ ├── DashboardController.php
│ │ │ ├── PageController.php
│ │ │ ├── ResourceController.php
│ │ │ └── StartController.php
│ │ ├── Middleware/
│ │ │ ├── NebulaEmailAuthStrategy.php
│ │ │ └── NebulaIPAuthStrategy.php
│ │ └── RouteResolvers/
│ │ ├── DashboardResolver.php
│ │ ├── ItemResolver.php
│ │ ├── PageResolver.php
│ │ ├── Resolver.php
│ │ └── ResourceResolver.php
│ ├── Metrics/
│ │ └── ValueMetric.php
│ ├── Nebula.php
│ ├── NebulaServiceProvider.php
│ └── Traits/
│ └── Toasts.php
├── tailwind.config.js
├── tests/
│ ├── ConsoleCommandTest.php
│ ├── RegistrationMethodsTest.php
│ └── TestCase.php
└── webpack.mix.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.js]
indent_size = 2
================================================
FILE: .gitattributes
================================================
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.github export-ignore
/.php_cs.dist export-ignore
/.prettierrc export-ignore
================================================
FILE: .github/CHANGELOG.md
================================================
# Changelog
All notable changes to `nebula` will be documented in this file
## 0.2.0 - 2020-09-24
- Table components
- Better fields API
- Many "bug" fixes
- Resource queries
- Domain support by [Dennis Smink](https://github.com/Cannonb4ll)
- Cleaner code and GH workflows by [Gregori Piñeres](https://github.com/gregorip02)
## 0.1.0 - 2020-09-22
- initial public release
================================================
FILE: .github/CONTRIBUTING.md
================================================
# Contributing
Contributions are **welcome** and will be fully **credited**.
Please read and understand the contribution guide before creating an issue or pull request.
## Etiquette
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
extremely unfair for them to suffer abuse or anger for their hard work.
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
world that developers are civilized and selfless people.
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
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.
## Viability
When requesting or submitting new features, first consider whether it might be useful to others. Open
source projects are used by many developers, who may have entirely different needs to your own. Think about
whether or not your feature is likely to be used by other users of the project.
## Procedure
Before filing an issue:
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.
Before submitting a pull request:
- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
## Code quality
Please format your code with php-cs-fixer before submitting the pull request. You can format the code by executing `php-cs-fixer fix`.
**Happy coding**!
================================================
FILE: .github/FUNDING.yml
================================================
github: [larsklopstra]
================================================
FILE: .github/LICENSE.md
================================================
MIT License
Copyright (c) Lars Klopstra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: .github/README.md
================================================
# Nebula
<p align="center"><a href="https://nebulapackage.com" target="_blank"><img src="https://nebulapackage.com/preview.png"></a></p>
[](https://packagist.org/packages/larsklopstra/nebula)
[](https://packagist.org/packages/larsklopstra/nebula)
Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS.
Nebula makes you write less code and lets you focus more on the product by lessening the code required to build CRUD interfaces and metrics. Nebula offers a rich CLI and a set of metrics and form fields that does the heavy lifting for you.
**This is the pre 1.0.0 version, the API might be subject to change. Please be careful with using this version in production apps.**
Join our [Discord](https://discord.gg/xRndbjE) if you have any questions or would like to be an active member in the Nebula community.
## Installation
You can install the package via composer:
```bash
composer require larsklopstra/nebula
```
## Usage
Please read the documentation at [nebulapackage.com](https://nebulapackage.com).
### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email larsklopstra@gmail.com instead of using the issue tracker.
## Credits
- [Lars Klopstra](https://github.com/larsklopstra)
- [All Contributors](https://github.com/nebulapackage/nebula/graphs/contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
## Laravel Package Boilerplate
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).
================================================
FILE: .github/workflows/tests.yml
================================================
name: Tests
on:
push:
pull_request:
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [7.4]
os: [ubuntu-latest]
name: PHP${{ matrix.php }} on ${{ matrix.os }}
container:
image: lorisleiva/laravel-docker:${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Validate composer files
run: composer validate
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction
- name: Run tests
run: vendor/bin/phpunit
================================================
FILE: .gitignore
================================================
build
composer.lock
docs
vendor
coverage
node_modules
.php_cs.cache
.idea
.phpunit.result.cache
================================================
FILE: .php_cs.dist
================================================
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => ['return']
],
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => ['method']
],
'class_definition' => true,
'concat_space' => [
'spacing' => 'none'
],
'declare_equal_normalize' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'fully_qualified_strict_types' => true, // added by Shift
'function_declaration' => true,
'function_typehint_space' => true,
'heredoc_to_nowdoc' => true,
'include' => true,
'increment_style' => ['style' => 'post'],
'indentation_type' => true,
'linebreak_after_opening_tag' => true,
'line_ending' => true,
'lowercase_cast' => true,
'lowercase_constants' => true,
'lowercase_keywords' => true,
'lowercase_static_reference' => true, // added from Symfony
'magic_method_casing' => true, // added from Symfony
'magic_constant_casing' => true,
'method_argument_space' => true,
'native_function_casing' => true,
'no_alias_functions' => true,
'no_extra_blank_lines' => [
'tokens' => [
'extra',
'throw',
'use',
'use_trait',
]
],
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => [
'use' => 'echo'
],
'no_multiline_whitespace_around_double_arrow' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line'
],
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_no_access' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'psr4' => true,
'self_accessor' => true,
'short_scalar_cast' => true,
'simplified_null_return' => false, // disabled by Shift
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_style' => [
'comment_types' => ['hash']
],
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => ['method', 'property']
],
'whitespace_after_comma_in_array' => true,
];
$project_path = getcwd();
$finder = Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/routes',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return Config::create()
->setFinder($finder)
->setRules($rules)
->setRiskyAllowed(true)
->setUsingCache(true);
================================================
FILE: .prettierrc
================================================
{
"arrowParens": "avoid",
"tabWidth": 2,
"printWidth": 100,
"vueIndentScriptAndStyle": false,
"quoteProps": "consistent",
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}
================================================
FILE: composer.json
================================================
{
"name": "larsklopstra/nebula",
"description": "Nebula, an open-source and easy to use admin panel for Laravel.",
"keywords": [
"larsklopstra",
"nebula"
],
"homepage": "https://github.com/larsklopstra/nebula",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "Lars Klopstra",
"email": "larsklopstra@gmail.com",
"role": "Developer"
}
],
"require": {
"php": "^7.4",
"blade-ui-kit/blade-heroicons": "^0.2.2",
"illuminate/console": "^8.0",
"illuminate/database": "^8.0",
"illuminate/http": "^8.0",
"illuminate/support": "^8.0",
"illuminate/view": "^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^8.0"
},
"autoload": {
"psr-4": {
"Larsklopstra\\Nebula\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Larsklopstra\\Nebula\\Tests\\": "tests"
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Larsklopstra\\Nebula\\NebulaServiceProvider"
]
}
}
}
================================================
FILE: config/nebula.php
================================================
<?php
use Larsklopstra\Nebula\Http\Middleware\NebulaIPAuthStrategy;
return [
'name' => 'Nebula',
'prefix' => '/nebula',
'domain' => null,
'auth_strategy' => NebulaIPAuthStrategy::class,
'allowed_ips' => [
'127.0.0.1',
],
'allowed_emails' => [
// 'admin@example.com',
],
'resources' => [
// new UserResource,
],
'dashboards' => [
// new UserDashboard,
],
'pages' => [
// new CustomPage,
],
];
================================================
FILE: package.json
================================================
{
"name": "nebula",
"description": "Nebula, a Laravel dashboard",
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"author": "Lars Klopstra",
"license": "MIT",
"dependencies": {
"@tailwindcss/custom-forms": "^0.2.1",
"cross-env": "^7.0.2",
"laravel-mix": "^5.0.5",
"prettier": "^2.1.1",
"tailwindcss": "^1.8.2"
}
}
================================================
FILE: phpunit.xml.dist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
================================================
FILE: public/css/app.css
================================================
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}details{display:block}summary{display:list-item}[hidden],template{display:none}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{box-sizing:border-box;border:0 solid #d2d6dc}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#a0aec0}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#a0aec0}input::placeholder,textarea::placeholder{color:#a0aec0}button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}code,kbd,pre,samp{font-family:DM mono,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#e2e8f0;border-width:1px;border-radius:.25rem;padding:.5rem .75rem;font-size:1rem;line-height:1.5}.form-input::-moz-placeholder{color:#a0aec0;opacity:1}.form-input:-ms-input-placeholder{color:#a0aec0;opacity:1}.form-input::placeholder{color:#a0aec0;opacity:1}.form-input:focus{outline:none;box-shadow:0 0 0 3px rgba(66,153,225,.5);border-color:#63b3ed}.form-textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#e2e8f0;border-width:1px;border-radius:.25rem;padding:.5rem .75rem;font-size:1rem;line-height:1.5}.form-textarea::-moz-placeholder{color:#a0aec0;opacity:1}.form-textarea:-ms-input-placeholder{color:#a0aec0;opacity:1}.form-textarea::placeholder{color:#a0aec0;opacity:1}.form-textarea:focus{outline:none;box-shadow:0 0 0 3px rgba(66,153,225,.5);border-color:#63b3ed}.form-select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a0aec0'%3E%3Cpath d='M15.3 9.3a1 1 0 011.4 1.4l-4 4a1 1 0 01-1.4 0l-4-4a1 1 0 011.4-1.4l3.3 3.29 3.3-3.3z'/%3E%3C/svg%3E");-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact;background-repeat:no-repeat;background-color:#fff;border-color:#e2e8f0;border-width:1px;border-radius:.25rem;padding:.5rem 2.5rem .5rem .75rem;font-size:1rem;line-height:1.5;background-position:right .5rem center;background-size:1.5em 1.5em}.form-select::-ms-expand{color:#a0aec0;border:none}@media not print{.form-select::-ms-expand{display:none}}@media print and (-ms-high-contrast:active),print and (-ms-high-contrast:none){.form-select{padding-right:.75rem}}.form-select:focus{outline:none;box-shadow:0 0 0 3px rgba(66,153,225,.5);border-color:#63b3ed}.form-checkbox:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.707 7.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4a1 1 0 00-1.414-1.414L7 8.586 5.707 7.293z'/%3E%3C/svg%3E");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:50%;background-repeat:no-repeat}@media not print{.form-checkbox::-ms-check{border-width:1px;color:transparent;background:inherit;border-color:inherit;border-radius:inherit}}.form-checkbox{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;flex-shrink:0;height:1em;width:1em;color:#4299e1;background-color:#fff;border-color:#e2e8f0;border-width:1px;border-radius:.25rem}.form-checkbox:focus{outline:none;box-shadow:0 0 0 3px rgba(66,153,225,.5);border-color:#63b3ed}.button{border-radius:.375rem;display:inline-flex;align-items:center;justify-content:center;font-weight:500;height:2.25rem;font-size:.875rem;line-height:1.25rem}.button:focus{outline:0}.button{padding-left:.75rem;padding-right:.75rem;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.button-primary{--bg-opacity:1;background-color:#1c64f2;background-color:rgba(28,100,242,var(--bg-opacity))}.button-primary:hover{--bg-opacity:1;background-color:#3f83f8;background-color:rgba(63,131,248,var(--bg-opacity))}.button-primary:focus{--bg-opacity:1;background-color:#1a56db;background-color:rgba(26,86,219,var(--bg-opacity))}.button-primary{box-shadow:0 1px 1px 0 rgba(0,0,0,.12),0 2px 4px 0 rgba(0,0,0,.04),0 2px 8px 0 rgba(0,0,0,.02);--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.button-secondary{--bg-opacity:1;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity))}.button-secondary:focus{--bg-opacity:1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--bg-opacity))}.button-secondary{--border-opacity:1;border-color:#d2d6dc;border-color:rgba(210,214,220,var(--border-opacity))}.button-secondary:hover{--border-opacity:1;border-color:#e5e7eb;border-color:rgba(229,231,235,var(--border-opacity))}.button-secondary{border-width:1px;box-shadow:0 1px 1px 0 rgba(0,0,0,.08),0 2px 3px 0 rgba(0,0,0,.02),0 3px 6px 0 rgba(0,0,0,.01);--text-opacity:1;color:#252f3f;color:rgba(37,47,63,var(--text-opacity))}.button-secondary:hover{--text-opacity:1;color:#4b5563;color:rgba(75,85,99,var(--text-opacity))}.icon-button:focus{outline:0}.icon-button{--text-opacity:1;color:#9fa6b2;color:rgba(159,166,178,var(--text-opacity))}.icon-button:hover{--text-opacity:1;color:#d2d6dc;color:rgba(210,214,220,var(--text-opacity))}.icon-button:focus{--text-opacity:1;color:#6b7280;color:rgba(107,114,128,var(--text-opacity))}.icon-button{transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.space-y-1>:not(template)~:not(template){--space-y-reverse:0;margin-top:calc(0.25rem*(1 - var(--space-y-reverse)));margin-bottom:calc(0.25rem*var(--space-y-reverse))}.space-x-1>:not(template)~:not(template){--space-x-reverse:0;margin-right:calc(0.25rem*var(--space-x-reverse));margin-left:calc(0.25rem*(1 - var(--space-x-reverse)))}.space-y-2>:not(template)~:not(template){--space-y-reverse:0;margin-top:calc(0.5rem*(1 - var(--space-y-reverse)));margin-bottom:calc(0.5rem*var(--space-y-reverse))}.space-y-4>:not(template)~:not(template){--space-y-reverse:0;margin-top:calc(1rem*(1 - var(--space-y-reverse)));margin-bottom:calc(1rem*var(--space-y-reverse))}.space-x-4>:not(template)~:not(template){--space-x-reverse:0;margin-right:calc(1rem*var(--space-x-reverse));margin-left:calc(1rem*(1 - var(--space-x-reverse)))}.space-x-6>:not(template)~:not(template){--space-x-reverse:0;margin-right:calc(1.5rem*var(--space-x-reverse));margin-left:calc(1.5rem*(1 - var(--space-x-reverse)))}.space-y-8>:not(template)~:not(template){--space-y-reverse:0;margin-top:calc(2rem*(1 - var(--space-y-reverse)));margin-bottom:calc(2rem*var(--space-y-reverse))}.space-x-px>:not(template)~:not(template){--space-x-reverse:0;margin-right:calc(1px*var(--space-x-reverse));margin-left:calc(1px*(1 - var(--space-x-reverse)))}.divide-y>:not(template)~:not(template){--divide-y-reverse:0;border-top-width:calc(1px*(1 - var(--divide-y-reverse)));border-bottom-width:calc(1px*var(--divide-y-reverse))}.divide-x>:not(template)~:not(template){--divide-x-reverse:0;border-right-width:calc(1px*var(--divide-x-reverse));border-left-width:calc(1px*(1 - var(--divide-x-reverse)))}.divide-gray-200>:not(template)~:not(template){--divide-opacity:1;border-color:#e5e7eb;border-color:rgba(229,231,235,var(--divide-opacity))}.bg-current{background-color:currentColor}.bg-white{--bg-opacity:1;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity))}.bg-gray-50{--bg-opacity:1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--bg-opacity))}.bg-gray-100{--bg-opacity:1;background-color:#f4f5f7;background-color:rgba(244,245,247,var(--bg-opacity))}.bg-gray-200{--bg-opacity:1;background-color:#e5e7eb;background-color:rgba(229,231,235,var(--bg-opacity))}.bg-gray-800{--bg-opacity:1;background-color:#252f3f;background-color:rgba(37,47,63,var(--bg-opacity))}.bg-gray-900{--bg-opacity:1;background-color:#161e2e;background-color:rgba(22,30,46,var(--bg-opacity))}.bg-primary-50{--bg-opacity:1;background-color:#ebf5ff;background-color:rgba(235,245,255,var(--bg-opacity))}.bg-success-100{--bg-opacity:1;background-color:#def7ec;background-color:rgba(222,247,236,var(--bg-opacity))}.bg-danger-100{--bg-opacity:1;background-color:#fde8e8;background-color:rgba(253,232,232,var(--bg-opacity))}.focus\:bg-gray-50:focus{--bg-opacity:1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--bg-opacity))}.border-gray-200{--border-opacity:1;border-color:#e5e7eb;border-color:rgba(229,231,235,var(--border-opacity))}.border-gray-300{--border-opacity:1;border-color:#d2d6dc;border-color:rgba(210,214,220,var(--border-opacity))}.border-gray-700{--border-opacity:1;border-color:#374151;border-color:rgba(55,65,81,var(--border-opacity))}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-t{border-top-width:1px}.border-b{border-bottom-width:1px}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.flex-1{flex:1 1 0%}.font-sans{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-mono{font-family:DM mono,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-display{font-family:DM Sans,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-medium{font-weight:500}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-screen{height:100vh}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem}.text-lg,.text-xl{line-height:1.75rem}.text-xl{font-size:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.m-3{margin:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mx-auto{margin-left:auto;margin-right:auto}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mr-2{margin-right:.5rem}.mb-2{margin-bottom:.5rem}.mt-4{margin-top:1rem}.mb-8{margin-bottom:2rem}.-mt-5{margin-top:-1.25rem}.max-w-xs{max-width:20rem}.max-w-md{max-width:28rem}.max-w-lg{max-width:32rem}.max-w-6xl{max-width:72rem}.min-h-screen{min-height:100vh}.focus\:outline-none:focus{outline:0}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.placeholder-gray-500::-moz-placeholder{--placeholder-opacity:1;color:#6b7280;color:rgba(107,114,128,var(--placeholder-opacity))}.placeholder-gray-500:-ms-input-placeholder{--placeholder-opacity:1;color:#6b7280;color:rgba(107,114,128,var(--placeholder-opacity))}.placeholder-gray-500::placeholder{--placeholder-opacity:1;color:#6b7280;color:rgba(107,114,128,var(--placeholder-opacity))}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.sticky{position:-webkit-sticky;position:sticky}.inset-y-0{top:0;bottom:0}.top-0{top:0}.right-0{right:0}.bottom-0{bottom:0}.shadow-sm{box-shadow:0 1px 1px 0 rgba(0,0,0,.08),0 2px 3px 0 rgba(0,0,0,.02),0 3px 6px 0 rgba(0,0,0,.01)}.shadow{box-shadow:0 1px 1px 0 rgba(0,0,0,.12),0 2px 4px 0 rgba(0,0,0,.04),0 2px 8px 0 rgba(0,0,0,.02)}.shadow-xl{box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04)}.table-auto{table-layout:auto}.text-left{text-align:left}.text-center{text-align:center}.text-white{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.text-gray-300{--text-opacity:1;color:#d2d6dc;color:rgba(210,214,220,var(--text-opacity))}.text-gray-400{--text-opacity:1;color:#9fa6b2;color:rgba(159,166,178,var(--text-opacity))}.text-gray-500{--text-opacity:1;color:#6b7280;color:rgba(107,114,128,var(--text-opacity))}.text-gray-600{--text-opacity:1;color:#4b5563;color:rgba(75,85,99,var(--text-opacity))}.text-gray-700{--text-opacity:1;color:#374151;color:rgba(55,65,81,var(--text-opacity))}.text-gray-800{--text-opacity:1;color:#252f3f;color:rgba(37,47,63,var(--text-opacity))}.text-primary-600{--text-opacity:1;color:#1c64f2;color:rgba(28,100,242,var(--text-opacity))}.text-primary-700{--text-opacity:1;color:#1a56db;color:rgba(26,86,219,var(--text-opacity))}.text-success-600{--text-opacity:1;color:#057a55;color:rgba(5,122,85,var(--text-opacity))}.text-success-900{--text-opacity:1;color:#014737;color:rgba(1,71,55,var(--text-opacity))}.text-danger-600{--text-opacity:1;color:#e02424;color:rgba(224,36,36,var(--text-opacity))}.text-danger-900{--text-opacity:1;color:#771d1d;color:rgba(119,29,29,var(--text-opacity))}.hover\:text-gray-400:hover{--text-opacity:1;color:#9fa6b2;color:rgba(159,166,178,var(--text-opacity))}.hover\:text-primary-500:hover{--text-opacity:1;color:#3f83f8;color:rgba(63,131,248,var(--text-opacity))}.focus\:text-primary-700:focus{--text-opacity:1;color:#1a56db;color:rgba(26,86,219,var(--text-opacity))}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-10{width:2.5rem}.w-16{width:4rem}.w-64{width:16rem}.w-full{width:100%}.z-10{z-index:10}.z-50{z-index:50}.gap-2{grid-gap:.5rem;gap:.5rem}.gap-4{grid-gap:1rem;gap:1rem}.gap-6{grid-gap:1.5rem;gap:1.5rem}.gap-px{grid-gap:1px;gap:1px}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-5{grid-column:span 5/span 5}.col-span-6{grid-column:span 6/span 6}.col-span-7{grid-column:span 7/span 7}.col-span-8{grid-column:span 8/span 8}.col-span-9{grid-column:span 9/span 9}.col-span-10{grid-column:span 10/span 10}.col-span-11{grid-column:span 11/span 11}.col-span-12{grid-column:span 12/span 12}.transition{transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150{transition-duration:.15s}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@media (min-width:640px){.sm\:flex{display:flex}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mt-0{margin-top:0}.sm\:px-8{padding-left:2rem;padding-right:2rem}}@media (min-width:768px){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:col-span-2{grid-column:span 2/span 2}}@media (min-width:1024px){.lg\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:flex-row{flex-direction:row}.lg\:h-16{height:4rem}}
================================================
FILE: public/mix-manifest.json
================================================
{
"/css/app.css": "/css/app.css?id=e4cc3cee8f0618af5d92"
}
================================================
FILE: resources/css/app.css
================================================
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.button {
@apply inline-flex items-center justify-center px-3 text-sm font-medium transition duration-150 ease-in-out rounded-md h-9 focus:outline-none;
}
.button-primary {
@apply text-white shadow bg-primary-600 hover:bg-primary-500 focus:bg-primary-700;
}
.button-secondary {
@apply text-gray-800 bg-white border border-gray-300 shadow-sm hover:text-gray-600 hover:border-gray-200 focus:bg-gray-50;
}
.icon-button {
@apply text-gray-400 transition duration-150 ease-in-out focus:outline-none hover:text-gray-300 focus:text-gray-500;
}
}
================================================
FILE: resources/lang/de.json
================================================
{
"Resources": "Resourcen",
":Resources overview": ":Resourcen Übersicht",
":Resource details": ":Resource Details",
"Create :resource": ":Resource anlegen",
"Edit :resource": ":Resource bearbeiten",
"Update :resource": ":Resource speichern",
"Delete :resource": ":Resource löschen",
"Back to :resources": "Zurück zu :resources",
":Resource created": ":Resource angelegt",
":Resource updated": ":Resource gespeichert",
":Resource deleted": ":Resource gelöscht",
"Expand :field": ":Field erweitern",
"Collapse :field": ":Field einklappen",
"Select filter": "Filter auswählen",
"Apply filters": "Filter anwenden",
"Remove filters": "Filter zurücksetzen",
"Search anything...": "Suchen...",
"Are you sure?": "Bist du sicher?",
"Last month": "Letzter Monat",
"No :resources found": "Keine :resources gefunden",
":Resources you've created will show up here.": ":Resources die du angelegt hast werden hier angezeigt.",
":count result | :count results": ":count Ergebnis | :count Ergebnisse"
}
================================================
FILE: resources/lang/nl.json
================================================
{
"Resources": "Bronnen",
":Resources overview": ":Resources overzicht",
":Resource details": ":Resource details",
"Create :resource": ":Resource aanmaken",
"Edit :resource": ":Resource bewerken",
"Update :resource": ":Resource bijwerken",
"Delete :resource": ":Resource verwijderen",
"Back to :resources": "Terug naar :resources",
":Resource created": ":Resource aangemaakt",
":Resource updated": ":Resource bijgewerkt",
":Resource deleted": ":Resource verwijderd",
"Expand :field": ":Field uitklappen",
"Collapse :field": ":Field inklappen",
"Select filter": "Selecteer filter",
"Apply filters": "Filters toepassen",
"Remove filters": "Filters verwijderen",
"Search anything...": "Zoeken in...",
"Are you sure?": "Weetje het zeker?",
"Last month": "Afgelopen maand",
"No :resources found": "Geen :resources gevonden",
":Resources you've created will show up here.": ":Resources die jij hebt aangemaakt worden hier getoond.",
":count result | :count results": ":count resultaat | :count resultaten"
}
================================================
FILE: resources/views/components/card.blade.php
================================================
@props(['title' => false])
<div class="overflow-hidden bg-white divide-y divide-gray-200 rounded-lg shadow">
@if ($title)
<header class="px-6 py-4">
<h2 class="text-lg font-medium font-display">
{{ $title }}
</h2>
</header>
@endif
{{ $slot }}
</div>
================================================
FILE: resources/views/components/container.blade.php
================================================
<div class="w-full max-w-6xl px-4 mx-auto sm:px-8">
{{ $slot }}
</div>
================================================
FILE: resources/views/components/error.blade.php
================================================
@props(['for'])
@error($for->getName())
<p class="text-sm font-medium text-danger-600">{{ $message }}</p>
@enderror
================================================
FILE: resources/views/components/fields/details/boolean.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
@if (Arr::get($item, $field->getName()) ?? $field->getValue())
<span class="inline-block px-3 py-1 font-mono text-sm font-medium rounded-full bg-success-100 text-success-600">
{{ $field->getTrue() }}
</span>
@else
<span class="inline-block px-3 py-1 font-mono text-sm font-medium rounded-full bg-danger-100 text-danger-600">
{{ $field->getFalse() }}
</span>
@endif
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/details/color.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<div class="w-8 h-8 bg-current rounded"
style="color: {{ Arr::get($item, $field->getName()) ?? $field->getValue() }}"></div>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/details/date.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<p class="text-sm">
{{ $field->applyFormat(Arr::get($item, $field->getName()) ?? $field->getValue()) }}
</p>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/details/input.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<p class="text-sm">
{{ Arr::get($item, $field->getName()) ?? $field->getValue() }}
</p>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/details/select.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<p class="text-sm">
{{ array_search(Arr::get($item, $field->getName()) ?? $field->getValue(), $field->getOptions()) }}
</p>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/details/textarea.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<div x-data="{ expanded: false }">
<p x-show.transition.opacity="expanded" class="mb-2 text-sm">
{{ Arr::get($item, $field->getName()) ?? $field->getValue() }}
</p>
<button x-on:click="expanded = !expanded"
class="text-sm font-medium duration-150 ease-in-out text-primary-600 focus:outline-none focus:text-primary-700 hover:text-primary-500">
<span x-show="!expanded">
{{ __('Expand :field', ['field' => $field->getlabel()]) }}
</span>
<span x-show="expanded">
{{ __('Collapse :field', ['field' => $field->getlabel()]) }}
</span>
</button>
</div>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/forms/boolean.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<input type="hidden" value="0" name="{{ $field->getName() }}">
<div class="space-y-2">
<input class="block border border-gray-300 shadow-sm form-checkbox" id="{{ $field->getName() }}" value="1"
{{ old($field->getName()) ?? (Arr::get($item, $field->getName()) ?? $field->getValue()) ? 'checked' : '' }}
name="{{ $field->getName() }}" type="checkbox">
<x-nebula::error :for="$field" />
</div>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/forms/color.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<div class="space-y-2">
<div class="flex flex-wrap gap-2">
@foreach ($field->getColors() as $color)
<input
{{ (old($field->getName()) ?? (Arr::get($item, $field->getName()) ?? $field->getValue())) === $color ? 'checked' : '' }}
{{ $field->getRequired() ? 'required' : '' }} name="{{ $field->getName() }}"
id="{{ $field->getName() }}" type="radio" class="w-8 h-8 bg-current form-checkbox"
value="{{ $color }}" style="color: {{ $color }}" />
@endforeach
</div>
<x-nebula::error :for="$field" />
</div>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/forms/date.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<div class="space-y-2">
<input class="block w-full max-w-lg border border-gray-300 rounded-lg shadow-sm form-input sm:text-sm"
id="{{ $field->getName() }}"
value="{{ old($field->getName()) ?? (Arr::get($item, $field->getName()) ?? $field->getValue()) }}"
{{ $field->getRequired() ? 'required' : '' }} name="{{ $field->getName() }}" type="date">
<x-nebula::error :for="$field" />
<x-nebula::helper-text :for="$field" />
</div>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/forms/input.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<div class="space-y-2">
<input class="block w-full max-w-lg border border-gray-300 rounded-lg shadow-sm form-input sm:text-sm"
placeholder="{{ $field->getPlaceholder() }}" id="{{ $field->getName() }}"
value="{{ old($field->getName()) ?? (Arr::get($item, $field->getName()) ?? $field->getValue()) }}"
{{ $field->getRequired() ? 'required' : '' }} name="{{ $field->getName() }}" type="{{ $field->getType() }}">
<x-nebula::error :for="$field" />
<x-nebula::helper-text :for="$field" />
</div>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/forms/select.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<div class="space-y-2">
<select class="block w-full max-w-lg border border-gray-300 rounded-lg shadow-sm form-select sm:text-sm"
id="{{ $field->getName() }}" {{ $field->getRequired() ? 'required' : '' }} name="{{ $field->getName() }}">
<option value="">Select an option</option>
@empty(!$field->getOptions())
@foreach ($field->getOptions() as $key => $value)
<option
{{ (old($field->getName()) ?? (Arr::get($item, $field->getName()) ?? $field->getValue())) == $value ? 'selected' : '' }}
value="{{ $value }}">
{{ $key }}
</option>
@endforeach
@endempty
</select>
<x-nebula::error :for="$field" />
<x-nebula::helper-text :for="$field" />
</div>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/forms/textarea.blade.php
================================================
@props(['field', 'item' => null])
<x-nebula::form-row :field="$field">
<div class="space-y-2">
<textarea class="block w-full border border-gray-300 rounded-lg shadow-sm sm:text-sm form-textarea"
placeholder="{{ $field->getPlaceholder() }}" {{ $field->getRequired() ? 'required' : '' }}
id="{{ $field->getName() }}"
name="{{ $field->getName() }}">{{ old($field->getName()) ?? (Arr::get($item, $field->getName()) ?? $field->getValue()) }}</textarea>
<x-nebula::error :for="$field" />
<x-nebula::helper-text :for="$field" />
</div>
</x-nebula::form-row>
================================================
FILE: resources/views/components/fields/tables/boolean.blade.php
================================================
@props(['field', 'item' => null])
@if (Arr::get($item, $field->getName()) ?? $field->getValue())
<span class="inline-block px-3 py-1 font-mono text-sm font-medium rounded-full bg-success-100 text-success-600">
{{ $field->getTrue() }}
</span>
@else
<span class="inline-block px-3 py-1 font-mono text-sm font-medium rounded-full bg-danger-100 text-danger-600">
{{ $field->getFalse() }}
</span>
@endif
================================================
FILE: resources/views/components/fields/tables/color.blade.php
================================================
@props(['field', 'item'])
<div class="w-4 h-4 bg-current rounded" style="color: {{ Arr::get($item, $field->getName()) ?? $field->getValue() }}">
</div>
================================================
FILE: resources/views/components/fields/tables/date.blade.php
================================================
@props(['field', 'item'])
{{ $field->applyFormat(Arr::get($item, $field->getName()) ?? $field->getValue()) }}
================================================
FILE: resources/views/components/fields/tables/input.blade.php
================================================
@props(['field', 'item'])
{{ Arr::get($item, $field->getName()) }}
================================================
FILE: resources/views/components/fields/tables/select.blade.php
================================================
@props(['field', 'item'])
{{ array_search(Arr::get($item, $field->getName()) ?? $field->getValue(), $field->getOptions()) }}
================================================
FILE: resources/views/components/fields/tables/textarea.blade.php
================================================
@props(['field', 'item'])
{{ Str::limit(Arr::get($item, $field->getName()), 24, '...') }}
================================================
FILE: resources/views/components/form-actions.blade.php
================================================
<footer class="flex items-center justify-end px-6 py-4 space-x-4">
{{ $slot }}
</footer>
================================================
FILE: resources/views/components/form-row.blade.php
================================================
<div class="grid md:grid-cols-3">
<div class="px-6 py-3">
<x-nebula::label :for="$field->getName()">
{{ $field->getLabel() }}
</x-nebula::label>
</div>
<div class="px-6 py-3 -mt-5 sm:mt-0 md:col-span-2">
{{ $slot }}
</div>
</div>
================================================
FILE: resources/views/components/form.blade.php
================================================
@props(['method' => 'POST', 'action' => ''])
<form action="{{ $action }}" method="{{ $method !== 'GET' ? 'POST' : 'GET' }}">
{{ $slot }}
@csrf
@method($method)
</form>
================================================
FILE: resources/views/components/helper-text.blade.php
================================================
@props(['for'])
@if($for->getHelperText())
<p class="text-sm font-medium text-gray-600">{{ $for->getHelperText() }}</p>
@enderror
================================================
FILE: resources/views/components/label.blade.php
================================================
@props(['for' => null])
<label class="text-sm font-medium text-gray-700" for="{{ $for }}">
{{ $slot }}
</label>
================================================
FILE: resources/views/components/layouts/app.blade.php
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ config('nebula.name') }}</title>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@500&family=Inter:wght@400;500&display=swap"
rel="stylesheet">
<link href="{{ mix('css/app.css', 'vendor/nebula') }}" rel="stylesheet">
@stack('styles')
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.6.0/dist/alpine.min.js" defer></script>
@stack('scripts')
</head>
<body class="font-sans antialiased text-gray-800 bg-gray-900">
{{ $slot }}
@if ($message = session('toast'))
<div class="fixed bottom-0 right-0 z-50 w-full max-w-xs m-3 pointer-events-none">
<div x-show.transition.duration.350ms="isOpen" x-data="{ isOpen: false }"
x-init="setTimeout(() => isOpen = true, 500)"
class="flex items-center justify-between p-4 space-x-4 bg-white rounded-lg shadow-xl pointer-events-auto">
<p class="text-base font-medium font-display">
{{ $message }}
</p>
<button x-on:click="isOpen = false" class="icon-button">
<x-heroicon-o-x class="w-6 h-6"></x-heroicon-o-x>
</button>
</div>
</div>
@endif
</body>
</html>
================================================
FILE: resources/views/components/layouts/shell.blade.php
================================================
@props(['title' => config('nebula.name'), 'actions' => null, 'contextMenu' => null, 'back' => false])
<x-nebula::layouts.app>
<div class="flex flex-col min-h-screen lg:flex-row">
<aside x-data="{ menuOpen: false }" class="flex flex-col text-white bg-gray-900 lg:hidden">
<header class="flex items-center justify-between h-16 px-4">
<div>
<p class="w-full text-base font-medium truncate font-display">{{ config('nebula.name') }}</p>
</div>
<button x-on:click="menuOpen = !menuOpen"
class="flex items-center justify-center w-10 h-10 bg-gray-800 rounded-lg">
<x-heroicon-s-menu class="w-6 h-6 text-gray-400" />
</button>
</header>
<nav x-show.transition.opacity="menuOpen" class="border-t border-gray-700">
@if ($dashboards = \Larsklopstra\Nebula\Nebula::availableDashboards())
<ul class="px-2 my-4 space-y-1">
<li>
<p class="flex items-center h-8 px-2 text-xs font-medium text-gray-300 uppercase">
{{ __('Dashboards') }}
</p>
</li>
@foreach ($dashboards as $dashboard)
<li>
<a class="flex items-center h-10 px-2 text-sm font-medium text-gray-300 capitalize rounded-lg"
href="{{ route('nebula.dashboards.index', $dashboard->name()) }}">
{{ svg("heroicon-o-{$dashboard->icon()}", ['class' => 'w-5 h-5 mr-2 text-gray-400']) }}
{{ $dashboard->pluralName() }}
</a>
</li>
@endforeach
</ul>
@endif
@if($resources = \Larsklopstra\Nebula\Nebula::availableResources())
<ul class="px-2 my-4 space-y-1">
<li>
<p class="flex items-center h-8 px-2 text-xs font-medium text-gray-300 uppercase">
{{ __('Resources') }}
</p>
</li>
@foreach ($resources as $resource)
<li>
<a class="flex items-center h-10 px-2 text-sm font-medium text-gray-300 capitalize rounded-lg"
href="{{ route('nebula.resources.index', $resource->name()) }}">
{{ svg("heroicon-o-{$resource->icon()}", ['class' => 'w-5 h-5 mr-2 text-gray-400']) }}
{{ $resource->pluralName() }}
</a>
</li>
@endforeach
</ul>
@endif
@if($pages = \Larsklopstra\Nebula\Nebula::availablePages())
<ul class="px-2 my-4 space-y-1">
<li>
<p class="flex items-center h-8 px-2 text-xs font-medium text-gray-300 uppercase">
{{ __('Pages') }}
</p>
</li>
@foreach ($pages as $page)
<li>
<a class="flex items-center h-10 px-2 text-sm font-medium text-gray-300 capitalize rounded-lg"
href="{{ route('nebula.pages.index', $page->name()) }}">
{{ svg("heroicon-o-{$page->icon()}", ['class' => 'w-5 h-5 mr-2 text-gray-400']) }}
{{ $page->name() }}
</a>
</li>
@endforeach
</ul>
@endif
</nav>
</aside>
<aside class="sticky inset-y-0 top-0 flex-col hidden w-64 h-screen text-white bg-gray-900 lg:flex">
<header class="flex flex-col items-start justify-center h-16 px-4 border-b border-gray-700">
<p class="w-full text-base font-medium truncate font-display">{{ config('nebula.name') }}</p>
</header>
@if ($dashboards = \Larsklopstra\Nebula\Nebula::availableDashboards())
<ul class="px-2 my-4 space-y-1">
<li>
<p class="flex items-center h-8 px-2 text-xs font-medium text-gray-300 uppercase">
{{ __('Dashboards') }}
</p>
</li>
@foreach ($dashboards as $dashboard)
<li>
<a class="flex items-center h-10 px-2 text-sm font-medium text-gray-300 capitalize rounded-lg"
href="{{ route('nebula.dashboards.index', $dashboard->name()) }}">
{{ svg("heroicon-o-{$dashboard->icon()}", ['class' => 'w-5 h-5 mr-2 text-gray-400']) }}
{{ $dashboard->pluralName() }}
</a>
</li>
@endforeach
</ul>
@endif
@if($resources = \Larsklopstra\Nebula\Nebula::availableResources())
<ul class="px-2 my-4 space-y-1">
<li>
<p class="flex items-center h-8 px-2 text-xs font-medium text-gray-300 uppercase">
{{ __('Resources') }}
</p>
</li>
@foreach (\Larsklopstra\Nebula\Nebula::availableResources() as $resource)
<li>
<a class="flex items-center h-10 px-2 text-sm font-medium text-gray-300 capitalize rounded-lg"
href="{{ route('nebula.resources.index', $resource->name()) }}">
{{ svg("heroicon-o-{$resource->icon()}", ['class' => 'w-5 h-5 mr-2 text-gray-400']) }}
{{ $resource->pluralName() }}
</a>
</li>
@endforeach
</ul>
@endif
@if ($pages = \Larsklopstra\Nebula\Nebula::availablePages())
<ul class="px-2 my-4 space-y-1">
<li>
<p class="flex items-center h-8 px-2 text-xs font-medium text-gray-300 uppercase">
{{ __('Pages') }}
</p>
</li>
@foreach ($pages as $page)
<li>
<a class="flex items-center h-10 px-2 text-sm font-medium text-gray-300 capitalize rounded-lg"
href="{{ route('nebula.pages.index', $page->slug()) }}">
{{ svg("heroicon-o-{$page->icon()}", ['class' => 'w-5 h-5 mr-2 text-gray-400']) }}
{{ $page->name() }}
</a>
</li>
@endforeach
</ul>
@endif
</aside>
<main class="z-10 flex-1 overflow-hidden bg-gray-100 shadow lg:rounded-l-lg">
<header class="px-4 bg-white shadow sm:px-8">
<div class="grid items-center justify-between gap-4 py-4 lg:h-16 sm:flex">
<div class="flex items-center space-x-4">
@if ($back)
<a class="icon-button" href="{{ $back }}">
<x-heroicon-o-arrow-left class="w-6 h-6" />
</a>
@endif
<h1 class="text-xl font-medium tracking-tight font-display">
{{ $title }}
</h1>
</div>
@if ($actions)
<nav class="flex items-center space-x-4">
{{ $actions }}
</nav>
@endif
</div>
</header>
@if ($contextMenu)
<div class="z-10 px-4 bg-white shadow sm:px-8">
<div class="border-t border-gray-200">
{{ $contextMenu }}
</div>
</div>
@endif
<section class="py-8">
<x-nebula::container>
{{ $slot }}
</x-nebula::container>
</section>
</main>
</div>
</x-nebula::layouts.app>
================================================
FILE: resources/views/components/metric-card.blade.php
================================================
@props(['colSpan' => 4])
<div class="overflow-hidden p-4 bg-white rounded-lg shadow col-span-{{ $colSpan }}">
{{ $slot }}
</div>
================================================
FILE: resources/views/components/metrics/value.blade.php
================================================
@props(['metric'])
<x-nebula::metric-card :col-span="$metric->colSpan()">
<h3 class="text-sm">
{{ $metric->label() }}
</h3>
<div class="flex items-end justify-between mt-2">
<div class="flex flex-row items-center space-x-px">
@if ($prefix = $metric->prefix())
<p class="text-base text-gray-600">{{ $prefix }}</p>
@endif
<h4 class="text-3xl font-medium font-display">
{{ round($metric->calculate()[0]) }}
</h4>
@if ($suffix = $metric->suffix())
<p class="text-base text-gray-600">{{ $suffix }}</p>
@endif
</div>
@if ($metric->calculateDifference() > 0)
<div class="inline-flex flex-row items-center h-6 px-2 space-x-1 rounded-full bg-success-100">
<x-heroicon-s-arrow-up class="w-4 h-4 text-success-600" />
<span class="text-sm font-medium text-success-900">
{{ round($metric->calculateDifference(), 2) }}%
</span>
</div>
@else
<div class="inline-flex flex-row items-center h-6 px-2 space-x-1 rounded-full bg-danger-100">
<x-heroicon-s-arrow-down class="w-4 h-4 text-danger-600" />
<span class="text-sm font-medium text-danger-900">
{{ round($metric->calculateDifference(), 2) }}%
</span>
</div>
@endif
</div>
</x-nebula::metric-card>
================================================
FILE: resources/views/components/pagination.blade.php
================================================
<div class="flex items-center justify-between">
<p class="text-sm text-gray-600">
{{ trans_choice(':count result | :count results', $paginator->total(), ['count' => $paginator->total()]) }}
</p>
@if ($paginator->hasPages())
<nav class="flex overflow-hidden bg-white border border-gray-200 divide-x divide-gray-200 rounded-lg shadow-sm">
@if ($paginator->onFirstPage())
<span class="p-2 text-sm text-gray-300">
<x-heroicon-s-chevron-left class="w-5 h-5" />
</span>
@else
<a class="p-2 text-sm text-gray-500 transition duration-150 ease-in-out hover:text-gray-400 focus:bg-gray-50"
href="{{ $paginator->previousPageUrl() }}">
<x-heroicon-s-chevron-left class="w-5 h-5" />
</a>
@endif
@if (!$paginator->hasMorePages())
<span class="p-2 text-sm text-gray-300">
<x-heroicon-s-chevron-right class="w-5 h-5" />
</span>
@else
<a class="p-2 text-sm text-gray-500 transition duration-150 ease-in-out hover:text-gray-400 focus:bg-gray-50"
href="{{ $paginator->nextPageUrl() }}">
<x-heroicon-s-chevron-right class="w-5 h-5" />
</a>
@endif
</nav>
@endif
</div>
================================================
FILE: resources/views/dashboards/default-metrics.blade.php
================================================
<div class="grid grid-cols-12 gap-6">
@foreach ($dashboard->metrics() as $metric)
<x-dynamic-component :component="$metric->component()" :metric="$metric" />
@endforeach
</div>
================================================
FILE: resources/views/dashboards/default.blade.php
================================================
<h2 class="text-base font-medium font-display">
{{ $dashboard->label() }}
</h2>
{{ $dashboard->displayMetrics() }}
================================================
FILE: resources/views/dashboards/index.blade.php
================================================
<x-nebula::layouts.shell :title="__(':Dashboard dashboard', ['dashboard' => $dashboard->singularName()])">
<div class="mb-8 space-y-4">
{{ $dashboard->display() }}
</div>
</x-nebula::layouts.shell>
================================================
FILE: resources/views/pages/index.blade.php
================================================
<x-nebula::layouts.shell :title="$page->name()">
<div class="mb-8 space-y-4">
{{ $page->display() }}
</div>
</x-nebula::layouts.shell>
================================================
FILE: resources/views/resources/create.blade.php
================================================
<x-nebula::layouts.shell :title="__('Create :resource', ['resource' => $resource->singularName()])"
:back="route('nebula.resources.index', $resource->name())">
<x-nebula::form :action="route('nebula.resources.store', $resource->name())">
<div class="-mx-4 sm:mx-0">
<x-nebula::card>
<x-slot name="title">
{{ __('Create :resource', ['resource' => $resource->singularName()]) }}
</x-slot>
@foreach ($resource->createFields() as $field)
<x-dynamic-component :component="$field->getFormComponent()" :field="$field" />
@endforeach
<x-nebula::form-actions>
<a href="{{ route('nebula.resources.index', $resource->name()) }}" type="button"
class="button button-secondary">
{{ __('Back to :resources', ['resources' => $resource->pluralName()]) }}
</a>
<button type="submit" class="button button-primary">
{{ __('Create :resource', ['resource' => $resource->singularName()]) }}
</button>
</x-nebula::form-actions>
</x-nebula::card>
</div>
</x-nebula::form>
</x-nebula::layouts.shell>
================================================
FILE: resources/views/resources/edit.blade.php
================================================
<x-nebula::layouts.shell :title="__('Edit :resource', ['resource' => $resource->singularName()])"
:back="route('nebula.resources.show', [$resource->name(), $item])">
<x-nebula::form :action="route('nebula.resources.update', [$resource->name(), $item])" method="PATCH">
<div class="-mx-4 sm:mx-0">
<x-nebula::card>
<x-slot name="title">
{{ __('Edit :resource', ['resource' => $resource->singularName()]) }}
</x-slot>
@foreach ($resource->editFields() as $field)
<x-dynamic-component :item="$item" :component="$field->getFormComponent()" :field="$field" />
@endforeach
<x-nebula::form-actions>
<a href="{{ route('nebula.resources.index', $resource->name()) }}" type="button"
class="button button-secondary">
{{ __('Back to :resources', ['resources' => $resource->pluralName()]) }}
</a>
<button type="submit" class="button button-primary">
{{ __('Update :resource', ['resource' => $resource->singularName()]) }}
</button>
</x-nebula::form-actions>
</x-nebula::card>
</div>
</x-nebula::form>
</x-nebula::layouts.shell>
================================================
FILE: resources/views/resources/index.blade.php
================================================
<x-nebula::layouts.shell :title="__(':Resources overview', ['resources' => $resource->pluralName()])">
<x-slot name="actions">
<a href="{{ route('nebula.resources.create', $resource->name()) }}" class="button button-primary">
{{ __('Create :resource', ['resource' => $resource->singularName()]) }}
</a>
</x-slot>
<x-slot name="contextMenu">
<form class="grid items-center gap-4 py-4 lg:flex" method="GET">
<input name="search" value="{{ $activeSearch }}" type="text" placeholder="{{ __('Search anything...') }}"
class="w-full max-w-md text-sm placeholder-gray-500 border-gray-300 rounded-lg shadow-sm form-input">
<select name="filter" class="text-sm placeholder-gray-500 border-gray-300 rounded-lg shadow-sm form-select">
<option value="" selected>
{{ __('Select filter') }}
</option>
@foreach ($resource->filters() as $filter)
<option {{ $activeFilter && $activeFilter === $filter->name() ? 'selected' : '' }}
value="{{ $filter->name() }}">{{ $filter->label() }}</option>
@endforeach
</select>
<button type="submit" class="button button-secondary">
{{ __('Apply filters') }}
</button>
@if ($activeSearch || $activeFilter)
<a class="text-sm text-center text-gray-600"
href="{{ route('nebula.resources.index', $resource->name()) }}">
{{ __('Remove filters') }}
</a>
@endif
</form>
</x-slot>
@empty(! $metrics = $resource->metrics())
<div class="mb-8 space-y-4">
<h2 class="text-base font-medium font-display">
{{ __('Last month') }}
</h2>
<div class="grid grid-cols-12 gap-6">
@foreach ($metrics as $metric)
<x-dynamic-component :component="$metric->component()" :metric="$metric" />
@endforeach
</div>
</div>
@endempty
@empty($items->count())
<div class="flex flex-col items-center justify-center px-6 py-8 text-center">
<x-heroicon-o-information-circle class="w-16 h-16 text-gray-400" />
<h2 class="mt-2 text-base font-medium">
{{ __('No :resources found', ['resources' => $resource->pluralName()]) }}
</h2>
<p class="max-w-md mt-1 text-sm text-gray-600">
{{ __(':Resources you\'ve created will show up here.', ['resources' => $resource->pluralName()]) }}
</p>
<footer class="mt-4 space-x-4">
<a class="button button-primary" href="{{ route('nebula.resources.create', $resource->name()) }}">
{{ __('Create :resource', ['resource' => $resource->singularName()]) }}
</a>
</footer>
</div>
@else
<div class="-mx-4 sm:mx-0">
<x-nebula::card>
<div class="overflow-x-auto ">
<table class="w-full text-left table-auto">
<thead>
<tr>
@foreach ($resource->indexFields() as $field)
<th
class="px-4 py-2 text-xs font-medium tracking-wider text-gray-500 uppercase bg-gray-50">
{{ $field->getLabel() }}
</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($items as $item)
<tr>
@foreach ($resource->indexFields() as $field)
<td class="p-4 text-sm border-t border-gray-200">
<a href="{{ route('nebula.resources.show', [$resource->name(), $item]) }}">
<x-dynamic-component :item="$item" :component="$field->getTableComponent()"
:field="$field" />
</a>
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
</div>
<footer class="px-4 py-2">
{{ $items->withQueryString()->links('nebula::components.pagination') }}
</footer>
</x-nebula::card>
</div>
@endisset
</x-nebula::layouts.shell>
================================================
FILE: resources/views/resources/show.blade.php
================================================
<x-nebula::layouts.shell :title="__(':Resource details', ['resource' => $resource->singularName()])"
:back="route('nebula.resources.index', $resource->name())">
<x-slot name="actions">
<x-nebula::form :action="route('nebula.resources.destroy', [$resource->name(), $item])" method="DELETE">
<div x-data="{ confirmed: false }">
<button x-on:click.away="confirmed = false" x-bind:type="!confirmed ? 'button' : 'submit'"
x-on:click="confirmed = true" class="button button-secondary">
<span x-show.transition.in="!confirmed">
{{ __('Delete :resource', ['resource' => $resource->singularName()]) }}
</span>
<span x-show.transition.in="confirmed">
{{ __('Are you sure?') }}
</span>
</button>
</div>
</x-nebula::form>
<a href="{{ route('nebula.resources.edit', [$resource->name(), $item]) }}" class="button button-secondary">
{{ __('Edit :resource', ['resource' => $resource->singularName()]) }}
</a>
</x-slot>
<div class="-mx-4 sm:mx-0">
<x-nebula::card>
<x-slot name="title">
{{ __(':Resource details', ['resource' => $resource->pluralName()]) }}
</x-slot>
@foreach ($resource->fields() as $field)
<x-dynamic-component :item="$item" :component="$field->getDetailsComponent()" :field="$field" />
@endforeach
</x-nebula::card>
</div>
</x-nebula::layouts.shell>
================================================
FILE: resources/views/start.blade.php
================================================
<x-nebula::layouts.shell :title="__('Get started')">
<div class="space-y-8">
<header>
<h1 class="text-2xl font-medium font-display">
{{ __('Get started') }}
</h1>
<p class="mt-1 text-gray-600">
{{ __('Welcome to Nebula, let\'s get that data working!') }}
</p>
</header>
<div class="grid grid-cols-2 gap-px overflow-hidden bg-gray-200 rounded-lg shadow">
<article class="flex p-6 space-x-6 bg-white">
<div>
<div class="flex items-center justify-center w-10 h-10 rounded-lg bg-primary-50">
<x-heroicon-o-cube class="w-8 h-8 text-primary-700" />
</div>
</div>
<div>
<h2 class="text-lg font-medium font-display">
{{ __('Resources') }}
</h2>
<p class="text-sm text-gray-600">
{{ __('Resources are a key part of Nebula, they easily allow you to scaffold CRUD interfaces through a CLI.') }}
</p>
</div>
</article>
<article class="flex p-6 space-x-6 bg-white">
<div>
<div class="flex items-center justify-center w-10 h-10 rounded-lg bg-primary-50">
<x-heroicon-o-search class="w-8 h-8 text-primary-700" />
</div>
</div>
<div>
<h2 class="text-lg font-medium font-display">
{{ __('Filters') }}
</h2>
<p class="text-sm text-gray-600">
{{ __('Sometimes you need to search for specific records in tons of data, filters will make your life easier.') }}
</p>
</div>
</article>
<article class="flex p-6 space-x-6 bg-white">
<div>
<div class="flex items-center justify-center w-10 h-10 rounded-lg bg-primary-50">
<x-heroicon-o-trending-up class="w-8 h-8 text-primary-700" />
</div>
</div>
<div>
<h2 class="text-lg font-medium font-display">
{{ __('Metrics') }}
</h2>
<p class="text-sm text-gray-600">
{{ __('Metrics are useful cards which display data of resources, they can be found in dashboards and resources.') }}
</p>
</div>
</article>
<article class="flex p-6 space-x-6 bg-white">
<div>
<div class="flex items-center justify-center w-10 h-10 rounded-lg bg-primary-50">
<x-heroicon-o-collection class="w-8 h-8 text-primary-700" />
</div>
</div>
<div>
<h2 class="text-lg font-medium font-display">
{{ __('Dashboards') }}
</h2>
<p class="text-sm text-gray-600">
{{ __('You can create as many dashboards as you want with all the metrics you need.') }}
</p>
</div>
</article>
</div>
</div>
</x-nebula::layouts.shell>
================================================
FILE: routes/web.php
================================================
<?php
use Illuminate\Support\Facades\Route;
use Larsklopstra\Nebula\Http\Controllers\DashboardController;
use Larsklopstra\Nebula\Http\Controllers\PageController;
use Larsklopstra\Nebula\Http\Controllers\ResourceController;
use Larsklopstra\Nebula\Http\Controllers\StartController;
$routePrefix = config('nebula.prefix');
Route::get("/$routePrefix", StartController::class)->name('start');
Route::get('/dashboards/{dashboard}', [DashboardController::class, 'index'])->name('dashboards.index');
Route::name('resources.')->prefix('/resources')->group(function () {
Route::get('/{resource}', [ResourceController::class, 'index'])->name('index');
Route::get('/{resource}/create', [ResourceController::class, 'create'])->name('create');
Route::post('/{resource}/create', [ResourceController::class, 'store'])->name('store');
Route::get('/{resource}/{item}/edit', [ResourceController::class, 'edit'])->name('edit');
Route::patch('/{resource}/{item}/edit', [ResourceController::class, 'update'])->name('update');
Route::get('/{resource}/{item}', [ResourceController::class, 'show'])->name('show');
Route::delete('/{resource}/{item}', [ResourceController::class, 'destroy'])->name('destroy');
});
Route::get('/page/{page}', [PageController::class, 'index'])->name('pages.index');
================================================
FILE: src/Console/Commands/InstallCommand.php
================================================
<?php
namespace Larsklopstra\Nebula\Console\Commands;
use Illuminate\Console\Command;
class InstallCommand extends Command
{
protected $signature = 'nebula:install';
protected $description = 'Install Nebula in your application';
public function handle()
{
$this->call('vendor:publish', [
'--provider' => "Larsklopstra\Nebula\NebulaServiceProvider",
'--tag' => 'config',
]);
$this->call('vendor:publish', [
'--provider' => "Larsklopstra\Nebula\NebulaServiceProvider",
'--tag' => 'public',
]);
}
}
================================================
FILE: src/Console/Commands/MakeDashboardCommand.php
================================================
<?php
namespace Larsklopstra\Nebula\Console\Commands;
use Illuminate\Console\GeneratorCommand;
class MakeDashboardCommand extends GeneratorCommand
{
protected $name = 'nebula:dashboard';
protected $description = 'Create a Nebula dashboard';
protected $type = 'Nebula dashboard';
protected function getStub()
{
return __DIR__.'/stubs/dashboard.stub';
}
protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace.'\Nebula\Dashboards';
}
}
================================================
FILE: src/Console/Commands/MakeFieldCommand.php
================================================
<?php
namespace Larsklopstra\Nebula\Console\Commands;
use Illuminate\Console\GeneratorCommand;
class MakeFieldCommand extends GeneratorCommand
{
protected $name = 'nebula:field';
protected $description = 'Create a Nebula field';
protected $type = 'Nebula field';
protected function getStub()
{
return __DIR__.'/stubs/field.stub';
}
protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace.'\Nebula\Fields';
}
}
================================================
FILE: src/Console/Commands/MakeFilterCommand.php
================================================
<?php
namespace Larsklopstra\Nebula\Console\Commands;
use Illuminate\Console\GeneratorCommand;
class MakeFilterCommand extends GeneratorCommand
{
protected $name = 'nebula:filter';
protected $description = 'Create a Nebula filter';
protected $type = 'Nebula filter';
protected function getStub()
{
return __DIR__.'/stubs/filter.stub';
}
protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace.'\Nebula\Filters';
}
}
================================================
FILE: src/Console/Commands/MakePageCommand.php
================================================
<?php
namespace Larsklopstra\Nebula\Console\Commands;
use Illuminate\Console\GeneratorCommand;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
class MakePageCommand extends GeneratorCommand
{
protected $name = 'nebula:page';
protected $description = 'Create a Nebula page';
protected $type = 'Nebula page';
public function handle()
{
parent::handle();
File::ensureDirectoryExists($this->viewPath('nebula/pages'));
File::put($this->viewPath("nebula/pages/{$this->viewName()}.blade.php"), '');
}
protected function buildClass($name)
{
return str_replace(
'dummy-view',
$this->viewName(),
parent::buildClass($name)
);
}
protected function getStub()
{
return __DIR__.'/stubs/page.stub';
}
protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace.'\Nebula\Pages';
}
protected function viewName()
{
return (string) Str::of($this->argument('name'))
->replaceLast('Page', '')
->kebab()
->lower();
}
}
================================================
FILE: src/Console/Commands/MakeResourceCommand.php
================================================
<?php
namespace Larsklopstra\Nebula\Console\Commands;
use Illuminate\Console\GeneratorCommand;
class MakeResourceCommand extends GeneratorCommand
{
protected $name = 'nebula:resource';
protected $description = 'Create a Nebula resource';
protected $type = 'Nebula resource';
protected function getStub()
{
return __DIR__.'/stubs/resource.stub';
}
protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace.'\Nebula\Resources';
}
}
================================================
FILE: src/Console/Commands/MakeValueMetricCommand.php
================================================
<?php
namespace Larsklopstra\Nebula\Console\Commands;
use Illuminate\Console\GeneratorCommand;
class MakeValueMetricCommand extends GeneratorCommand
{
protected $name = 'nebula:value';
protected $description = 'Create a Nebula value metric';
protected $type = 'Nebula value metric';
protected function getStub()
{
return __DIR__.'/stubs/value.stub';
}
protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace.'\Nebula\Metrics';
}
}
================================================
FILE: src/Console/Commands/stubs/dashboard.stub
================================================
<?php
namespace DummyNamespace;
use Larsklopstra\Nebula\Contracts\NebulaDashboard;
class DummyClass extends NebulaDashboard
{
public function icon()
{
return 'trending-up';
}
public function metrics(): array
{
return [];
}
}
================================================
FILE: src/Console/Commands/stubs/field.stub
================================================
<?php
namespace DummyNamespace;
use Larsklopstra\Nebula\Contracts\NebulaField;
class DummyClass extends NebulaField
{
public function getFormComponent()
{
return 'nebula.forms.field-name';
}
public function getDetailsComponent()
{
return 'nebula::fields.details.text';
}
}
================================================
FILE: src/Console/Commands/stubs/filter.stub
================================================
<?php
namespace DummyNamespace;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
use Larsklopstra\Nebula\Contracts\NebulaFilter;
class DummyClass extends NebulaFilter
{
public function build(Builder $query, Request $request): Builder
{
return $query->latest();
}
}
================================================
FILE: src/Console/Commands/stubs/page.stub
================================================
<?php
namespace DummyNamespace;
use Larsklopstra\Nebula\Contracts\NebulaPage;
class DummyClass extends NebulaPage
{
public function icon()
{
return 'document';
}
public function render()
{
return view('nebula.pages.dummy-view');
}
}
================================================
FILE: src/Console/Commands/stubs/resource.stub
================================================
<?php
namespace DummyNamespace;
use Larsklopstra\Nebula\Contracts\NebulaResource;
class DummyClass extends NebulaResource
{
protected $searchable = [];
public function columns(): array
{
return [];
}
public function fields(): array
{
return [];
}
}
================================================
FILE: src/Console/Commands/stubs/value.stub
================================================
<?php
namespace DummyNamespace;
use Larsklopstra\Nebula\Metrics\ValueMetric;
class DummyClass extends ValueMetric
{
public function calculate()
{
}
public function label()
{
}
}
================================================
FILE: src/Contracts/NebulaDashboard.php
================================================
<?php
namespace Larsklopstra\Nebula\Contracts;
use Illuminate\Support\Str;
use Illuminate\Support\Stringable;
abstract class NebulaDashboard
{
/**
* Specifies which metrics should be displayed.
*
* @return array
*/
public function metrics(): array
{
return [];
}
/**
* Specifies which icon should be used.
*
* @return string
*/
public function icon()
{
return 'tag';
}
/**
* Returns the name of the dashboard.
*
* @return Stringable
*/
public function name()
{
return Str::of(class_basename($this))
->replaceLast('Dashboard', '')
->kebab()
->lower()
->plural();
}
/**
* Returns the dashboard its singular name.
*
* @return Stringable
*/
public function singularName()
{
return Str::of($this->name())
->replace('-', '')
->singular();
}
/**
* Returns the dashboard its plural name.
*
* @return string
*/
public function pluralName()
{
return Str::plural($this->singularName());
}
/**
* Render the view for the dashboard.
*
* @return \Illuminate\View\View|string
*/
public function display()
{
return app()->call([$this, 'render']);
}
/**
* Render the metrics for the dashboard.
*
* @return \Illuminate\View\View|string
*/
public function displayMetrics()
{
return view('nebula::dashboards.default-metrics', [
'dashboard' => $this,
]);
}
/**
* Render the contents of the dashboard.
*
* @return \Illuminate\View\View|string
*/
public function render()
{
return view('nebula::dashboards.default', [
'dashboard' => $this,
]);
}
/**
* Returns the label for the dashboard.
*
* @return string
*/
public function label()
{
return __('Last month');
}
}
================================================
FILE: src/Contracts/NebulaField.php
================================================
<?php
namespace Larsklopstra\Nebula\Contracts;
use Illuminate\Support\Str;
use Illuminate\Support\Stringable;
abstract class NebulaField
{
protected string $name = '';
protected string $label = '';
protected string $value = '';
protected bool $required = false;
protected array $rules = [];
/**
* Construct the field.
*
* @param string $label
* @param string $name
*/
public function __construct(string $label, string $name = null)
{
$this->label($label);
$this->name($name ??= $label);
}
/**
* Make a field.
*
* @param string $label
* @param string $name
* @return $this
*/
public static function make(string $label, string $name = null): self
{
return new static($label, $name);
}
/**
* Set the name.
*
* @param string $name
* @return $this
*/
public function name(string $name): self
{
$this->name = Str::of($name)
->replace(' ', '_')
->lower();
return $this;
}
/**
* Set the label.
*
* @param mixed $label
* @return $this
*/
public function label($label): self
{
$this->label = Str::of($label)
->ucfirst();
return $this;
}
/**
* Set the value.
*
* @param mixed $value
* @return $this
*/
public function value($value): self
{
$this->value = $value;
return $this;
}
/**
* Set the required property.
*
* @param bool $required
* @return $this
*/
public function required(bool $required = true): self
{
$this->required = $required;
return $this;
}
/**
* Set the rules.
*
* @param mixed $rules
* @return $this
*/
public function rules($rules): self
{
if (! is_array($rules)) {
$this->rules = explode('|', $rules);
return $this;
}
$this->rules = $rules;
return $this;
}
/**
* Get the name.
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Get the label.
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Get the value.
*
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* Get the required property.
*
* @return bool
*/
public function getRequired(): bool
{
return $this->required;
}
/**
* Get the rules.
*
* @return array
*/
public function getRules(): array
{
return $this->rules;
}
/**
* Gets the details blade view for this component.
*
* @return string
*/
public function getDetailsComponent()
{
return "nebula::fields.details.{$this->getComponentName()}";
}
/**
* Returns the component name for this component.
*
* @return Stringable
*/
public function getComponentName()
{
return Str::of(class_basename($this))
->replaceLast('Field', '')
->kebab()
->lower();
}
/**
* Returns the form blade view for this component.
*
* @return string
*/
public function getFormComponent()
{
return "nebula::fields.forms.{$this->getComponentName()}";
}
/**
* Returns the table blade view for this component.
*
* @return string
*/
public function getTableComponent()
{
return "nebula::fields.tables.{$this->getComponentName()}";
}
}
================================================
FILE: src/Contracts/NebulaFilter.php
================================================
<?php
namespace Larsklopstra\Nebula\Contracts;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Illuminate\Support\Stringable;
abstract class NebulaFilter
{
/**
* Return the filter its name.
*
* @return string
*/
public function name()
{
return class_basename($this);
}
/**
* Returns the filter its label.
*
* @return Stringable
*/
public function label()
{
return Str::of(class_basename($this))
->replaceLast('Filter', '')
->kebab()
->replace('-', ' ')
->lower()
->ucfirst();
}
/**
* Returns the query builder uses for the filter.
*
* @param Builder $query
* @param Request $request
* @return Builder
*/
abstract public function build(Builder $query, Request $request): Builder;
}
================================================
FILE: src/Contracts/NebulaMetric.php
================================================
<?php
namespace Larsklopstra\Nebula\Contracts;
use Closure;
use Illuminate\Support\Carbon;
abstract class NebulaMetric implements ShouldCache, ShouldRender, ShouldSpanCols
{
/**
* Returns the label.
*
* @return string
*/
public function label()
{
return '';
}
/**
* Returns the column span of a card.
*
* @return int
*/
public function colSpan(): int
{
return 4;
}
/**
* Calculates the given data.
*
* @return mixed
*/
abstract public function calculate();
/**
* Specifies for how long a metric should be cached.
*
* @return Carbon
*/
public function cacheFor()
{
return now()->addHour();
}
/**
* Return the cache.
*
* @param Closure $callback
* @return mixed
*/
abstract public function getFromCache(Closure $callback);
/**
* Return the blade view for a metric.
*
* @return mixed
*/
abstract public function component();
}
================================================
FILE: src/Contracts/NebulaPage.php
================================================
<?php
namespace Larsklopstra\Nebula\Contracts;
use Closure;
use Exception;
use Illuminate\Support\Str;
use Illuminate\Support\Stringable;
abstract class NebulaPage
{
public $canSeeCallback;
/**
* Specifies which icon should be used.
*
* @return string
*/
public function icon()
{
return 'tag';
}
/**
* Returns the name of the page.
*
* @return Stringable
*/
public function name()
{
return Str::of(class_basename($this))
->replaceLast('Page', '');
}
/**
* Returns the slug of the page.
*
* @return Stringable
*/
public function slug()
{
return $this->name()->kebab()->lower();
}
/**
* Outputs the page.
*
* @return mixed
*/
public function display()
{
if (! method_exists($this, 'render')) {
throw new Exception('No `render` method defined on '.get_class($this));
}
return app()->call([$this, 'render']);
}
/**
* Determine whether or not the page can be accessed.
*
* @param \Closure $callback
* @return static
*/
public function canSee(Closure $callback)
{
$this->canSeeCallback = $callback;
return $this;
}
}
================================================
FILE: src/Contracts/NebulaResource.php
================================================
<?php
namespace Larsklopstra\Nebula\Contracts;
use Exception;
use Illuminate\Support\Str;
use Illuminate\Support\Stringable;
abstract class NebulaResource
{
protected $with = [];
protected $searchable = [];
public function searchable()
{
return $this->searchable;
}
/**
* Specifies the metrics which should be displayed.
*
* @return array
*/
public function metrics(): array
{
return [];
}
/**
* Specifies the icon which should be used in the menu.
*
* @return string
*/
public function icon()
{
return 'tag';
}
/**
* Returns the model, if not overriden the class will be resolved based on the resource its classname.
*
* @return string
* @throws Exception
*/
public function model()
{
$className = Str::replaceLast('Resource', '', class_basename($this));
$namespaces = [
'App',
'App\Models',
];
foreach ($namespaces as $namespace) {
if (class_exists("$namespace\\$className")) {
return "$namespace\\$className";
}
}
throw new Exception("Auto resolved $className model doesn't exist, please add your own via the `model()` method.");
}
/**
* Returns the basename of the resource.
*
* @return Stringable
*/
public function name()
{
return Str::of(class_basename($this))
->replaceLast('Resource', '')
->kebab()
->lower()
->plural();
}
/**
* Returns the singular name of the resource.
*
* @return Stringable
*/
public function singularName()
{
return Str::of($this->name())
->replace('-', ' ')
->singular();
}
/**
* Returns the plural name of the resource.
*
* @return string
*/
public function pluralName()
{
return Str::plural($this->singularName());
}
/**
* Returns the resource its fields.
*
* @return array
*/
abstract public function fields(): array;
/**
* Returns the fields used for the edit form.
*
* @return array
*/
public function indexFields(): array
{
return $this->fields();
}
/**
* Returns the fields used for the edit form.
*
* @return array
*/
public function editFields(): array
{
return $this->fields();
}
/**
* Returns the fields for the create form.
*
* @return array
*/
public function createFields(): array
{
return $this->fields();
}
public function filters(): array
{
return [];
}
/**
* Returns the rules for each field.
*
* @param array $fields
* @return array
*/
public function rules(array $fields): array
{
$rules = [];
foreach ($fields as $field) {
array_push($rules, [
$field->getName() => $field->getRules(),
]);
}
return array_merge(...$rules);
}
/**
* Resolves the index filters.
*
* @param string $name
* @return mixed
* @throws Exception
*/
public function resolveFilter(string $name)
{
foreach ($this->filters() as $filter) {
if ($filter->name() === $name) {
return $filter;
}
}
throw new Exception("Filter $name not found.");
}
/**
* The query for the index view.
*
* @return mixed
* @throws Exception
*/
public function indexQuery()
{
return $this->model()::query()
->withoutGlobalScopes()
->with($this->with);
}
/**
* Specifies the update query.
*
* @param mixed $model
* @param mixed $data
* @return void
*/
public function updateQuery($model, $data)
{
$model->update($data);
}
/**
* Specifies the store query.
*
* @param mixed $model
* @param mixed $data
* @return void
*/
public function storeQuery($model, $data)
{
$model::create($data);
}
/**
* Specifies the destroy query.
*
* @param mixed $model
* @return void
*/
public function destroyQuery($model)
{
$model->delete();
}
}
================================================
FILE: src/Contracts/ShouldCache.php
================================================
<?php
namespace Larsklopstra\Nebula\Contracts;
interface ShouldCache
{
public function cacheFor();
}
================================================
FILE: src/Contracts/ShouldRender.php
================================================
<?php
namespace Larsklopstra\Nebula\Contracts;
interface ShouldRender
{
public function component();
}
================================================
FILE: src/Contracts/ShouldSpanCols.php
================================================
<?php
namespace Larsklopstra\Nebula\Contracts;
interface ShouldSpanCols
{
public function colSpan();
}
================================================
FILE: src/Fields/Boolean.php
================================================
<?php
namespace Larsklopstra\Nebula\Fields;
use Larsklopstra\Nebula\Contracts\NebulaField;
class Boolean extends NebulaField
{
protected string $true = 'True';
protected string $false = 'False';
/**
* Set the true label.
*
* @param string $label
* @return $this
*/
public function true(string $label): self
{
$this->true = $label;
return $this;
}
/**
* Set the false label.
*
* @param string $label
* @return $this
*/
public function false(string $label): self
{
$this->false = $label;
return $this;
}
public function getTrue()
{
return $this->true;
}
public function getFalse()
{
return $this->false;
}
}
================================================
FILE: src/Fields/Color.php
================================================
<?php
namespace Larsklopstra\Nebula\Fields;
use Larsklopstra\Nebula\Contracts\NebulaField;
class Color extends NebulaField
{
protected array $colors = [
'#e02424',
'#d03801',
'#9f580a',
'#057a55',
'#047481',
'#1c64f2',
'#5850ec',
'#7e3af2',
'#d61f69',
];
/**
* Sets the colors.
*
* @param array $colors
* @return $this
*/
public function colors(array $colors): self
{
$this->colors = $colors;
return $this;
}
/**
* Returns the array of colors.
*
* @return array
*/
public function getColors(): array
{
return $this->colors;
}
}
================================================
FILE: src/Fields/Concerns/HasHelperText.php
================================================
<?php
namespace Larsklopstra\Nebula\Fields\Concerns;
trait HasHelperText
{
protected string $helperText = '';
/**
* Sets the helper text property.
*
* @param string $helperText
* @return $this
*/
public function helperText(string $helperText): self
{
$this->helperText = $helperText;
return $this;
}
/**
* Returns the helper text.
*
* @return string
*/
public function getHelperText(): string
{
return $this->helperText;
}
}
================================================
FILE: src/Fields/Concerns/HasPlaceholder.php
================================================
<?php
namespace Larsklopstra\Nebula\Fields\Concerns;
trait HasPlaceholder
{
protected string $placeholder = '';
/**
* Sets the placeholder property.
*
* @param string $placeholder
* @return $this
*/
public function placeholder(string $placeholder): self
{
$this->placeholder = $placeholder;
return $this;
}
/**
* Returns the placeholder.
*
* @return string
*/
public function getPlaceholder(): string
{
return $this->placeholder;
}
}
================================================
FILE: src/Fields/Date.php
================================================
<?php
namespace Larsklopstra\Nebula\Fields;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidFormatException;
use Larsklopstra\Nebula\Contracts\NebulaField;
use Larsklopstra\Nebula\Fields\Concerns\HasHelperText;
class Date extends NebulaField
{
use HasHelperText;
protected string $format = 'Y-m-d';
/**
* Applies the date format in the front-end.
*
* @param mixed $date
* @return string
* @throws InvalidFormatException
*/
public function applyFormat($date)
{
return Carbon::parse($date)->format($this->format);
}
/**
* Applies the date format in the front-end.
*
* @param string $format
* @return $this
*/
public function format(string $format): self
{
$this->format = $format;
return $this;
}
}
================================================
FILE: src/Fields/Input.php
================================================
<?php
namespace Larsklopstra\Nebula\Fields;
use Larsklopstra\Nebula\Contracts\NebulaField;
use Larsklopstra\Nebula\Fields\Concerns\HasHelperText;
use Larsklopstra\Nebula\Fields\Concerns\HasPlaceholder;
class Input extends NebulaField
{
use HasPlaceholder, HasHelperText;
protected string $type = 'text';
/**
* Sets the HTML input type.
*
* @param mixed $type
* @return $this
*/
public function type($type): self
{
$this->type = $type;
return $this;
}
/**
* Returns the HTML input type.
*
* @return string
*/
public function getType()
{
return $this->type;
}
}
================================================
FILE: src/Fields/Select.php
================================================
<?php
namespace Larsklopstra\Nebula\Fields;
use Larsklopstra\Nebula\Contracts\NebulaField;
use Larsklopstra\Nebula\Fields\Concerns\HasHelperText;
class Select extends NebulaField
{
use HasHelperText;
protected array $options = [];
/**
* Sets the select fields's options properties.
*
* @param array $options
* @return $this
*/
public function options(array $options): self
{
$this->options = $options;
return $this;
}
/**
* Return the options.
*
* @return array
*/
public function getOptions(): array
{
return $this->options;
}
}
================================================
FILE: src/Fields/Textarea.php
================================================
<?php
namespace Larsklopstra\Nebula\Fields;
use Larsklopstra\Nebula\Contracts\NebulaField;
use Larsklopstra\Nebula\Fields\Concerns\HasHelperText;
use Larsklopstra\Nebula\Fields\Concerns\HasPlaceholder;
class Textarea extends NebulaField
{
use HasPlaceholder, HasHelperText;
}
================================================
FILE: src/Http/Concerns/AuthorizesRequests.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\Concerns;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Gate;
trait AuthorizesRequests
{
protected function authorize($ability, $model)
{
$policy = Gate::getPolicyFor($model);
if (
$policy &&
! App::environment('local') &&
in_array($ability, get_class_methods($policy))
) {
Gate::authorize($ability, $model);
}
}
}
================================================
FILE: src/Http/Controllers/DashboardController.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\Controllers;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\View\View;
use Larsklopstra\Nebula\Contracts\NebulaDashboard;
use Larsklopstra\Nebula\Http\Concerns\AuthorizesRequests;
use Larsklopstra\Nebula\Traits\Toasts;
class DashboardController
{
use Toasts, AuthorizesRequests;
/**
* Renders the dashboard view with metrics.
*
* @param NebulaDashboard $dashboard
* @return View
* @throws BindingResolutionException
*/
public function index(NebulaDashboard $dashboard): View
{
return view('nebula::dashboards.index', [
'dashboard' => $dashboard,
]);
}
}
================================================
FILE: src/Http/Controllers/PageController.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\Controllers;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\Request;
use Larsklopstra\Nebula\Contracts\NebulaPage;
class PageController
{
public function index(Request $request, NebulaPage $page)
{
if ($page->canSeeCallback && !$page->canSeeCallback($request)) {
throw new AuthorizationException;
}
return view('nebula::pages.index', [
'page' => $page
]);
}
}
================================================
FILE: src/Http/Controllers/ResourceController.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\Controllers;
use Exception;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
use Larsklopstra\Nebula\Contracts\NebulaResource;
use Larsklopstra\Nebula\Http\Concerns\AuthorizesRequests;
use Larsklopstra\Nebula\Traits\Toasts;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
class ResourceController
{
use Toasts, AuthorizesRequests;
/**
* Returns the index view with metrics, search filters and resource entries.
*
* @param Request $request
* @param NebulaResource $resource
* @return View
* @throws Exception
* @throws BindingResolutionException
*/
public function index(Request $request, NebulaResource $resource): View
{
$this->authorize('viewAny', $resource->model());
$filter = $request->query('filter');
$search = $request->query('search');
$builder = $resource->indexQuery();
if (! empty($filter)) {
$builder = $resource->resolveFilter($filter)->build($builder, $request);
}
if (! empty($search)) {
foreach ($resource->searchable() as $column) {
$builder->orWhere($column, 'like', "%$search%");
}
}
return view('nebula::resources.index', [
'items' => $builder->paginate(),
'resource' => $resource,
'activeFilter' => $filter,
'activeSearch' => $search,
]);
}
/**
* Shows a resource entry.
*
* @param NebulaResource $resource
* @param mixed $item
* @return View
* @throws BindingResolutionException
*/
public function show(NebulaResource $resource, $item): View
{
$this->authorize('view', $item);
return view('nebula::resources.show', [
'resource' => $resource,
'item' => $item,
]);
}
/**
* Shows the edit form of a resource entry.
*
* @param NebulaResource $resource
* @param mixed $item
* @return View
* @throws BindingResolutionException
*/
public function edit(NebulaResource $resource, $item): View
{
$this->authorize('update', $item);
return view('nebula::resources.edit', [
'resource' => $resource,
'item' => $item,
]);
}
/**
* Updates a resource entry.
*
* @param Request $request
* @param NebulaResource $resource
* @param mixed $item
* @return RedirectResponse
* @throws BindingResolutionException
*/
public function update(Request $request, NebulaResource $resource, $item): RedirectResponse
{
$this->authorize('update', $item);
$validated = $request->validate($resource->rules(
$resource->editFields()
));
$resource->updateQuery($item, $validated);
$this->toast(__(':Resource updated', [
'resource' => $resource->singularName(),
]));
return redirect()->back();
}
/**
* Shows the create form for a resource.
*
* @param NebulaResource $resource
* @return View
* @throws BindingResolutionException
*/
public function create(NebulaResource $resource): View
{
$this->authorize('create', $resource->model());
return view('nebula::resources.create', [
'resource' => $resource,
]);
}
/**
* Stores a new resource entry.
*
* @param Request $request
* @param NebulaResource $resource
* @return RedirectResponse
* @throws Exception
* @throws BindingResolutionException
*/
public function store(Request $request, NebulaResource $resource): RedirectResponse
{
$this->authorize('create', $resource->model());
$validated = $request->validate($resource->rules(
$resource->createFields()
));
$resource->storeQuery($resource->model(), $validated);
$this->toast(__(':Resource created', [
'resource' => $resource->singularName(),
]));
return redirect()->back();
}
/**
* Deletes a resource entry.
*
* @param NebulaResource $resource
* @param mixed $item
* @return RedirectResponse
* @throws BindingResolutionException
* @throws RouteNotFoundException
*/
public function destroy(NebulaResource $resource, $item): RedirectResponse
{
$this->authorize('delete', $item);
$resource->destroyQuery($item);
$this->toast(__(':Resource deleted', [
'resource' => $resource->singularName(),
]));
return redirect()->route('nebula.resources.index', $resource->name());
}
}
================================================
FILE: src/Http/Controllers/StartController.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\Controllers;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\View\View;
class StartController
{
/**
* Returns the starter view.
*
* @return View
* @throws BindingResolutionException
*/
public function __invoke(): View
{
return view('nebula::start');
}
}
================================================
FILE: src/Http/Middleware/NebulaEmailAuthStrategy.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\Middleware;
use Closure;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class NebulaEmailAuthStrategy
{
/**
* Checks if the request email contains an allowed email.
*
* @param Request $request
* @param Closure $next
* @return mixed
* @throws BindingResolutionException
* @throws HttpException
* @throws NotFoundHttpException
*/
public function handle(Request $request, Closure $next)
{
if (
empty($request->user()->email) ||
! in_array($request->user()->email, config('nebula.allowed_emails'))
) {
abort(404);
}
return $next($request);
}
}
================================================
FILE: src/Http/Middleware/NebulaIPAuthStrategy.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\Middleware;
use Closure;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class NebulaIPAuthStrategy
{
/**
* Checks if the request ip contains an ip address.
*
* @param Request $request
* @param Closure $next
* @return mixed
* @throws ConflictingHeadersException
* @throws BindingResolutionException
* @throws HttpException
* @throws NotFoundHttpException
*/
public function handle(Request $request, Closure $next)
{
if (! in_array($request->ip(), config('nebula.allowed_ips'))) {
abort(404);
}
return $next($request);
}
}
================================================
FILE: src/Http/RouteResolvers/DashboardResolver.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\RouteResolvers;
use Exception;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Larsklopstra\Nebula\Nebula;
class DashboardResolver extends Resolver
{
/**
* Binds the "dashboard" route to the list of routes.
*
* @return void
* @throws BindingResolutionException
* @throws HttpException
* @throws NotFoundHttpException
*/
public static function bind(): void
{
Route::bind('dashboard', function ($value) {
$dashboards = Nebula::availableDashboards();
if (empty($dashboards)) {
throw new Exception('No dashboards set in the nebula config.');
}
foreach ($dashboards as $dashboard) {
$dashboardExists = Str::of($dashboard->name())
->lower()
->is($value);
if ($dashboardExists) {
return $dashboard;
}
}
throw new Exception("Dashboard $value not found.");
});
}
}
================================================
FILE: src/Http/RouteResolvers/ItemResolver.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\RouteResolvers;
use Illuminate\Support\Facades\Route;
class ItemResolver extends Resolver
{
/**
* Binds the "item" route to the list of routes.
*
* @return void
* @throws NotFoundHttpException
*/
public static function bind(): void
{
Route::bind('item', function ($value) {
$model = request()->resource->model();
return $model::withoutGlobalScopes()
->where((new $model)->getRouteKeyName(), $value)
->firstOrFail();
});
}
}
================================================
FILE: src/Http/RouteResolvers/PageResolver.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\RouteResolvers;
use Exception;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Larsklopstra\Nebula\Nebula;
class PageResolver extends Resolver
{
/**
* Binds the page routes to the list of routes.
*
* @return void
* @throws BindingResolutionException
* @throws HttpException
* @throws NotFoundHttpException
*/
public static function bind(): void
{
Route::bind('page', function ($value) {
$pages = Nebula::availablePages();
if (empty($pages)) {
throw new Exception('No pages set in the nebula config.');
}
foreach ($pages as $page) {
$pageExists = Str::of($page->slug())
->lower()
->is($value);
if ($pageExists) {
return $page;
}
}
throw new Exception("Page {$page} not found.");
});
}
}
================================================
FILE: src/Http/RouteResolvers/Resolver.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\RouteResolvers;
abstract class Resolver
{
abstract public static function bind(): void;
}
================================================
FILE: src/Http/RouteResolvers/ResourceResolver.php
================================================
<?php
namespace Larsklopstra\Nebula\Http\RouteResolvers;
use Exception;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Larsklopstra\Nebula\Nebula;
class ResourceResolver extends Resolver
{
/**
* Binds a "resource" route to the list of routes.
*
* @return void
* @throws BindingResolutionException
* @throws HttpException
* @throws NotFoundHttpException
*/
public static function bind(): void
{
Route::bind('resource', function ($value) {
$resources = Nebula::availableResources();
if (empty($resources)) {
throw new Exception('No resources set in the nebula config.');
}
foreach ($resources as $resource) {
$resourceExists = Str::of($resource->name())
->lower()
->is($value);
if ($resourceExists) {
return $resource;
}
}
throw new Exception("Resource $value not found.");
});
}
}
================================================
FILE: src/Metrics/ValueMetric.php
================================================
<?php
namespace Larsklopstra\Nebula\Metrics;
use Closure;
use Exception;
use Larsklopstra\Nebula\Contracts\NebulaMetric;
abstract class ValueMetric extends NebulaMetric
{
/**
* Returns the prefix.
*
* @return string
*/
public function prefix()
{
return '';
}
/**
* Returns the suffix.
*
* @return string
*/
public function suffix()
{
return '';
}
/**
* Returns the difference between now and last month.
*
* @return int|float
*/
public function calculateDifference()
{
[$current, $old] = $this->calculate();
if (empty($old)) {
return 100;
}
return ($current - $old) / $old * 100;
}
/**
* Build the query of the current and previous metrics and run a closure on them.
*
* @param mixed $class
* @param \Closure $callback
* @return \Closure
*/
protected function query($class, Closure $callback)
{
$current = $class::query()->withoutGlobalScopes()
->whereBetween('created_at', [now()->subMonth(), now()]);
$old = $class::query()->withoutGlobalScopes()
->whereBetween('created_at', [now()->subMonths(2), now()->subMonth()]);
return $callback($current, $old);
}
/**
* Returns the avarage based on a given eloquent model `$class` and its column `$column`.
*
* @param mixed $class
* @param mixed $column
* @return mixed
* @throws Exception
*/
protected function average($class, $column)
{
return $this->getFromCache(function () use ($class, $column) {
return $this->query($class, function ($current, $old) use ($column) {
return [
$current->average($column),
$old->average($column),
];
});
});
}
/**
* Returns the count of the given eloquent model `$class`.
*
* @param mixed $class
* @return mixed
* @throws Exception
*/
protected function count($class)
{
return $this->getFromCache(function () use ($class) {
return $this->query($class, function ($current, $old) {
return [
$current->count(),
$old->count(),
];
});
});
}
/**
* Returns the sum of the given eloquent model `$class` and its column `$column`.
*
* @param mixed $class
* @param mixed $column
* @return mixed
* @throws Exception
*/
protected function sum($class, $column)
{
return $this->getFromCache(function () use ($class, $column) {
return $this->query($class, function ($current, $old) use ($column) {
return [
$current->sum($column),
$old->sum($column),
];
});
});
}
/**
* Returns the max of the given eloquent model `$class` and its column `$column`.
*
* @param mixed $class
* @param mixed $column
* @return mixed
* @throws Exception
*/
protected function max($class, $column)
{
return $this->getFromCache(function () use ($class, $column) {
return $this->query($class, function ($current, $old) use ($column) {
return [
$current->max($column),
$old->max($column),
];
});
});
}
/**
* Returns the min of the given eloquent model `$class` and its column `$column`.
*
* @param mixed $class
* @param mixed $column
* @return mixed
* @throws Exception
*/
protected function min($class, $column)
{
return $this->getFromCache(function () use ($class, $column) {
return $this->query($class, function ($current, $old) use ($column) {
return [
$current->min($column),
$old->min($column),
];
});
});
}
/**
* Check if the cache contains a metric and returns the value, otherwise it'll refetch the data.
*
* @param Closure $callback
* @return mixed
* @throws Exception
*/
public function getFromCache(Closure $callback)
{
$cacheName = class_basename($this);
return cache()->remember("$cacheName.valueMetric", $this->cacheFor(), $callback);
}
/**
* Returns the required blade view to render.
*
* @return string
*/
public function component()
{
return 'nebula::metrics.value';
}
}
================================================
FILE: src/Nebula.php
================================================
<?php
namespace Larsklopstra\Nebula;
use Larsklopstra\Nebula\Contracts\NebulaDashboard;
use Larsklopstra\Nebula\Contracts\NebulaPage;
use Larsklopstra\Nebula\Contracts\NebulaResource;
class Nebula
{
protected static array $resources = [];
protected static array $dashboards = [];
protected static array $pages = [];
/**
* Manually register resources.
*
* @param array $resources
* @return static
*/
public static function resources(array $resources = [])
{
static::$resources = array_unique(
array_merge(static::$resources, $resources)
);
return new static;
}
/**
* Manually register dashboards.
*
* @param array $dashboards
* @return static
*/
public static function dashboards(array $dashboards = [])
{
static::$dashboards = array_unique(
array_merge(static::$dashboards, $dashboards)
);
return new static;
}
/**
* Manually register pages.
*
* @param array $pages
* @return static
*/
public static function pages(array $pages = [])
{
static::$pages = array_unique(
array_merge(static::$pages, $pages)
);
return new static;
}
/**
* Get the registered resources.
*
* @return array
*/
public static function availableResources()
{
return collect(static::$resources)
->map(fn ($resource) => $resource instanceof NebulaResource ? $resource : new $resource)
->merge(config('nebula.resources'))
->unique()
->toArray();
}
/**
* Get the registered dashboards.
*
* @return array
*/
public static function availableDashboards()
{
return collect(static::$dashboards)
->map(fn ($dashboard) => $dashboard instanceof NebulaDashboard ? $dashboard : new $dashboard)
->merge(config('nebula.dashboards'))
->unique()
->toArray();
}
/**
* Get the registered pages.
*
* @return array
*/
public static function availablePages()
{
return collect(static::$pages)
->map(fn ($page) => $page instanceof NebulaPage ? $page : new $page)
->merge(config('nebula.pages'))
->unique()
->toArray();
}
}
================================================
FILE: src/NebulaServiceProvider.php
================================================
<?php
namespace Larsklopstra\Nebula;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Larsklopstra\Nebula\Console\Commands\InstallCommand;
use Larsklopstra\Nebula\Console\Commands\MakeDashboardCommand;
use Larsklopstra\Nebula\Console\Commands\MakeFieldCommand;
use Larsklopstra\Nebula\Console\Commands\MakeFilterCommand;
use Larsklopstra\Nebula\Console\Commands\MakePageCommand;
use Larsklopstra\Nebula\Console\Commands\MakeResourceCommand;
use Larsklopstra\Nebula\Console\Commands\MakeValueMetricCommand;
use Larsklopstra\Nebula\Http\RouteResolvers\DashboardResolver;
use Larsklopstra\Nebula\Http\RouteResolvers\ItemResolver;
use Larsklopstra\Nebula\Http\RouteResolvers\PageResolver;
use Larsklopstra\Nebula\Http\RouteResolvers\ResourceResolver;
class NebulaServiceProvider extends ServiceProvider
{
public function boot(): void
{
$this->loadJsonTranslationsFrom(__DIR__.'/../resources/lang', 'nebula');
$this->loadViewsFrom(__DIR__.'/../resources/views', 'nebula');
$this->loadRoutesFrom(__DIR__.'/../routes/web.php');
$this->loadViewComponentsAs('nebula', []);
$this->mapWebRoutes();
ResourceResolver::bind();
ItemResolver::bind();
DashboardResolver::bind();
PageResolver::bind();
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../config/nebula.php' => config_path('nebula.php'),
], 'config');
$this->publishes([
__DIR__.'/../public' => public_path('vendor/nebula'),
], 'public');
$this->commands([
InstallCommand::class,
MakeResourceCommand::class,
MakeValueMetricCommand::class,
MakeDashboardCommand::class,
MakeFilterCommand::class,
MakeFieldCommand::class,
MakePageCommand::class,
]);
}
}
public function register(): void
{
$this->mergeConfigFrom(__DIR__.'/../config/nebula.php', 'nebula');
}
public function mapWebRoutes(): void
{
Route::middleware(['web', config('nebula.auth_strategy')])
->prefix(config('nebula.prefix'))
->domain(config('nebula.domain', null))
->name('nebula.')
->group(__DIR__.'/../routes/web.php');
}
}
================================================
FILE: src/Traits/Toasts.php
================================================
<?php
namespace Larsklopstra\Nebula\Traits;
use Illuminate\Contracts\Container\BindingResolutionException;
trait Toasts
{
/**
* Flash a toast message to the session.
*
* @param string $message
* @return void
* @throws BindingResolutionException
*/
public function toast(string $message): void
{
session()->flash('toast', $message);
}
}
================================================
FILE: tailwind.config.js
================================================
const { fontFamily } = require('tailwindcss/defaultTheme')
module.exports = {
purge: {
content: ['./resources/views/**/*.blade.php'],
options: {
whitelist: [
'col-span-1',
'col-span-2',
'col-span-3',
'col-span-4',
'col-span-5',
'col-span-6',
'col-span-7',
'col-span-8',
'col-span-9',
'col-span-10',
'col-span-11',
'col-span-12',
],
},
},
future: {
removeDeprecatedGapUtilities: true,
purgeLayersByDefault: true,
},
// Yes, living on the edge 🤘
experimental: {
extendedSpacingScale: true,
uniformColorPalette: true,
defaultLineHeights: true,
applyComplexClasses: true,
},
theme: {
extend: {
fontFamily: {
display: ['DM Sans', ...fontFamily.sans],
sans: ['Inter', ...fontFamily.sans],
mono: ['DM mono', ...fontFamily.mono],
},
colors: {
primary: {
50: '#ebf5ff',
100: '#e1effe',
200: '#c3ddfd',
300: '#a4cafe',
400: '#76a9fa',
500: '#3f83f8',
600: '#1c64f2',
700: '#1a56db',
800: '#1e429f',
900: '#233876',
},
success: {
50: '#f3faf7',
100: '#def7ec',
200: '#bcf0da',
300: '#84e1bc',
400: '#31c48d',
500: '#0e9f6e',
600: '#057a55',
700: '#046c4e',
800: '#03543f',
900: '#014737',
},
danger: {
50: '#fdf2f2',
100: '#fde8e8',
200: '#fbd5d5',
300: '#f8b4b4',
400: '#f98080',
500: '#f05252',
600: '#e02424',
700: '#c81e1e',
800: '#9b1c1c',
900: '#771d1d',
},
},
boxShadow: {
default: [
'0 1px 1px 0 rgba(0, 0, 0, 0.12)',
'0 2px 4px 0 rgba(0, 0, 0, 0.04)',
'0 2px 8px 0 rgba(0, 0, 0, 0.02)',
].join(', '),
sm: [
'0 1px 1px 0 rgba(0, 0, 0, 0.08)',
'0 2px 3px 0 rgba(0, 0, 0, 0.02)',
'0 3px 6px 0 rgba(0, 0, 0, 0.01)',
].join(', '),
},
},
},
plugins: [require('@tailwindcss/custom-forms')],
}
================================================
FILE: tests/ConsoleCommandTest.php
================================================
<?php
namespace Larsklopstra\Nebula\Tests;
use Larsklopstra\Nebula\Tests\TestCase;
use Symfony\Component\Console\Exception\RuntimeException;
final class ConsoleCommandTest extends TestCase
{
/** @test can run php artisan nebula:install */
public function can_run_artisan_nebula_install()
{
$command = $this->artisan('nebula:install');
$command->assertExitCode(0);
}
/** @test can run php artisan nebula:dashboard */
public function can_run_artisan_nebula_dashboard()
{
$command = $this->artisan('nebula:dashboard', ['name' => 'Users/UserDashboard']);
$command->assertExitCode(0);
}
/** @test cannot run php artisan nebula:dashboard */
public function cannot_run_artisan_nebula_dashboard_without_name()
{
$this->expectException(RuntimeException::class);
$this->artisan('nebula:dashboard');
}
/** @test can run php artisan nebula:field */
public function can_run_artisan_nebula_field()
{
$command = $this->artisan('nebula:field', ['name' => 'Users/UserField']);
$command->assertExitCode(0);
}
/** @test cannot run php artisan nebula:field */
public function cannot_run_artisan_nebula_field_without_name()
{
$this->expectException(RuntimeException::class);
$this->artisan('nebula:field');
}
/** @test can run php artisan nebula:filter */
public function can_run_artisan_nebula_filter()
{
$command = $this->artisan('nebula:filter', ['name' => 'Users/UserFilter']);
$command->assertExitCode(0);
}
/** @test cannot run php artisan nebula:filter */
public function cannot_run_artisan_nebula_filter_without_name()
{
$this->expectException(RuntimeException::class);
$this->artisan('nebula:filter');
}
/** @test can run php artisan nebula:resource */
public function can_run_artisan_nebula_resource()
{
$command = $this->artisan('nebula:resource', ['name' => 'Users/UserResource']);
$command->assertExitCode(0);
}
/** @test cannot run php artisan nebula:resource */
public function cannot_run_artisan_nebula_resource_without_name()
{
$this->expectException(RuntimeException::class);
$this->artisan('nebula:resource');
}
/** @test can run php artisan nebula:resource */
public function can_run_artisan_nebula_value()
{
$command = $this->artisan('nebula:value', ['name' => 'Users/UserValue']);
$command->assertExitCode(0);
}
/** @test cannot run php artisan nebula:value */
public function cannot_run_artisan_nebula_value_without_name()
{
$this->expectException(RuntimeException::class);
$this->artisan('nebula:value');
}
/** @test can run php artisan nebula:page */
public function can_run_artisan_nebula_page()
{
$command = $this->artisan('nebula:page', ['name' => 'ExamplePage']);
$command->assertExitCode(0);
}
/** @test cannot run php artisan nebula:page */
public function cannot_run_artisan_nebula_page_without_name()
{
$this->expectException(RuntimeException::class);
$this->artisan('nebula:page');
}
}
================================================
FILE: tests/RegistrationMethodsTest.php
================================================
<?php
namespace Larsklopstra\Nebula\Tests;
class RegistrationMethodsTest extends TestCase
{
//
}
================================================
FILE: tests/TestCase.php
================================================
<?php
namespace Larsklopstra\Nebula\Tests;
use Larsklopstra\Nebula\NebulaServiceProvider;
use Orchestra\Testbench\TestCase as BaseTestCase;
class TestCase extends BaseTestCase
{
protected function getPackageProviders($app)
{
return [NebulaServiceProvider::class];
}
}
================================================
FILE: webpack.mix.js
================================================
const mix = require('laravel-mix')
mix
.postCss('resources/css/app.css', 'public/css', require('tailwindcss'))
.setPublicPath('public')
.copy('public', '../../public/vendor/nebula')
.disableNotifications()
if (mix.inProduction()) {
mix.version()
}
gitextract_2bgbphje/ ├── .editorconfig ├── .gitattributes ├── .github/ │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── FUNDING.yml │ ├── LICENSE.md │ ├── README.md │ └── workflows/ │ └── tests.yml ├── .gitignore ├── .php_cs.dist ├── .prettierrc ├── composer.json ├── config/ │ └── nebula.php ├── package.json ├── phpunit.xml.dist ├── public/ │ ├── css/ │ │ └── app.css │ └── mix-manifest.json ├── resources/ │ ├── css/ │ │ └── app.css │ ├── lang/ │ │ ├── de.json │ │ └── nl.json │ └── views/ │ ├── components/ │ │ ├── card.blade.php │ │ ├── container.blade.php │ │ ├── error.blade.php │ │ ├── fields/ │ │ │ ├── details/ │ │ │ │ ├── boolean.blade.php │ │ │ │ ├── color.blade.php │ │ │ │ ├── date.blade.php │ │ │ │ ├── input.blade.php │ │ │ │ ├── select.blade.php │ │ │ │ └── textarea.blade.php │ │ │ ├── forms/ │ │ │ │ ├── boolean.blade.php │ │ │ │ ├── color.blade.php │ │ │ │ ├── date.blade.php │ │ │ │ ├── input.blade.php │ │ │ │ ├── select.blade.php │ │ │ │ └── textarea.blade.php │ │ │ └── tables/ │ │ │ ├── boolean.blade.php │ │ │ ├── color.blade.php │ │ │ ├── date.blade.php │ │ │ ├── input.blade.php │ │ │ ├── select.blade.php │ │ │ └── textarea.blade.php │ │ ├── form-actions.blade.php │ │ ├── form-row.blade.php │ │ ├── form.blade.php │ │ ├── helper-text.blade.php │ │ ├── label.blade.php │ │ ├── layouts/ │ │ │ ├── app.blade.php │ │ │ └── shell.blade.php │ │ ├── metric-card.blade.php │ │ ├── metrics/ │ │ │ └── value.blade.php │ │ └── pagination.blade.php │ ├── dashboards/ │ │ ├── default-metrics.blade.php │ │ ├── default.blade.php │ │ └── index.blade.php │ ├── pages/ │ │ └── index.blade.php │ ├── resources/ │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ └── start.blade.php ├── routes/ │ └── web.php ├── src/ │ ├── Console/ │ │ └── Commands/ │ │ ├── InstallCommand.php │ │ ├── MakeDashboardCommand.php │ │ ├── MakeFieldCommand.php │ │ ├── MakeFilterCommand.php │ │ ├── MakePageCommand.php │ │ ├── MakeResourceCommand.php │ │ ├── MakeValueMetricCommand.php │ │ └── stubs/ │ │ ├── dashboard.stub │ │ ├── field.stub │ │ ├── filter.stub │ │ ├── page.stub │ │ ├── resource.stub │ │ └── value.stub │ ├── Contracts/ │ │ ├── NebulaDashboard.php │ │ ├── NebulaField.php │ │ ├── NebulaFilter.php │ │ ├── NebulaMetric.php │ │ ├── NebulaPage.php │ │ ├── NebulaResource.php │ │ ├── ShouldCache.php │ │ ├── ShouldRender.php │ │ └── ShouldSpanCols.php │ ├── Fields/ │ │ ├── Boolean.php │ │ ├── Color.php │ │ ├── Concerns/ │ │ │ ├── HasHelperText.php │ │ │ └── HasPlaceholder.php │ │ ├── Date.php │ │ ├── Input.php │ │ ├── Select.php │ │ └── Textarea.php │ ├── Http/ │ │ ├── Concerns/ │ │ │ └── AuthorizesRequests.php │ │ ├── Controllers/ │ │ │ ├── DashboardController.php │ │ │ ├── PageController.php │ │ │ ├── ResourceController.php │ │ │ └── StartController.php │ │ ├── Middleware/ │ │ │ ├── NebulaEmailAuthStrategy.php │ │ │ └── NebulaIPAuthStrategy.php │ │ └── RouteResolvers/ │ │ ├── DashboardResolver.php │ │ ├── ItemResolver.php │ │ ├── PageResolver.php │ │ ├── Resolver.php │ │ └── ResourceResolver.php │ ├── Metrics/ │ │ └── ValueMetric.php │ ├── Nebula.php │ ├── NebulaServiceProvider.php │ └── Traits/ │ └── Toasts.php ├── tailwind.config.js ├── tests/ │ ├── ConsoleCommandTest.php │ ├── RegistrationMethodsTest.php │ └── TestCase.php └── webpack.mix.js
SYMBOL INDEX (188 symbols across 43 files)
FILE: src/Console/Commands/InstallCommand.php
class InstallCommand (line 7) | class InstallCommand extends Command
method handle (line 13) | public function handle()
FILE: src/Console/Commands/MakeDashboardCommand.php
class MakeDashboardCommand (line 7) | class MakeDashboardCommand extends GeneratorCommand
method getStub (line 15) | protected function getStub()
method getDefaultNamespace (line 20) | protected function getDefaultNamespace($rootNamespace)
FILE: src/Console/Commands/MakeFieldCommand.php
class MakeFieldCommand (line 7) | class MakeFieldCommand extends GeneratorCommand
method getStub (line 15) | protected function getStub()
method getDefaultNamespace (line 20) | protected function getDefaultNamespace($rootNamespace)
FILE: src/Console/Commands/MakeFilterCommand.php
class MakeFilterCommand (line 7) | class MakeFilterCommand extends GeneratorCommand
method getStub (line 15) | protected function getStub()
method getDefaultNamespace (line 20) | protected function getDefaultNamespace($rootNamespace)
FILE: src/Console/Commands/MakePageCommand.php
class MakePageCommand (line 9) | class MakePageCommand extends GeneratorCommand
method handle (line 17) | public function handle()
method buildClass (line 26) | protected function buildClass($name)
method getStub (line 35) | protected function getStub()
method getDefaultNamespace (line 40) | protected function getDefaultNamespace($rootNamespace)
method viewName (line 45) | protected function viewName()
FILE: src/Console/Commands/MakeResourceCommand.php
class MakeResourceCommand (line 7) | class MakeResourceCommand extends GeneratorCommand
method getStub (line 15) | protected function getStub()
method getDefaultNamespace (line 20) | protected function getDefaultNamespace($rootNamespace)
FILE: src/Console/Commands/MakeValueMetricCommand.php
class MakeValueMetricCommand (line 7) | class MakeValueMetricCommand extends GeneratorCommand
method getStub (line 15) | protected function getStub()
method getDefaultNamespace (line 20) | protected function getDefaultNamespace($rootNamespace)
FILE: src/Contracts/NebulaDashboard.php
class NebulaDashboard (line 8) | abstract class NebulaDashboard
method metrics (line 15) | public function metrics(): array
method icon (line 25) | public function icon()
method name (line 35) | public function name()
method singularName (line 49) | public function singularName()
method pluralName (line 61) | public function pluralName()
method display (line 71) | public function display()
method displayMetrics (line 81) | public function displayMetrics()
method render (line 93) | public function render()
method label (line 105) | public function label()
FILE: src/Contracts/NebulaField.php
class NebulaField (line 8) | abstract class NebulaField
method __construct (line 22) | public function __construct(string $label, string $name = null)
method make (line 35) | public static function make(string $label, string $name = null): self
method name (line 46) | public function name(string $name): self
method label (line 61) | public function label($label): self
method value (line 75) | public function value($value): self
method required (line 88) | public function required(bool $required = true): self
method rules (line 101) | public function rules($rules): self
method getName (line 119) | public function getName()
method getLabel (line 129) | public function getLabel()
method getValue (line 139) | public function getValue()
method getRequired (line 149) | public function getRequired(): bool
method getRules (line 159) | public function getRules(): array
method getDetailsComponent (line 169) | public function getDetailsComponent()
method getComponentName (line 179) | public function getComponentName()
method getFormComponent (line 192) | public function getFormComponent()
method getTableComponent (line 202) | public function getTableComponent()
FILE: src/Contracts/NebulaFilter.php
class NebulaFilter (line 10) | abstract class NebulaFilter
method name (line 17) | public function name()
method label (line 27) | public function label()
method build (line 44) | abstract public function build(Builder $query, Request $request): Buil...
FILE: src/Contracts/NebulaMetric.php
class NebulaMetric (line 8) | abstract class NebulaMetric implements ShouldCache, ShouldRender, Should...
method label (line 15) | public function label()
method colSpan (line 25) | public function colSpan(): int
method calculate (line 35) | abstract public function calculate();
method cacheFor (line 42) | public function cacheFor()
method getFromCache (line 53) | abstract public function getFromCache(Closure $callback);
method component (line 60) | abstract public function component();
FILE: src/Contracts/NebulaPage.php
class NebulaPage (line 10) | abstract class NebulaPage
method icon (line 19) | public function icon()
method name (line 29) | public function name()
method slug (line 40) | public function slug()
method display (line 50) | public function display()
method canSee (line 65) | public function canSee(Closure $callback)
FILE: src/Contracts/NebulaResource.php
class NebulaResource (line 9) | abstract class NebulaResource
method searchable (line 15) | public function searchable()
method metrics (line 25) | public function metrics(): array
method icon (line 35) | public function icon()
method model (line 46) | public function model()
method name (line 69) | public function name()
method singularName (line 83) | public function singularName()
method pluralName (line 95) | public function pluralName()
method fields (line 105) | abstract public function fields(): array;
method indexFields (line 112) | public function indexFields(): array
method editFields (line 122) | public function editFields(): array
method createFields (line 132) | public function createFields(): array
method filters (line 137) | public function filters(): array
method rules (line 148) | public function rules(array $fields): array
method resolveFilter (line 168) | public function resolveFilter(string $name)
method indexQuery (line 185) | public function indexQuery()
method updateQuery (line 199) | public function updateQuery($model, $data)
method storeQuery (line 211) | public function storeQuery($model, $data)
method destroyQuery (line 222) | public function destroyQuery($model)
FILE: src/Contracts/ShouldCache.php
type ShouldCache (line 5) | interface ShouldCache
method cacheFor (line 7) | public function cacheFor();
FILE: src/Contracts/ShouldRender.php
type ShouldRender (line 5) | interface ShouldRender
method component (line 7) | public function component();
FILE: src/Contracts/ShouldSpanCols.php
type ShouldSpanCols (line 5) | interface ShouldSpanCols
method colSpan (line 7) | public function colSpan();
FILE: src/Fields/Boolean.php
class Boolean (line 7) | class Boolean extends NebulaField
method true (line 18) | public function true(string $label): self
method false (line 31) | public function false(string $label): self
method getTrue (line 38) | public function getTrue()
method getFalse (line 43) | public function getFalse()
FILE: src/Fields/Color.php
class Color (line 7) | class Color extends NebulaField
method colors (line 27) | public function colors(array $colors): self
method getColors (line 39) | public function getColors(): array
FILE: src/Fields/Concerns/HasHelperText.php
type HasHelperText (line 5) | trait HasHelperText
method helperText (line 15) | public function helperText(string $helperText): self
method getHelperText (line 27) | public function getHelperText(): string
FILE: src/Fields/Concerns/HasPlaceholder.php
type HasPlaceholder (line 5) | trait HasPlaceholder
method placeholder (line 15) | public function placeholder(string $placeholder): self
method getPlaceholder (line 27) | public function getPlaceholder(): string
FILE: src/Fields/Date.php
class Date (line 10) | class Date extends NebulaField
method applyFormat (line 23) | public function applyFormat($date)
method format (line 34) | public function format(string $format): self
FILE: src/Fields/Input.php
class Input (line 9) | class Input extends NebulaField
method type (line 21) | public function type($type): self
method getType (line 33) | public function getType()
FILE: src/Fields/Select.php
class Select (line 8) | class Select extends NebulaField
method options (line 20) | public function options(array $options): self
method getOptions (line 32) | public function getOptions(): array
FILE: src/Fields/Textarea.php
class Textarea (line 9) | class Textarea extends NebulaField
FILE: src/Http/Concerns/AuthorizesRequests.php
type AuthorizesRequests (line 8) | trait AuthorizesRequests
method authorize (line 10) | protected function authorize($ability, $model)
FILE: src/Http/Controllers/DashboardController.php
class DashboardController (line 11) | class DashboardController
method index (line 22) | public function index(NebulaDashboard $dashboard): View
FILE: src/Http/Controllers/PageController.php
class PageController (line 9) | class PageController
method index (line 11) | public function index(Request $request, NebulaPage $page)
FILE: src/Http/Controllers/ResourceController.php
class ResourceController (line 15) | class ResourceController
method index (line 28) | public function index(Request $request, NebulaResource $resource): View
method show (line 63) | public function show(NebulaResource $resource, $item): View
method edit (line 81) | public function edit(NebulaResource $resource, $item): View
method update (line 100) | public function update(Request $request, NebulaResource $resource, $it...
method create (line 124) | public function create(NebulaResource $resource): View
method store (line 142) | public function store(Request $request, NebulaResource $resource): Red...
method destroy (line 168) | public function destroy(NebulaResource $resource, $item): RedirectResp...
FILE: src/Http/Controllers/StartController.php
class StartController (line 8) | class StartController
method __invoke (line 16) | public function __invoke(): View
FILE: src/Http/Middleware/NebulaEmailAuthStrategy.php
class NebulaEmailAuthStrategy (line 11) | class NebulaEmailAuthStrategy
method handle (line 23) | public function handle(Request $request, Closure $next)
FILE: src/Http/Middleware/NebulaIPAuthStrategy.php
class NebulaIPAuthStrategy (line 12) | class NebulaIPAuthStrategy
method handle (line 25) | public function handle(Request $request, Closure $next)
FILE: src/Http/RouteResolvers/DashboardResolver.php
class DashboardResolver (line 10) | class DashboardResolver extends Resolver
method bind (line 20) | public static function bind(): void
FILE: src/Http/RouteResolvers/ItemResolver.php
class ItemResolver (line 7) | class ItemResolver extends Resolver
method bind (line 15) | public static function bind(): void
FILE: src/Http/RouteResolvers/PageResolver.php
class PageResolver (line 10) | class PageResolver extends Resolver
method bind (line 20) | public static function bind(): void
FILE: src/Http/RouteResolvers/Resolver.php
class Resolver (line 5) | abstract class Resolver
method bind (line 7) | abstract public static function bind(): void;
FILE: src/Http/RouteResolvers/ResourceResolver.php
class ResourceResolver (line 10) | class ResourceResolver extends Resolver
method bind (line 20) | public static function bind(): void
FILE: src/Metrics/ValueMetric.php
class ValueMetric (line 9) | abstract class ValueMetric extends NebulaMetric
method prefix (line 16) | public function prefix()
method suffix (line 26) | public function suffix()
method calculateDifference (line 36) | public function calculateDifference()
method query (line 54) | protected function query($class, Closure $callback)
method average (line 73) | protected function average($class, $column)
method count (line 92) | protected function count($class)
method sum (line 112) | protected function sum($class, $column)
method max (line 132) | protected function max($class, $column)
method min (line 152) | protected function min($class, $column)
method getFromCache (line 171) | public function getFromCache(Closure $callback)
method component (line 183) | public function component()
FILE: src/Nebula.php
class Nebula (line 9) | class Nebula
method resources (line 23) | public static function resources(array $resources = [])
method dashboards (line 38) | public static function dashboards(array $dashboards = [])
method pages (line 53) | public static function pages(array $pages = [])
method availableResources (line 67) | public static function availableResources()
method availableDashboards (line 81) | public static function availableDashboards()
method availablePages (line 95) | public static function availablePages()
FILE: src/NebulaServiceProvider.php
class NebulaServiceProvider (line 19) | class NebulaServiceProvider extends ServiceProvider
method boot (line 21) | public function boot(): void
method register (line 56) | public function register(): void
method mapWebRoutes (line 61) | public function mapWebRoutes(): void
FILE: src/Traits/Toasts.php
type Toasts (line 7) | trait Toasts
method toast (line 16) | public function toast(string $message): void
FILE: tests/ConsoleCommandTest.php
class ConsoleCommandTest (line 8) | final class ConsoleCommandTest extends TestCase
method can_run_artisan_nebula_install (line 11) | public function can_run_artisan_nebula_install()
method can_run_artisan_nebula_dashboard (line 19) | public function can_run_artisan_nebula_dashboard()
method cannot_run_artisan_nebula_dashboard_without_name (line 27) | public function cannot_run_artisan_nebula_dashboard_without_name()
method can_run_artisan_nebula_field (line 35) | public function can_run_artisan_nebula_field()
method cannot_run_artisan_nebula_field_without_name (line 43) | public function cannot_run_artisan_nebula_field_without_name()
method can_run_artisan_nebula_filter (line 51) | public function can_run_artisan_nebula_filter()
method cannot_run_artisan_nebula_filter_without_name (line 59) | public function cannot_run_artisan_nebula_filter_without_name()
method can_run_artisan_nebula_resource (line 67) | public function can_run_artisan_nebula_resource()
method cannot_run_artisan_nebula_resource_without_name (line 75) | public function cannot_run_artisan_nebula_resource_without_name()
method can_run_artisan_nebula_value (line 83) | public function can_run_artisan_nebula_value()
method cannot_run_artisan_nebula_value_without_name (line 91) | public function cannot_run_artisan_nebula_value_without_name()
method can_run_artisan_nebula_page (line 99) | public function can_run_artisan_nebula_page()
method cannot_run_artisan_nebula_page_without_name (line 107) | public function cannot_run_artisan_nebula_page_without_name()
FILE: tests/RegistrationMethodsTest.php
class RegistrationMethodsTest (line 5) | class RegistrationMethodsTest extends TestCase
FILE: tests/TestCase.php
class TestCase (line 8) | class TestCase extends BaseTestCase
method getPackageProviders (line 10) | protected function getPackageProviders($app)
Condensed preview — 112 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (141K chars).
[
{
"path": ".editorconfig",
"chars": 336,
"preview": "; This file is for unifying the coding style for different editors and IDEs.\n; More information at http://editorconfig.o"
},
{
"path": ".gitattributes",
"chars": 497,
"preview": "# Path-based git attributes\n# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html\n\n# Ignore all test and"
},
{
"path": ".github/CHANGELOG.md",
"chars": 377,
"preview": "# Changelog\n\nAll notable changes to `nebula` will be documented in this file\n\n## 0.2.0 - 2020-09-24\n\n- Table components\n"
},
{
"path": ".github/CONTRIBUTING.md",
"chars": 2020,
"preview": "# Contributing\n\nContributions are **welcome** and will be fully **credited**.\n\nPlease read and understand the contributi"
},
{
"path": ".github/FUNDING.yml",
"chars": 23,
"preview": "github: [larsklopstra]\n"
},
{
"path": ".github/LICENSE.md",
"chars": 1064,
"preview": "MIT License\n\nCopyright (c) Lars Klopstra\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
},
{
"path": ".github/README.md",
"chars": 1992,
"preview": "# Nebula\n\n<p align=\"center\"><a href=\"https://nebulapackage.com\" target=\"_blank\"><img src=\"https://nebulapackage.com/prev"
},
{
"path": ".github/workflows/tests.yml",
"chars": 983,
"preview": "name: Tests\n\non:\n push:\n pull_request:\n\njobs:\n tests:\n runs-on: ${{ matrix.os }}\n strategy:\n "
},
{
"path": ".gitignore",
"chars": 96,
"preview": "build\ncomposer.lock\ndocs\nvendor\ncoverage\nnode_modules\n.php_cs.cache\n.idea\n.phpunit.result.cache\n"
},
{
"path": ".php_cs.dist",
"chars": 4611,
"preview": "<?php\n\nuse PhpCsFixer\\Config;\nuse PhpCsFixer\\Finder;\n\n$rules = [\n 'array_syntax' => ['syntax' => 'short'],\n 'binar"
},
{
"path": ".prettierrc",
"chars": 199,
"preview": "{\n \"arrowParens\": \"avoid\",\n \"tabWidth\": 2,\n \"printWidth\": 100,\n \"vueIndentScriptAndStyle\": false,\n \"quoteProps\": \"c"
},
{
"path": "composer.json",
"chars": 1244,
"preview": "{\n \"name\": \"larsklopstra/nebula\",\n \"description\": \"Nebula, an open-source and easy to use admin panel for Laravel.\",\n "
},
{
"path": "config/nebula.php",
"chars": 500,
"preview": "<?php\n\nuse Larsklopstra\\Nebula\\Http\\Middleware\\NebulaIPAuthStrategy;\n\nreturn [\n\n 'name' => 'Nebula',\n\n 'prefix' =>"
},
{
"path": "package.json",
"chars": 1027,
"preview": "{\n \"name\": \"nebula\",\n \"description\": \"Nebula, a Laravel dashboard\",\n \"scripts\": {\n \"dev\": \"npm run development\",\n "
},
{
"path": "phpunit.xml.dist",
"chars": 1039,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit bootstrap=\"vendor/autoload.php\"\n backupGlobals=\"false\"\n "
},
{
"path": "public/css/app.css",
"chars": 19113,
"preview": "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adju"
},
{
"path": "public/mix-manifest.json",
"chars": 63,
"preview": "{\n \"/css/app.css\": \"/css/app.css?id=e4cc3cee8f0618af5d92\"\n}\n"
},
{
"path": "resources/css/app.css",
"chars": 654,
"preview": "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n@layer components {\n .button {\n @apply inline-flex items"
},
{
"path": "resources/lang/de.json",
"chars": 1036,
"preview": "{\n \"Resources\": \"Resourcen\",\n \":Resources overview\": \":Resourcen Übersicht\",\n \":Resource details\": \":Resource Details"
},
{
"path": "resources/lang/nl.json",
"chars": 1051,
"preview": "{\n \"Resources\": \"Bronnen\",\n \":Resources overview\": \":Resources overzicht\",\n \":Resource details\": \":Resource details\","
},
{
"path": "resources/views/components/card.blade.php",
"chars": 323,
"preview": "@props(['title' => false])\n\n<div class=\"overflow-hidden bg-white divide-y divide-gray-200 rounded-lg shadow\">\n\n @if ("
},
{
"path": "resources/views/components/container.blade.php",
"chars": 75,
"preview": "<div class=\"w-full max-w-6xl px-4 mx-auto sm:px-8\">\n {{ $slot }}\n</div>\n"
},
{
"path": "resources/views/components/error.blade.php",
"chars": 117,
"preview": "@props(['for'])\n\n@error($for->getName())\n<p class=\"text-sm font-medium text-danger-600\">{{ $message }}</p>\n@enderror\n"
},
{
"path": "resources/views/components/fields/details/boolean.blade.php",
"chars": 529,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n @if (Arr::get($item, $field->getName()) ?? "
},
{
"path": "resources/views/components/fields/details/color.blade.php",
"chars": 233,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <div class=\"w-8 h-8 bg-current rounded\"\n "
},
{
"path": "resources/views/components/fields/details/date.blade.php",
"chars": 221,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <p class=\"text-sm\">\n {{ $field->appl"
},
{
"path": "resources/views/components/fields/details/input.blade.php",
"chars": 200,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <p class=\"text-sm\">\n {{ Arr::get($it"
},
{
"path": "resources/views/components/fields/details/select.blade.php",
"chars": 236,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <p class=\"text-sm\">\n {{ array_search"
},
{
"path": "resources/views/components/fields/details/textarea.blade.php",
"chars": 790,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <div x-data=\"{ expanded: false }\">\n\n "
},
{
"path": "resources/views/components/fields/forms/boolean.blade.php",
"chars": 543,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <input type=\"hidden\" value=\"0\" name=\"{{ $fi"
},
{
"path": "resources/views/components/fields/forms/color.blade.php",
"chars": 751,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <div class=\"space-y-2\">\n\n <div class"
},
{
"path": "resources/views/components/fields/forms/date.blade.php",
"chars": 593,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <div class=\"space-y-2\">\n\n <input cla"
},
{
"path": "resources/views/components/fields/forms/input.blade.php",
"chars": 657,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <div class=\"space-y-2\">\n\n <input cla"
},
{
"path": "resources/views/components/fields/forms/select.blade.php",
"chars": 978,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <div class=\"space-y-2\">\n\n <select cl"
},
{
"path": "resources/views/components/fields/forms/textarea.blade.php",
"chars": 625,
"preview": "@props(['field', 'item' => null])\n\n<x-nebula::form-row :field=\"$field\">\n\n <div class=\"space-y-2\">\n\n <textarea "
},
{
"path": "resources/views/components/fields/tables/boolean.blade.php",
"chars": 432,
"preview": "@props(['field', 'item' => null])\n\n@if (Arr::get($item, $field->getName()) ?? $field->getValue())\n <span class=\"inlin"
},
{
"path": "resources/views/components/fields/tables/color.blade.php",
"chars": 153,
"preview": "@props(['field', 'item'])\n\n<div class=\"w-4 h-4 bg-current rounded\" style=\"color: {{ Arr::get($item, $field->getName()) ?"
},
{
"path": "resources/views/components/fields/tables/date.blade.php",
"chars": 111,
"preview": "@props(['field', 'item'])\n\n{{ $field->applyFormat(Arr::get($item, $field->getName()) ?? $field->getValue()) }}\n"
},
{
"path": "resources/views/components/fields/tables/input.blade.php",
"chars": 68,
"preview": "@props(['field', 'item'])\n\n{{ Arr::get($item, $field->getName()) }}\n"
},
{
"path": "resources/views/components/fields/tables/select.blade.php",
"chars": 126,
"preview": "@props(['field', 'item'])\n\n{{ array_search(Arr::get($item, $field->getName()) ?? $field->getValue(), $field->getOptions("
},
{
"path": "resources/views/components/fields/tables/textarea.blade.php",
"chars": 91,
"preview": "@props(['field', 'item'])\n\n{{ Str::limit(Arr::get($item, $field->getName()), 24, '...') }}\n"
},
{
"path": "resources/views/components/form-actions.blade.php",
"chars": 93,
"preview": "<footer class=\"flex items-center justify-end px-6 py-4 space-x-4\">\n {{ $slot }}\n</footer>\n"
},
{
"path": "resources/views/components/form-row.blade.php",
"chars": 287,
"preview": "<div class=\"grid md:grid-cols-3\">\n\n <div class=\"px-6 py-3\">\n\n <x-nebula::label :for=\"$field->getName()\">\n "
},
{
"path": "resources/views/components/form.blade.php",
"chars": 181,
"preview": "@props(['method' => 'POST', 'action' => ''])\n\n<form action=\"{{ $action }}\" method=\"{{ $method !== 'GET' ? 'POST' : 'GET'"
},
{
"path": "resources/views/components/helper-text.blade.php",
"chars": 131,
"preview": "@props(['for'])\n\n@if($for->getHelperText())\n<p class=\"text-sm font-medium text-gray-600\">{{ $for->getHelperText() }}</p>"
},
{
"path": "resources/views/components/label.blade.php",
"chars": 117,
"preview": "@props(['for' => null])\n\n<label class=\"text-sm font-medium text-gray-700\" for=\"{{ $for }}\">\n {{ $slot }}\n</label>\n"
},
{
"path": "resources/views/components/layouts/app.blade.php",
"chars": 1399,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-widt"
},
{
"path": "resources/views/components/layouts/shell.blade.php",
"chars": 8906,
"preview": "@props(['title' => config('nebula.name'), 'actions' => null, 'contextMenu' => null, 'back' => false])\n\n<x-nebula::layout"
},
{
"path": "resources/views/components/metric-card.blade.php",
"chars": 134,
"preview": "@props(['colSpan' => 4])\n\n<div class=\"overflow-hidden p-4 bg-white rounded-lg shadow col-span-{{ $colSpan }}\">\n {{ $s"
},
{
"path": "resources/views/components/metrics/value.blade.php",
"chars": 1516,
"preview": "@props(['metric'])\n\n<x-nebula::metric-card :col-span=\"$metric->colSpan()\">\n\n <h3 class=\"text-sm\">\n {{ $metric-"
},
{
"path": "resources/views/components/pagination.blade.php",
"chars": 1415,
"preview": "<div class=\"flex items-center justify-between\">\n\n <p class=\"text-sm text-gray-600\">\n {{ trans_choice(':count r"
},
{
"path": "resources/views/dashboards/default-metrics.blade.php",
"chars": 195,
"preview": "<div class=\"grid grid-cols-12 gap-6\">\n\n @foreach ($dashboard->metrics() as $metric)\n <x-dynamic-component :com"
},
{
"path": "resources/views/dashboards/default.blade.php",
"chars": 120,
"preview": "<h2 class=\"text-base font-medium font-display\">\n {{ $dashboard->label() }}\n</h2>\n\n{{ $dashboard->displayMetrics() }}\n"
},
{
"path": "resources/views/dashboards/index.blade.php",
"chars": 216,
"preview": "<x-nebula::layouts.shell :title=\"__(':Dashboard dashboard', ['dashboard' => $dashboard->singularName()])\">\n\n <div cla"
},
{
"path": "resources/views/pages/index.blade.php",
"chars": 153,
"preview": "<x-nebula::layouts.shell :title=\"$page->name()\">\n\n <div class=\"mb-8 space-y-4\">\n {{ $page->display() }}\n </"
},
{
"path": "resources/views/resources/create.blade.php",
"chars": 1325,
"preview": "<x-nebula::layouts.shell :title=\"__('Create :resource', ['resource' => $resource->singularName()])\"\n :back=\"route('ne"
},
{
"path": "resources/views/resources/edit.blade.php",
"chars": 1366,
"preview": "<x-nebula::layouts.shell :title=\"__('Edit :resource', ['resource' => $resource->singularName()])\"\n :back=\"route('nebu"
},
{
"path": "resources/views/resources/index.blade.php",
"chars": 4909,
"preview": "<x-nebula::layouts.shell :title=\"__(':Resources overview', ['resources' => $resource->pluralName()])\">\n\n <x-slot name"
},
{
"path": "resources/views/resources/show.blade.php",
"chars": 1630,
"preview": "<x-nebula::layouts.shell :title=\"__(':Resource details', ['resource' => $resource->singularName()])\"\n :back=\"route('n"
},
{
"path": "resources/views/start.blade.php",
"chars": 3466,
"preview": "<x-nebula::layouts.shell :title=\"__('Get started')\">\n\n <div class=\"space-y-8\">\n\n <header>\n\n <h1 cla"
},
{
"path": "routes/web.php",
"chars": 1309,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Route;\nuse Larsklopstra\\Nebula\\Http\\Controllers\\DashboardController;\nuse Larsklops"
},
{
"path": "src/Console/Commands/InstallCommand.php",
"chars": 602,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Console\\Commands;\n\nuse Illuminate\\Console\\Command;\n\nclass InstallCommand extends Co"
},
{
"path": "src/Console/Commands/MakeDashboardCommand.php",
"chars": 516,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Console\\Commands;\n\nuse Illuminate\\Console\\GeneratorCommand;\n\nclass MakeDashboardCom"
},
{
"path": "src/Console/Commands/MakeFieldCommand.php",
"chars": 492,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Console\\Commands;\n\nuse Illuminate\\Console\\GeneratorCommand;\n\nclass MakeFieldCommand"
},
{
"path": "src/Console/Commands/MakeFilterCommand.php",
"chars": 498,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Console\\Commands;\n\nuse Illuminate\\Console\\GeneratorCommand;\n\nclass MakeFilterComman"
},
{
"path": "src/Console/Commands/MakePageCommand.php",
"chars": 1152,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Console\\Commands;\n\nuse Illuminate\\Console\\GeneratorCommand;\nuse Illuminate\\Support\\"
},
{
"path": "src/Console/Commands/MakeResourceCommand.php",
"chars": 510,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Console\\Commands;\n\nuse Illuminate\\Console\\GeneratorCommand;\n\nclass MakeResourceComm"
},
{
"path": "src/Console/Commands/MakeValueMetricCommand.php",
"chars": 513,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Console\\Commands;\n\nuse Illuminate\\Console\\GeneratorCommand;\n\nclass MakeValueMetricC"
},
{
"path": "src/Console/Commands/stubs/dashboard.stub",
"chars": 269,
"preview": "<?php\n\nnamespace DummyNamespace;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaDashboard;\n\nclass DummyClass extends NebulaDas"
},
{
"path": "src/Console/Commands/stubs/field.stub",
"chars": 317,
"preview": "<?php\n\nnamespace DummyNamespace;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaField;\n\nclass DummyClass extends NebulaField\n{"
},
{
"path": "src/Console/Commands/stubs/filter.stub",
"chars": 310,
"preview": "<?php\n\nnamespace DummyNamespace;\n\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Http\\Request;\nuse Larsklopstr"
},
{
"path": "src/Console/Commands/stubs/page.stub",
"chars": 277,
"preview": "<?php\n\nnamespace DummyNamespace;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaPage;\n\nclass DummyClass extends NebulaPage\n{\n "
},
{
"path": "src/Console/Commands/stubs/resource.stub",
"chars": 298,
"preview": "<?php\n\nnamespace DummyNamespace;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaResource;\n\nclass DummyClass extends NebulaReso"
},
{
"path": "src/Console/Commands/stubs/value.stub",
"chars": 206,
"preview": "<?php\n\nnamespace DummyNamespace;\n\nuse Larsklopstra\\Nebula\\Metrics\\ValueMetric;\n\nclass DummyClass extends ValueMetric\n{\n "
},
{
"path": "src/Contracts/NebulaDashboard.php",
"chars": 2061,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Contracts;\n\nuse Illuminate\\Support\\Str;\nuse Illuminate\\Support\\Stringable;\n\nabstrac"
},
{
"path": "src/Contracts/NebulaField.php",
"chars": 3753,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Contracts;\n\nuse Illuminate\\Support\\Str;\nuse Illuminate\\Support\\Stringable;\n\nabstrac"
},
{
"path": "src/Contracts/NebulaFilter.php",
"chars": 927,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Contracts;\n\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Http\\Request;\n"
},
{
"path": "src/Contracts/NebulaMetric.php",
"chars": 1053,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Contracts;\n\nuse Closure;\nuse Illuminate\\Support\\Carbon;\n\nabstract class NebulaMetri"
},
{
"path": "src/Contracts/NebulaPage.php",
"chars": 1300,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Contracts;\n\nuse Closure;\nuse Exception;\nuse Illuminate\\Support\\Str;\nuse Illuminate\\"
},
{
"path": "src/Contracts/NebulaResource.php",
"chars": 4453,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Contracts;\n\nuse Exception;\nuse Illuminate\\Support\\Str;\nuse Illuminate\\Support\\Strin"
},
{
"path": "src/Contracts/ShouldCache.php",
"chars": 107,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Contracts;\n\ninterface ShouldCache\n{\n public function cacheFor();\n}\n"
},
{
"path": "src/Contracts/ShouldRender.php",
"chars": 109,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Contracts;\n\ninterface ShouldRender\n{\n public function component();\n}\n"
},
{
"path": "src/Contracts/ShouldSpanCols.php",
"chars": 109,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Contracts;\n\ninterface ShouldSpanCols\n{\n public function colSpan();\n}\n"
},
{
"path": "src/Fields/Boolean.php",
"chars": 777,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Fields;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaField;\n\nclass Boolean extends Nebu"
},
{
"path": "src/Fields/Color.php",
"chars": 715,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Fields;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaField;\n\nclass Color extends Nebula"
},
{
"path": "src/Fields/Concerns/HasHelperText.php",
"chars": 535,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Fields\\Concerns;\n\ntrait HasHelperText\n{\n protected string $helperText = '';\n\n "
},
{
"path": "src/Fields/Concerns/HasPlaceholder.php",
"chars": 544,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Fields\\Concerns;\n\ntrait HasPlaceholder\n{\n protected string $placeholder = '';\n\n "
},
{
"path": "src/Fields/Date.php",
"chars": 823,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Fields;\n\nuse Carbon\\Carbon;\nuse Carbon\\Exceptions\\InvalidFormatException;\nuse Larsk"
},
{
"path": "src/Fields/Input.php",
"chars": 676,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Fields;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaField;\nuse Larsklopstra\\Nebula\\Fie"
},
{
"path": "src/Fields/Select.php",
"chars": 646,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Fields;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaField;\nuse Larsklopstra\\Nebula\\Fie"
},
{
"path": "src/Fields/Textarea.php",
"chars": 283,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Fields;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaField;\nuse Larsklopstra\\Nebula\\Fie"
},
{
"path": "src/Http/Concerns/AuthorizesRequests.php",
"chars": 473,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\Concerns;\n\nuse Illuminate\\Support\\Facades\\App;\nuse Illuminate\\Support\\Facades\\"
},
{
"path": "src/Http/Controllers/DashboardController.php",
"chars": 708,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\Controllers;\n\nuse Illuminate\\Contracts\\Container\\BindingResolutionException;\nu"
},
{
"path": "src/Http/Controllers/PageController.php",
"chars": 497,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\Controllers;\n\nuse Illuminate\\Auth\\Access\\AuthorizationException;\nuse Illuminat"
},
{
"path": "src/Http/Controllers/ResourceController.php",
"chars": 4844,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\Controllers;\n\nuse Exception;\nuse Illuminate\\Contracts\\Container\\BindingResolut"
},
{
"path": "src/Http/Controllers/StartController.php",
"chars": 377,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\Controllers;\n\nuse Illuminate\\Contracts\\Container\\BindingResolutionException;\nu"
},
{
"path": "src/Http/Middleware/NebulaEmailAuthStrategy.php",
"chars": 883,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\Middleware;\n\nuse Closure;\nuse Illuminate\\Contracts\\Container\\BindingResolution"
},
{
"path": "src/Http/Middleware/NebulaIPAuthStrategy.php",
"chars": 913,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\Middleware;\n\nuse Closure;\nuse Illuminate\\Contracts\\Container\\BindingResolution"
},
{
"path": "src/Http/RouteResolvers/DashboardResolver.php",
"chars": 1089,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\RouteResolvers;\n\nuse Exception;\nuse Illuminate\\Support\\Facades\\Route;\nuse Illu"
},
{
"path": "src/Http/RouteResolvers/ItemResolver.php",
"chars": 582,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\RouteResolvers;\n\nuse Illuminate\\Support\\Facades\\Route;\n\nclass ItemResolver ext"
},
{
"path": "src/Http/RouteResolvers/PageResolver.php",
"chars": 1019,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\RouteResolvers;\n\nuse Exception;\nuse Illuminate\\Support\\Facades\\Route;\nuse Illu"
},
{
"path": "src/Http/RouteResolvers/Resolver.php",
"chars": 137,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\RouteResolvers;\n\nabstract class Resolver\n{\n abstract public static function"
},
{
"path": "src/Http/RouteResolvers/ResourceResolver.php",
"chars": 1073,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Http\\RouteResolvers;\n\nuse Exception;\nuse Illuminate\\Support\\Facades\\Route;\nuse Illu"
},
{
"path": "src/Metrics/ValueMetric.php",
"chars": 4724,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Metrics;\n\nuse Closure;\nuse Exception;\nuse Larsklopstra\\Nebula\\Contracts\\NebulaMetri"
},
{
"path": "src/Nebula.php",
"chars": 2408,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula;\n\nuse Larsklopstra\\Nebula\\Contracts\\NebulaDashboard;\nuse Larsklopstra\\Nebula\\Contra"
},
{
"path": "src/NebulaServiceProvider.php",
"chars": 2400,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula;\n\nuse Illuminate\\Support\\Facades\\Route;\nuse Illuminate\\Support\\ServiceProvider;\nuse"
},
{
"path": "src/Traits/Toasts.php",
"chars": 393,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Traits;\n\nuse Illuminate\\Contracts\\Container\\BindingResolutionException;\n\ntrait Toas"
},
{
"path": "tailwind.config.js",
"chars": 2257,
"preview": "const { fontFamily } = require('tailwindcss/defaultTheme')\n\nmodule.exports = {\n purge: {\n content: ['./resources/vie"
},
{
"path": "tests/ConsoleCommandTest.php",
"chars": 3243,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Tests;\n\nuse Larsklopstra\\Nebula\\Tests\\TestCase;\nuse Symfony\\Component\\Console\\Excep"
},
{
"path": "tests/RegistrationMethodsTest.php",
"chars": 103,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Tests;\n\nclass RegistrationMethodsTest extends TestCase\n{\n //\n}\n"
},
{
"path": "tests/TestCase.php",
"chars": 291,
"preview": "<?php\n\nnamespace Larsklopstra\\Nebula\\Tests;\n\nuse Larsklopstra\\Nebula\\NebulaServiceProvider;\nuse Orchestra\\Testbench\\Test"
},
{
"path": "webpack.mix.js",
"chars": 260,
"preview": "const mix = require('laravel-mix')\n\nmix\n .postCss('resources/css/app.css', 'public/css', require('tailwindcss'))\n .set"
}
]
About this extraction
This page contains the full source code of the nebulapackage/nebula GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 112 files (125.1 KB), approximately 35.7k tokens, and a symbol index with 188 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.