docs: add getting started laravel example#2143
Conversation
- 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
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
caio-pizzol
left a comment
There was a problem hiding this comment.
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.
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
caio-pizzol
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
Description
Adds a Laravel (Livewire + Alpine.js) getting-started example following the same structure as the existing framework examples.
The example includes:
SuperDoc is imported in
resources/js/app.jsand exposed onwindow.SuperDocfor 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 useswire:ignoreto prevent Livewire re-renders from destroying the SuperDoc instance.