{"id":21504445,"url":"https://github.com/dcasia/nova-dashboard","last_synced_at":"2025-04-09T21:19:17.084Z","repository":{"id":41609570,"uuid":"277135815","full_name":"dcasia/nova-dashboard","owner":"dcasia","description":"The missing dashboard for Laravel Nova!","archived":false,"fork":false,"pushed_at":"2024-03-28T03:45:55.000Z","size":10287,"stargazers_count":73,"open_issues_count":7,"forks_count":12,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-09T21:19:11.933Z","etag":null,"topics":["laravel","nova","nova-dashboard"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcasia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"milewski","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2020-07-04T15:25:34.000Z","updated_at":"2024-12-22T21:17:53.000Z","dependencies_parsed_at":"2023-02-05T22:01:13.953Z","dependency_job_id":"41cf0bc5-aded-4725-97de-7cbe51a6227a","html_url":"https://github.com/dcasia/nova-dashboard","commit_stats":{"total_commits":89,"total_committers":6,"mean_commits":"14.833333333333334","dds":0.5168539325842696,"last_synced_commit":"811a6a7637f21e5673b7807d07ebf927813c4652"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasia%2Fnova-dashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasia%2Fnova-dashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasia%2Fnova-dashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasia%2Fnova-dashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcasia","download_url":"https://codeload.github.com/dcasia/nova-dashboard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111973,"owners_count":21049578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","nova","nova-dashboard"],"created_at":"2024-11-23T19:00:19.419Z","updated_at":"2025-04-09T21:19:17.061Z","avatar_url":"https://github.com/dcasia.png","language":"Vue","funding_links":["https://github.com/sponsors/milewski"],"categories":[],"sub_categories":[],"readme":"# Nova Dashboard\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/digital-creative/nova-dashboard)](https://packagist.org/packages/digital-creative/nova-dashboard)\n[![Total Downloads](https://img.shields.io/packagist/dt/digital-creative/nova-dashboard)](https://packagist.org/packages/digital-creative/nova-dashboard)\n[![License](https://img.shields.io/packagist/l/digital-creative/nova-dashboard)](https://github.com/dcasia/nova-dashboard/blob/main/LICENSE)\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/dcasia/nova-dashboard/main/screenshots/dark.png\"\u003e\n  \u003cimg alt=\"Laravel Nova Dashboard In Action\" src=\"https://raw.githubusercontent.com/dcasia/nova-dashboard/main/screenshots/light.png\"\u003e\n\u003c/picture\u003e\n\nThe missing dashboard for Laravel Nova!\n\n# Installation\n\nYou can install the package via composer:\n\n```\ncomposer require digital-creative/nova-dashboard\n```\n\n## List of current available widgets:\n\n- Value Widget: [https://github.com/dcasia/value-widget](https://github.com/dcasia/value-widget)\n- Table Widget: [https://github.com/dcasia/table-widget](https://github.com/dcasia/table-widget)\n- ChartJs Widget: [https://github.com/dcasia/chartjs-widget](https://github.com/dcasia/chartjs-widget)\n- [Add your widget here.](https://github.com/dcasia/nova-dashboard/edit/main/README.md)\n\n## Usage\n\nThe dashboard itself is simply a standard Laravel Nova card, so you can use it either as a card on any resource \nor within the default Nova dashboard functionality.\n\n```php\nuse DigitalCreative\\NovaDashboard\\Card\\NovaDashboard;\nuse DigitalCreative\\NovaDashboard\\Card\\View;\nuse Laravel\\Nova\\Dashboards\\Main as Dashboard;\n\nclass Main extends Dashboard\n{\n    public function cards(): array\n    {\n        return [\n            NovaDashboard::make()\n                -\u003eaddView('Website Performance', function (View $view) {\n                    return $view\n                        -\u003eicon('window')\n                        -\u003eaddWidgets([\n                            BounceRate::make(),\n                            ConversionRate::make(),\n                            WebsiteTraffic::make(),\n                            SessionDuration::make(),\n                        ])\n                        -\u003eaddFilters([\n                            LocationFilter::make(),\n                            UserTypeFilter::make(),\n                            DateRangeFilter::make(),\n                        ]);\n                }),\n        ];\n    }\n}\n```\n\n#### Static \n\nBy default, each widget is draggable, and the user is able to rearrange it to their liking. \nThis behavior can be disabled by calling `$view-\u003estatic()`.\n\n## Widgets\n\nThe widgets are responsible for displaying your data on your views; they are essentially standard Nova cards.\nHowever, they respond to dashboard events and reload their data whenever the filters change.\n\nOnce you have a widget, they are usually configured like this:\n\n```php\nclass MyCustomWidget extends ValueWidget\n{\n    /**\n     * Here you can configure your widget by calling whatever options are available for each widget\n     */\n    public function configure(NovaRequest $request): void\n    {\n        $this-\u003eicon('\u003csvg\u003e...\u003c/svg\u003e');\n        $this-\u003etitle('Session Duration');\n        $this-\u003etextColor('#f95738');\n        $this-\u003ebackgroundColor('#f957384f');\n    }\n\n    /**\n     * This function is responsible for returning the actual data that will be shown on the widget,\n     * each widget expects its own format, so please refer to the widget documentation \n     */\n    public function value(Filters $filters): mixed\n    {\n        /**\n         * $filters contain all the set values from the filters that were shown on the frontend. \n         * You can retrieve them and implement any custom logic you may have.\n         */\n        $filterValue = $filters-\u003egetFilterValue(LikesFilter::class);\n        \n        return 'example';\n    }\n}\n```\n\nAll widgets have common methods to configure their size and position.\nThe value is not in pixels but in grid units, ranging from `1` to `12` (corresponding to 12 columns).\n\n```php\n$widget-\u003elayout(width: 2, height: 1, x: 0, y: 1);\n$widget-\u003eminWidth(2);\n$widget-\u003eminHeight(1);\n```\n\n## Filters\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/dcasia/nova-dashboard/main/screenshots/filter-dark.png\"\u003e\n  \u003cimg alt=\"Filters Preview\" src=\"https://raw.githubusercontent.com/dcasia/nova-dashboard/main/screenshots/filter-light.png\"\u003e\n\u003c/picture\u003e\n\nThese are standard nova filter classes with 1 simple difference, the method `-\u003eapply()` does not get called by default. Why?\n\n```php\nuse Illuminate\\Http\\Request;\nuse Laravel\\Nova\\Filters\\BooleanFilter;\n\nclass ExampleFilter extends BooleanFilter\n{\n    public function apply(Request $request, $query, $value)\n    {\n        // this function is required however it is not used by the nova-dashboard\n    }\n}\n```\n\nUsually your widget `-\u003evalue()` function will receive an instance of `DigitalCreative\\NovaDashboard\\Filters` this class \ncontains a method for retrieving the value of any given filter, for example:\n\n```php\nclass SessionDuration extends ValueWidget\n{\n    public function value(Filters $filters): mixed\n    {\n        $filterA = $filters-\u003egetFilterValue(YourFilterClass::class);\n        $filterB = $filters-\u003egetFilterValue(YourSecondFilterClass::class);\n    }\n}\n```\n\nHowever, if you want to reuse the logic that you have previously set on your filters or share existing filters with\nthe dashboard you can call the method `-\u003eapplyToQueryBuilder()` to get the same behavior:\n\n```php\nclass SessionDuration extends ValueWidget\n{\n    public function value(Filters $filters): mixed\n    {\n        $result = $filters-\u003eapplyToQueryBuilder(User::query())-\u003eget();    \n    }\n}\n```\n\n`-\u003eapplyToQueryBuilder()` will run every filter through the default filter logic of nova.\n\n## ⭐️ Show Your Support\n\nPlease give a ⭐️ if this project helped you!\n\n### Other Packages You Might Like\n\n- [Nova Dashboard](https://github.com/dcasia/nova-dashboard) - The missing dashboard for Laravel Nova!\n- [Nova Welcome Card](https://github.com/dcasia/nova-welcome-card) - A configurable version of the `Help card` that comes with Nova.\n- [Icon Action Toolbar](https://github.com/dcasia/icon-action-toolbar) - Replaces the default boring action menu with an inline row of icon-based actions.\n- [Expandable Table Row](https://github.com/dcasia/expandable-table-row) - Provides an easy way to append extra data to each row of your resource tables.\n- [Collapsible Resource Manager](https://github.com/dcasia/collapsible-resource-manager) - Provides an easy way to order and group your resources on the sidebar.\n- [Resource Navigation Tab](https://github.com/dcasia/resource-navigation-tab) - Organize your resource fields into tabs.\n- [Resource Navigation Link](https://github.com/dcasia/resource-navigation-link) - Create links to internal or external resources.\n- [Nova Mega Filter](https://github.com/dcasia/nova-mega-filter) - Display all your filters in a card instead of a tiny dropdown!\n- [Nova Pill Filter](https://github.com/dcasia/nova-pill-filter) - A Laravel Nova filter that renders into clickable pills.\n- [Nova Slider Filter](https://github.com/dcasia/nova-slider-filter) - A Laravel Nova filter for picking range between a min/max value.\n- [Nova Range Input Filter](https://github.com/dcasia/nova-range-input-filter) - A Laravel Nova range input filter.\n- [Nova FilePond](https://github.com/dcasia/nova-filepond) - A Nova field for uploading File, Image and Video using Filepond.\n- [Custom Relationship Field](https://github.com/dcasia/custom-relationship-field) - Emulate HasMany relationship without having a real relationship set between resources.\n- [Column Toggler](https://github.com/dcasia/column-toggler) - A Laravel Nova package that allows you to hide/show columns in the index view.\n- [Batch Edit Toolbar](https://github.com/dcasia/batch-edit-toolbar) - Allows you to update a single column of a resource all at once directly from the index page.\n\n## License\n\nThe MIT License (MIT). Please see [License File](https://raw.githubusercontent.com/dcasia/nova-dashboard/main/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcasia%2Fnova-dashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcasia%2Fnova-dashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcasia%2Fnova-dashboard/lists"}