Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add Filament as a feature to be installed to Laravel through Spin #108

jaydrogers started this conversation in Ideas
Discussion options

👉 Describe the problem

  • Many users want to get started with Filament, but there are a lot of steps that could be automated with the power of Spin

👥 Problem evidence & reach

This has been a discussion with @ijpatricio and @alexandersix

🥰 Describe the "impact" on users?

Automating these steps will simplify the adoption of Filament, making it easier to ship self-hosted apps with Spin.

🏆 How to solve this problem

Screenshot 2024-09-19 at 08 43 58@2x

Add Filament as a feature

  • Add it to the Features page
  • Users can select it as well as many other features

Create a Filament menu feature

If Filament is selected as a feature on the first menu, display another menu that allows them to select Filament features. We will allow them to select:

Automated install

Depending on what the user selects above, Spin will create a new project (and even initialize in an existing project), then perform the installation.

💯 How do we validate the problem is solved?

  • Users can create new projects with Filament already installed
  • Users can run spin init and add Filament to their project with Spin

🗣️ Further Discussion

  1. What challenges does a user face for running spin init laravel then choosing Filament? Will it cause conflicts?
  2. Are there challenges where Node and PHP need to be in the same container?

@ijpatricio and @alexandersix: If you can take a look at what I have above and let me know your thoughts. To be honest, I haven't had the chance to use Filament yet -- but I am excited to get this process going 😃👍

Feel free to comment below and we can update this first post with additional notes.

You must be logged in to vote

Replies: 5 comments · 9 replies

Comment options

Hey @jaydrogers,

I wouldn't say there are a lot of steps in installing Filament alone, but overall, from nothing to App, yes of cour!!
Sidenote: we should do a call/livestream, playing with Spin + Filament, because, I haven't had time to start with Spin, and you have to try Filament! 2 in 1 :D :D

The typical install

Panels include all packages. They are separate, because if you have a Laravel app, and want Forms you can cherry pick just that, without panels. Same goes for others.

Filament is a foundation, a set of tools, for App Development. People tend to see it as a Admin Panel, but it's so much more.

Typically, you run these 2 commands, and you're good to go:

composer require filament/filament:"^3.2" -W
php artisan filament:install --panels

Either you seed a database user, or you can create it right away:

php artisan make:filament-user

Filament (and other apps) with presets

I have to propose and can collaborate on:
Templates/Presets, that would include requiring composer packages, installing npm packages, changing some files, running artisan commands, etc and checks for asserting the template did a good job!

This could be a yaml/json file, and could be in the source, or made on a website. Look at this example, from https://start.spring.io
image

This could generate a file, or a command script. Say: I click save and copy a string spin init --template=uuid-generated-for-my-template which I can paste into terminal and GO!

This uuid would feed from that app, and would return said json, and spin would feed from that.

This could go on for hours, but not sure if you want to follow this path, so let me know!

This would also apply to infrastructure things like: redis? queue? horizon? cron? etc

Further discussion

  1. Can't foresee any issue. As above, run 2 commands, provided the default stuff and db are ready, and you're good to go.
  2. Nope, not out of the box. Even when we make. custom theme, it's a regular npm run dev as usual.
  3. It could be awesome to have a setup for PDF generation, using Puppeteer or Playwright. I have experience with this, so let me know if you want to tinker!!
You must be logged in to vote
0 replies
Comment options

This looks great, @jaydrogers! Really excited to get Filament and Spin working together!

Just had a few thoughts to share:

Compatibility

As long as the Laravel app supports Filament's requirements (below), there should be no issue whatsoever with installing Filament when running spin new

  • PHP 8.1+
  • Laravel 10.0+
  • Livewire 3.0+

When installing Filament, if Livewire isn't already installed, Composer will pull Livewire 3 in as a dependency, so there shouldn't be anything to worry about there.

Needing Node in the PHP container

We shouldn't need to add Node into the PHP container. Anything we need Node for (compiling front-end assets on individual plugins and custom themes) should be able to just use the existing Node container that Spin created by default.

Filament Panel vs. individual plugins

As you noted in your original post, Filament is actually an ecosystem of TALL stack packages that can be used individually or combined together. The one outlier here is the Panel builder package. Panel builder is actually an opinionated combination of all of our other Filament packages.

I bring this up because, in the install script, if someone chooses the "panel" option, we'll likely want to prevent them from selecting the rest or auto-select them since they will be installed anyways.

Beyond that, though, all of the remaining packages can be installed in whatever combination people want!

Using Filament with spin init

I've been thinking about this a bit and talking with Dan (Filament creator), and I'm not actually sure if adding Filament to an existing app with spin init is an absolutely necessary feature. It seems like spin init is mostly for creating Docker infrastructure that works with an existing Laravel app, but Filament will run entirely in the existing PHP container that is already being used by the Laravel app. I'm open for push-back here, but it seems like it would be more simple to composer require Filament into an app and save ourselves the time of writing that logic into Spin. I think the only area where this breaks down is that we also need to include PHP extensions that aren't present in the default Spin install, so maybe we do need to implement this in spin init. Alternatively, I'm open to adding some level of documentation in Filament calling out how to add those extensions to Spin's docker files, but it's still a manual step for people to take.

