Code Monkey home page Code Monkey logo

filamentphp.com's Introduction

The source code for the Filament website.

Docs

Note

Please submit pull requests for documentation changes to the filament/filament repository. The relevant documentation files can be found in the /docs directory of each package.

Contributing

Submitting plugins can be done by submitting a pull request to this repository. We have opted for this approach to allow for a more open and transparent process, as well as a smoother review process based on GitHub, where you and Filament maintainers can communicate directly.

Setting up an author profile

Before you can contribute plugins to the website, you must set up your author profile. This is then linked to your contributions.

To set up your author profile, create a new file in the content/authors directory. The filename should be your name, with spaces replaced by dashes, and the extension should be .md. For example, if your name is Dan Harrin, the filename should be dan-harrin.md.

---
name: Dan Harrin
slug: dan-harrin
github_url: https://github.com/danharrin
twitter_url: https://twitter.com/danjharrin
mastodon_url: https://phpc.social/@danharrin
sponsor_url: https://github.com/sponsors/danharrin
---

Your bio should be written in Markdown here. In the future, we may introduce an Author page where people can see your contributions, so feel free to write a little about yourself. Please check the grammar and spelling of this description, preferably using [Grammarly](https://www.grammarly.com). It should be in full sentences.

Important

Please upload an avatar to the content/authors/avatars directory. The file must be the same name as your slug. It must be square, at least 1000x1000 pixels in size, and preferably a JPEG.

  • The slug should match the current filename.
  • The github_url should be a link to your GitHub profile.
  • The twitter_url should be a link to your Twitter profile. It is optional.
  • The mastodon_url should be a link to your Mastodon profile. It is optional.
  • The sponsors_url should be a link to your sponsors page like GitHub sponsors. It is optional.

Submitting a plugin

To submit a plugin, create a new file in the content/plugins directory. The filename should be your author name, followed by the name of your plugin, with spaces replaced by dashes, and the extension should be .md. For example, if your author name is "Filament" and the plugin is called "Spatie Media Library", the filename should be filament-spatie-media-library.md.

---
name: Spatie Media Library
slug: filament-spatie-media-library
author_slug: filament
categories: [form-builder, form-field, spatie, table-builder, table-column]
description: Filament support for `spatie/laravel-medialibrary`.
discord_url: https://discord.com/channels/883083792112300104/1080807837833384017
docs_url: https://raw.githubusercontent.com/filamentphp/spatie-laravel-media-library-plugin/3.x/README.md
github_repository: filamentphp/spatie-laravel-media-library-plugin
has_dark_theme: true
has_translations: true
versions: [2, 3]
publish_date: 2023-08-01
---

Important

Please upload an image to the content/plugins/images directory. The file must be the same name as the plugin's slug. It must fit the 16:9 aspect ratio, at least 2560x1440 pixels in size, and preferably a JPEG. If your image is a screenshot of your plugin, please ensure that it is using a light theme and not a dark theme, to ensure it fits in with the rest of the website.**

Note

Do not include the word "Filament" in the name of your plugin. This is redundant, as all plugins on the website are for Filament. Please do not include it in the slug or filename either - unless its part of your author name.

  • The slug should match the current filename.
  • The author_slug should match the slug of the author profile you created earlier.
  • The categories should be an array of categories that your plugin is related to. Available categories can be found in the content/plugin_categories directory.
  • The description should be a short description of your plugin. Please check the grammar and spelling of this description, preferably using Grammarly. It should be one full sentence.
  • The discord_url should be a link to the Discord channel where people can discuss your plugin. If this doesn't exist yet, you can leave this empty until the Filament team creates it in the official server.
  • The docs_url should be a URL to a public, raw Markdown file of your plugin. You can leave this blank if your documentation does not live in a raw Markdown file, but please ensure that you have filled in a url instead, where we can redirect users who are looking for the documentation. If you have content in your README that you do not want to be displayed on the website, please add a .filament-hidden class to the element. This is especially useful for banner images.
  • The github_repository should be the name of the GitHub repository where your plugin is hosted.
  • The has_dark_theme should be true if your plugin supports Tailwind's dark mode, or false if not.
  • The has_translations should be true if your plugin supports multiple languages, or false if not.
  • The versions should be an array of Filament major versions that your plugin supports.
  • The publish_date is the date that you submitted the plugin to the website. It usually should be the date that you submitted the pull request for the plugin.

If your plugin supports multiple versions, you can replace docs_url with an array:

docs_urls:
    v3: https://raw.githubusercontent.com/author/plugin/3.x/README.md
    v2: https://raw.githubusercontent.com/author/plugin/2.x/README.md

The first key/url pair is the one that will be shown by default. The keys should be query string safe values (e.g. avoid spaces).

Quality guidelines

In Filament v2, we introduced the plugins section of the website. We did not enforce many rules on the plugins that were submitted, and as a result, some plugins were not consistent in quality with others. In Filament v3, we are introducing some quality guidelines to ensure that plugins are consistent with each other, and that they are of a high quality. You are more than welcome to create a plugin, distribute it on GitHub and Packagist, and not submit it to the Filament website, if you do not wish to meet these guidelines. However, if you do wish to submit your plugin to the website, please ensure:

  • Your plugin's code is hosted on GitHub.
  • Your plugin must be available to install from Packagist or Anystack.sh.
  • Documentation should always be public, even if the plugin is paid.
  • Documentation should be written clearly, thorough, and well-structured. Users should not be put off from using your plugin because of poor documentation.
  • If your plugin contains any UI element, screenshots of any UI should be available in your documentation.

In return for following these guidelines, your plugin will receive free promotion on our website, and a dedicated support channel on our Discord server.

Selling a plugin

Filament allows you to sell your plugin on our website. To do this, we've partnered with Anystack.sh. To get started, visit the Advertising section of your Anystack product page, and opt-in to advertising on the Filament Website. If you do not follow these instructions, your plugin will not be listed on the website. 15% of sales made through the website will be taken by Filament, to fund the development of the project.

To set up your plugin for sale, you must add an anystack_id field to your plugin's Markdown file. You can find "product ID" this from your Anystack product settings.

Please also make sure that @danharrin is invited to the private GitHub repository where you are hosting the code, with read-only access. This is to allow us to review your plugin's code.

If you'd like to host your documentation on the Filament website instead of your own, please let us know during the review process, and we can help you get that set up.

Forge deployment

By default, Forge's NGINX configuration does not route requests to the docs directory to Laravel. To fix the side effects of this, you can add a catch for 403 above the one for 404 so Laravel handles the request instead:

error_page 403 /index.php;
error_page 404 /index.php;

Debugging missing content

If you are working on the website locally, and you notice that some Markdown-based content is missing, it is likely that it has not reached the cache yet. Please run php artisan clear-orbit-cache and php artisan cache:clear. If images aren't showing up, you probably also need to run php artisan optimize-images.

You need to install image optimization tools before you can run php artisan optimize-images.

filamentphp.com's People

Contributors

199ocero avatar 3x1io avatar alexandersix avatar askerakbar avatar atmonshi avatar awcodes avatar aymanalhattami avatar bezhansalleh avatar cklei-carly avatar codewithdennis avatar danharrin avatar dasundev avatar devraeph avatar filipfonal avatar hassanzahirnia avatar heloufir avatar invaders-xx avatar laravel-shift avatar lukas-frey avatar marjose123 avatar modrictin avatar mokhosh avatar noxoua avatar pboivin avatar pxlrbt avatar ralphjsmit avatar rupadana avatar saade avatar shanerbaner82 avatar zepfietje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

filamentphp.com's Issues

Auto-Update plugin documentation

It would be great if the plugin documentation auto-update based on the documentation url provided.

I updated several times my plugin documentation with new features, but the documentation on filamentphp.com stay the same (the first version).

Applying filters does not reset page number

Applying filters should reset the page back to page 1.

Take this example:

No filters are applied and there are 10 pages of plugins.
User goes to page 5 then clicks Developer tools.

The users screen says no plugins found and it isn't clear on screen that they just need to go back to page one.

sry

never mind

Add Query string support

It'd be great if filtering by search, version, free/paid, categories, etc. could set query string parameters so it'd be easy to reload the page and keep your place.

Images Not Displaying

Hello guys great job, it seems the images in the websites aren't loaded even on the readme
I am new to open source and would love to help out with this if you could let me know how to help
thanks and great job (new filament user)

Installing locally without `spatie/laravel-comments`?

I'm trying to install your website on my local machine, to submit some pull requests.
But I don't have a licence for Spaties Laravel Comments package.

When Composer is installing, I get the following prompt and it just hangs there:

- Downloading spatie/laravel-comments (1.1.3)
- Downloading spatie/laravel-comments-livewire (1.2.5)
Authentication required (satis.spatie.be)
Username:
Password:

How can I install this repo locally?

Pagination at Plugins page shows wrong page numbers on mobile screen size

When going through the pages with plugins (https://filamentphp.com/plugins), with the filters as shown in the screenshot below, the pagination shows wrong page numbers when you go from page 2 (second last) to page 3 (last).

I've checked it with the following browsers:

On mobile Android phone:

  • Brave version 1.56.20, Chromium 15.0.5790.171
  • Chrome version 115.0.5790.166

Desktop (only happens on the smaller breakpoints):

  • Chrome version 115.0.5790.170 (Official Build) (x86_64)
  • Brave version 1.56.20 Chromium: 115.0.5790.171 (Official Build) (x86_64)

filamentphp com plugins pagination bug

How to validate domain logic and catch model errors?

I'm trying to validate beyond field rules.

More like domain logic.

Let's say "this action isn't allowed because your subscription isn't active and some other reasons"

I've seen this file:
vendor/filament/filament/src/Resources/Pages/EditRecord.php +78

    public function save(bool $shouldRedirect = true): void
    {
        $this->authorizeAccess();

        $this->callHook('beforeValidate');

        $data = $this->form->getState();

        $this->callHook('afterValidate');

        $data = $this->mutateFormDataBeforeSave($data);

        $this->callHook('beforeSave');

        $this->handleRecordUpdate($this->getRecord(), $data);

        $this->callHook('afterSave');

        $shouldRedirect = $shouldRedirect && ($redirectUrl = $this->getRedirectUrl());

        if (filled($this->getSavedNotificationMessage())) {
            Notification::make()
                ->title($this->getSavedNotificationMessage())
                ->success()
                ->send();
        }

        if ($shouldRedirect) {
            $this->redirect($redirectUrl);
        }
    }

calls this one:
vendor/filament/forms/src/Concerns/InteractsWithForms.php +153

    public function validate($rules = null, $messages = [], $attributes = [])
    {
        try {
            return parent::validate($rules, $messages, $attributes);
        } catch (ValidationException $exception) {
            $this->onValidationError($exception);

            $this->dispatchBrowserEvent('expand-concealing-component');

            throw $exception;
        }
    }

this works:

class EditMyModel extends EditRecord
{
...
    public function save(bool $shouldRedirect = true): void
    {
        $record = $this->form->getState();

        // validate more things
        if (!check_something($record['contrato_id'])) {
                Notification::make()->title('Error: this is invalid because reasons')->danger()->send();
                return;
        }
        parent::save($shouldRedirect);
    }
}

but I'm not sure if there's a built-in way of doing this.

Also: what if save() fails? there's no try/catch clause

Simple One to Many Tenancy

I believe the docs here are incorrect:
https://filamentphp.com/docs/3.x/panels/tenancy#simple-one-to-many-tenancy

auth()->check() is not available in the booted function, but is available in the scope.

This code example should be:

use Illuminate\Database\Eloquent\Builder;
 
class Post extends Model
{
    protected static function booted(): void
    {
            static::addGlobalScope('team', function (Builder $query) {
                if (auth()->check()) {
                        $query->where('team_id', auth()->user()->team_id);
                        // or with a `team` relationship defined:
                        $query->whereBelongsTo(auth()->user()->team);
                }
            });
    }
}

can we have first-party plugins in side bar

I have a suggestion about the document page. it's good to have first-party plugins in the sidebar under the products documentation link.

we have them listed on main github repo readme but have it in documentation site gonna help alot

Feature: Remember Filament Version

Sometimes I go to the docs via google and I land on the wrong filament version. And because I'm dumb sometimes I don't realise it that I'm actually reading an old version of the docs.
I think it would be fantastic if the docs would remember the last version I selected via cookie.
Or are there downsides tho that I am not seeing?

Documentation suggestion

Maybe this info would be helpful in the "Plugin development" section of the documentation

Setup Filament in local repository

If you want to contribute to Filament you might want to to test it in a real Laravel project.

  • Fork the filament repository
  • Create your own branch, example patch-2.x
  • Create a Laravel app
  • Clone the filament repository into the root of your Laravel app
  • Checkout your patch-2.x branch
|-Laravel app
   |-app/
   |-filament/

In composer.json

"repositories": [
    {
        "type": "path",
        "url": "filament/packages/*",
        "options": {
            "symlink": true
        }
    }
],
"require": {
    "filament/filament": "patch-2.x as 2.x-dev",
    "filament/forms": "patch-2.x as 2.x-dev",
    "filament/tables": "patch-2.x as 2.x-dev",
}
composer update

What happened to Tricks?

It seems like tricks have moved to community along with other articles. But apart from that, why are there so few trick articles now? It was good stuff, hahaha. The filter for versions 1, 2 and 3 are not working either. Is the website update still in progress?

version in title tag

Would be nice to have the Filament version in the title of the docs. First link is to 2.x docs and last is to 3.x, but there's no way to tell without hovering/clicking

Screenshot 2024-01-06 at 21 41 52

Star count does not reflect github star count

Description:
Currently, the star count displayed in the Plugin Store does not take into account the stars obtained by plugins from their corresponding GitHub repositories. As a result, the star count in the Plugin Store does not show the total amount of stars.

Example:

Translation manager plugin:
Screenshot 2023-09-05 at 09 26 27
Screenshot 2023-09-05 at 09 26 37

Database Schedule:
Screenshot 2023-09-05 at 09 28 28
Screenshot 2023-09-05 at 09 28 35

Plugins I've come across with this issue:
https://filamentphp.com/plugins/saade-laravel-log
https://filamentphp.com/plugins/kenepa-translation-manager
https://filamentphp.com/plugins/solution-forest-tree
https://filamentphp.com/plugins/husam-database-schedule

Sidebar Subnav Links are Broken

For instance on this page, if you click the Table widgets link under the "Dashboard" section the link is:

https://filamentphp.com/docs/2.x/admin/dashboard#table-widgets

When clicking this link, you are not taken to the sub-heading for Table Widgets. This is because the anchor name for that section does not match and is:

https://filamentphp.com/docs/2.x/admin/dashboard#content-table-widgets

I'm not sure how you would prefer to fix this. Either the links need to be changed to prepend "content-" before the section name OR the "content-" that is included in the anchor name needs to be removed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.