Skip to content

docs: add getting started laravel example#2143

Merged
caio-pizzol merged 2 commits into
superdoc-dev:mainfrom
roncallyt:docs/laravel-example
Feb 27, 2026
Merged

docs: add getting started laravel example#2143
caio-pizzol merged 2 commits into
superdoc-dev:mainfrom
roncallyt:docs/laravel-example

Conversation

@roncallyt
Copy link
Copy Markdown
Contributor

Description

Adds a Laravel (Livewire + Alpine.js) getting-started example following the same structure as the existing framework examples.

The example includes:

  • Editor with toolbar
  • File upload
  • Edit/View mode switching
  • Export action (browser download)
  • Save to server storage with download link

SuperDoc is imported in resources/js/app.js and exposed on window.SuperDoc for use in Blade templates. Alpine.raw() is used to unwrap Livewire's reactive proxy before calling SuperDoc methods, since its private class fields are not accessible through proxies. The editor container uses wire:ignore to prevent Livewire re-renders from destroying the SuperDoc instance.

- Add Livewire component for uploading and editing .docx files
  client-side using SuperDoc via Alpine.js
- Implement export (browser download) and save (server storage) using
  Livewire file uploads
- Include document mode switching between editing and viewing
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @roncallyt - same feedback as the #2142 applies here, but amplified.

this is a full laravel new scaffold committed to the repo: 12,000+ lines across 60 files (the actual SuperDoc integration is ~140 lines spread across 3 files).

our getting-started examples are minimal and frontend-only. the vue example is 36 lines. this includes a full PHP backend with Livewire file uploads, server-side storage, and a database layer - none of which are needed to show "here's how to render a .docx." (which we can tackle separately on more advanced examples or demos)

a few specific things:

  • the framework scaffold shouldn't be committed. composer.lock alone is probably 10,000 lines. config files for auth, cache, database, mail, queue, sessions - none of this is relevant to SuperDoc. our other examples don't commit framework scaffolding (the nuxt example has 9 files, the vue example has 6)
  • same over-complexity as the nuxt PR. toolbar, comments, contextMenu, mode switching, export, save to server — these are features, not getting-started. strip it to new SuperDoc({ selector, document })
  • same version pinning. "superdoc": "^1.15.0" should be "latest"
  • laravel is a backend framework. SuperDoc is a client-side library. a laravel getting-started example that requires PHP, Composer, a database, and Livewire adds a huge barrier to entry. if we add a laravel example, it should be the thinnest possible blade template with Vite serving SuperDoc - no Livewire, no database, no server-side file storage

honestly, i'd suggest focusing on getting the nuxt PR merged first (it's much closer to ready), then we can discuss whether a laravel example makes ense for the getting-started set, or if it belongs in a different category like examples/advanced/ or a separate guide.

@roncallyt
Copy link
Copy Markdown
Contributor Author

honestly, i'd suggest focusing on getting the nuxt PR merged first (it's much closer to ready), then we can discuss whether a laravel example makes ense for the getting-started set, or if it belongs in a different category like examples/advanced/ or a separate guide.

Yeah, I had this worry about this PR, because it's something completely separated from the product, another language, framework structure, and so on... Maybe focus this PR in a blade template file with assets served by Vite it will make more sense to a getting started example.

I could make this tutorial more complete, perhaps even for a possible post on Medium or something like that.

I just wanted to add something like this because I didn't find anything similar for the Laravel community, and given its large size, it could bring more visibility to the product.

Thank you again for the feedback, as soon as I finish the ajusts on nuxt-example PR, I'll work on it.

Strip the full Laravel scaffold down to the minimum files needed:
- Bootstrap folder
- Laravel entry point (public/index.php)
- Routes file with only one route returning a Blade view
- Blade view + Vite serving SuperDoc.
- `README.md` file with minimal setup instructions
Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scaffold is stripped down, all the round 1 feedback is addressed — no more Livewire, database, auth, or framework config files. the SuperDoc integration is minimal and consistent with the vanilla and vue examples. lgtm.

Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scaffold is stripped down, all the round 1 feedback is addressed — no more Livewire, database, auth, or framework config files. the SuperDoc integration is minimal and consistent with the vanilla and vue examples. lgtm.

@caio-pizzol caio-pizzol merged commit 742b674 into superdoc-dev:main Feb 27, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants