Skip to content

Move the generic dashboard code into core - #32

Merged
AbdelrhmanSaid merged 12 commits into
masterfrom
move-generic-code-to-core
Oct 27, 2026
Merged

AbdelrhmanSaid merged 12 commits into
masterfrom
move-generic-code-to-core

Conversation

@AbdelrhmanSaid

Copy link
Copy Markdown
Contributor

Moves everything generic from the dashboard starter kit into core so a project keeps only its own code.

What moves into core

  • Components: the generic Blade components (classes and views), registered under their existing names. A project overrides one with a same-named view in resources/components or a class in App\View\Components.
  • Runtime and assets: functions.js, themer.js, runtime.js (the code that was in the dashboard's app.js), the redot-* plugins, redot.css, the initializers, and the third-party libraries. php artisan redot:publish publishes them, with the datatables assets, to public/vendor/redot, replacing datatables:link.
  • Layout components: <x-redot-styles> and <x-redot-scripts> load the runtime.
  • Endpoints: select search, uploader, and HugeRTE upload, plus the is_dashboard_request() and current_sessions() helpers.

Configuration

  • redot.paths sets the route files and the layouts directory and namespace.
  • redot.features.dashboard.guard replaces the hardcoded admins guard.
  • The datatables and toastify config now live in config/redot.php, and every publish tag is redot::.
  • Datatables views and translations use the redot::datatables.* namespace.

Also

  • Fixes the race in the parallel test suite by giving each worker its own public and compiled-views directories.

Status

Work in progress: the companion dashboard PR still needs testing in a browser.

Parallel workers shared the Testbench public directory and the compiled
views directory, so concurrent mkdir calls and tests that build, publish,
or upload into public/ raced each other.
…core

- Register the dashboard's generic Blade components from the package. They
  keep their names, and an application view under resources/components or a
  class under App\View\Components with the same name overrides them.
- Ship functions.js, themer.js, the redot plugins, redot.css, the shared
  runtime, and the third-party libraries, published to public/vendor/redot by
  the new redot:publish command, which also publishes the datatables assets
  and replaces datatables:link.
- Add <x-redot-styles> and <x-redot-scripts> so layouts load the runtime
  without listing every file.
- Build the package initializers into init.js, letting same-named
  application inits override them, and track package files outside the
  application in the dependency lock.
- Extract language tokens from the package views and scripts.
- Move the select search, uploader, and HugeRTE upload controllers into the
  package and register their global routes before the application's, so an
  application route with the same URI and name replaces the package one.
- Add the is_dashboard_request() and current_sessions() helpers.
…igurable

- Add redot.paths for the application route files and the layouts
  directory and namespace.
- Add redot.features.dashboard.guard and use it wherever the sidebar,
  route_guard(), route_allowed(), and permissions:sync assumed "admins".
- Build the dashboard root for is_dashboard_request() from the configured
  prefix instead of requiring a dashboard.index route.
…edot config

Datatables and Toastify now read their settings from the datatables and
toastify keys of config/redot.php, so a project has one Redot config file.
The remaining datatables publish tags move under redot:: as
redot::datatables-views and redot::datatables-lang.
… namespace

Datatable views move to redot::datatables.* and translations to
redot::datatables.*, so they are overridden from
resources/views/vendor/redot/datatables and lang/vendor/redot.
Blade keeps stack pushes in order only within the same view depth. Now
that <x-toasts> renders inside <x-redot-scripts>, a page whose components
push scripts at that depth first put the initializer ahead of the plugin
script pushed by the nested <x-assets.redot-toasts>, so RedotToasts was
undefined. Push both from the toasts view itself.
…oints

Add redot.components with enabled and middleware settings for the select,
uploader, and HugeRTE endpoints. They are throttled by default, and an
application can turn one off or add middleware such as auth to it.
Applications ignore vendor/ in Git, so the extractor's Git ignore filtering
skipped core's views and scripts. Add searchInPackages() for directories
scanned regardless of ignore rules and use it for core's sources.
The uploader, HugeRTE, and icon picker scripts used root-relative paths,
which break when the application runs in a subdirectory. The components
now pass route and asset urls, and the rich editor turns off image uploads
when the HugeRTE endpoint is disabled.
@AbdelrhmanSaid
AbdelrhmanSaid merged commit 860c171 into master Oct 27, 2026
2 checks passed
@AbdelrhmanSaid
AbdelrhmanSaid deleted the move-generic-code-to-core branch October 27, 2026 21:55
@AbdelrhmanSaid AbdelrhmanSaid changed the title WIP: Move the generic dashboard code into core Move the generic dashboard code into core Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant