/filament

A lightweight admin package to jumpstart your Laravel app.

Primary LanguagePHPMIT LicenseMIT

Filament User Listing Screenshot

Filament

A lightweight admin for your Laravel app.

This package is in very active development – I would love help to make it awesome!

Notes

Keep it Minimal

The theme of this admin is "Light and Fast" – just enough to get you started and creating your next project – keeping setup to a minimum with hardly any changes to the default Laravel app. Let's use as little Javascript as possible by adhereing to using Livewire as much as possible (using Alpine JS when absolutely needed and use Spruce for some simple state management between front-end components when absolutely necessary).

Roadmap

This is more of a proposed feature list then a solid roadmap. I am totally open to new ideas, with the overall goal of keeping this core package pretty minimal allowing total customization via your main Laravel app / additional add-on packages.

  • Setup tests (via Testbench Component) and start creating them for existing features.
    • I'm going to be very honest here, I don't know much about testing within a package, so this will be completely new to me and I would really appreciate some help on getting things setup for best practices etc.
  • [✓] Update the User model to implement laravel-metable, allowing the addition of custom meta fields in a pretty flexible way beyond the core required schema.
  • Create new Globals feature for managing arbitrary app data.
  • Create new Resources feature. Allowing a user to create a generic resource with schemaless attributes managed by custom fields.
    • Implement laravel-metable in this feature as well, as it would allow the addition of custom meta fields in a pretty flexible way beyond the core required schema.
  • Create a GraphQL API using Lighthouse and corresponding admin section (likely using GraphiQL) for previewing the API. This one is pretty opinionated and needs to be in the core (our team at East Slope Studio uses it extensively for our decoupled front-end web and app development projects (built with Eleventy, React, React Native etc.).

Installation

This package can be used with Laravel 7.x or higher.

The following instructions assume a new installation of Laravel with database and mail setup.

composer require filament/filament dev-master
php artisan migrate
php artisan vendor:publish --tag=filament-seeds
composer dump-autoload
php artisan db:seed --class=FilamentSeeder

Filament User

Before you can use Filament, you must add the necessary Filament\Traits\FilamentUser trait to your App\User model.

Example:

<?php

namespace App;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Filament\Traits\FilamentUser;

class User extends Authenticatable
{
    use Notifiable;
    use FilamentUser;

    // ...
}

Create a user

php artisan filament:user

Create a fieldset

This feature will eventually allow you to create a fieldset (either core schema fields, or schemaless meta-fields) in your own app for Users, Globals and Resources. More documentation to come as these features are added to the core package.

php artisan filament:fieldset {name} {--package}

Screenshots