If you decide that you do want to support Filament in spin init (even if just for consistency's sake between spin new and spin init), there is one thing to note. The Panel builder can be dropped into an existing application with no issues. However, the individual packages have one extra piece of configuration that could make adding them to existing applications more difficult.

When installing any of the individual packages, we also present users with the ability to scaffold their Laravel application. When scaffolding, we automatically set up the TALL stack along with installing our components. This is a destructive operation that automatically goes in and changes files in the application (app.blade.php, for example), so we only recommend doing this for new applications.

We can install individual packages without scaffolding, but then if the user has not previously set up the TALL stack, our components are going to be pretty much useless.

All that said, it's only something we need to think about if we decide to allow people to add Filament to the application with spin init. We may be able to punt that decision down the road a bit too if we want to add Filament in just on spin new.

The intl extension

Something else to think about as well–it might be worthwhile for spin init to look at the composer.json file and, if Filament has been added to the Laravel app, automatically add the intl extension to the Docker containers 🤷🏻‍♂️


Happy to help with whatever you need on the Filament side! Would love to see this come to life and get people using Filament with Docker!

You must be logged in to vote
0 replies
Comment options

Hey @jaydrogers

Speaking of it....

https://x.com/shadcn/status/1836870732070146468

image

You must be logged in to vote
0 replies
Comment options

jaydrogers
Oct 1, 2024
Maintainer Author

Just an update

I haven't forgotten about this. This is in my inbox and I plan on switching to this once I have serversideup/php v3.4 out the door 😃

There are lots of improvements in that release that will benefit the experience with Filament. Looking forward to getting to this soon!

You must be logged in to vote
5 replies
@alexandersix
Comment options

No worries at all–thanks for the update!

I had to evacuate because of the hurricane (we're all fine), so this hasn't really been front-of-mind for the past week or so, so no rush here 😅

@jaydrogers
Comment options

jaydrogers Oct 1, 2024
Maintainer Author

Oh gosh!! So sorry to hear you were affected by the hurricane. Wishing you, your friends, and family safety and well-being! That's scary stuff. Hope things get back to normal for you soon.

@ijpatricio
Comment options

OMG. So sorry to hear, I hope all keep well and go back to normal life ASAP!! ❤️

@jaydrogers
Comment options

jaydrogers Oct 15, 2024
Maintainer Author

Still haven't forgotten about this. I am about to release v2.3.0 which will come with a ton of stability improvements. Hoping to swing back to Filament soon.

Hope life is back to normal after the hurricane @alexandersix!

@alexandersix
Comment options

Thanks @jaydrogers! Everything is more or less back to normal for us, thankfully!

Congrats on 2.3.0! Bet that's nice to finally have across the line!

Comment options

Happy 2025 all! I finally have some bandwidth for more open source stuff and I wanted to check in on this:

  1. Is the community still interested in a Spin + Filament integration?
  2. Is the Filament team interested in incorporating Spin into their workflow/docs?

I'd love to put this together as an open source contribution (meaning people can use it in Spin Laravel Basic and Spin Laravel Pro).

Making sure I build this right

I haven't used Filament myself yet (excited to try it out), but I've learned in my previous experience of writing Spin services that I shouldn't try to do "too much" and try to automate everything. Sometimes its best for the user to run a command from the docs than try to automatically assume they want it.

Next steps

Is there any perspective I should be aware of before attempting to build this? Or would it be best to jump on a Discord call sometime and go through this? I'd love to hear your thoughts 🙏

You must be logged in to vote
4 replies
@alexandersix
Comment options

I mean, I'm very interested in this. We'd definitely need to talk through how/what we'd want to include as far as Filament goes (aside from the PHP extensions and whatnot that are necessary), but I think it would be a great way to add another option to build Laravel apps with from the template.

As far as incorporating Spin into the docs goes, I don't know that we'd put it directly into the documentation (there may be a spot for it as far as a starting template goes), but we can definitely create some resources for it and calling Spin (and Spin Pro, if necessary) out on our website's blog. All that's up in the air, though, depending on how we'd handle the potential integration.

@jaydrogers
Comment options

jaydrogers Jan 14, 2025
Maintainer Author

NICE! Glad to see there is still excitement here (thanks for your patience while I was heads down on everything else).

Adding the intl extension won't be hard at all.

Here's a 2 minute video explaining more: https://www.dropbox.com/scl/fi/v30wumii6f5n7kmsk4psi/Filament.mp4?rlkey=gnse1jlanv9xrtq3bpp01hjeu&dl=0

Let me know if you'd like to jump on Discord sometime to chat more. I'd probably have more time available tomorrow or later this week if you're free (no pressure 😃)

@tomschlick
Comment options

You could probably write this in a package agnostic way, that reads the composer.json of the package and installs the required PHP/system extensions.

I'm not sure how much you'd want to integrate directly with specific packages though as that seems like a moving target to always keep up with.

@jaydrogers
Comment options

jaydrogers Jan 14, 2025
Maintainer Author

Yup! That's basically how I do things with Reverb, etc. Everything is through a composer command.

I just run them again based on their selections to ensure it's installed.

When they run a spin new, I would start with a blank Laravel install, then execute the composer commands for them to get them up and running quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.