filamentphp / filamentphp.com Goto Github PK
View Code? Open in Web Editor NEWSource code for the filamentphp.com website.
Home Page: https://filamentphp.com
Source code for the filamentphp.com website.
Home Page: https://filamentphp.com
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
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).
Hey there,
There is an style issue in bottom section.
Beta Filamentphp Docs.
Just go to bottom section of the page.
https://beta.filamentphp.com/docs/3.x/widgets/charts/
Thanks a lot, for new features & updates.
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:
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
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);
}
});
}
}
https://filamentphp.com/tricks/turbolinks-admin
This link is from version 2. Which is now inaccessible. How do I access it? Specifically v2 panel.
All tricks link are down. I don't want migrate my app to version 3 yet. Anyhow can I access v2 tricks links.
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?
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.
On https://beta.filamentphp.com/docs/3.x/tables/grouping there's broken HTML in all the screenshots. Not sure if this is also an issue with the table builder itself or how the docs are built?
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:
Desktop (only happens on the smaller breakpoints):
When I click the discord link on the homepage it reports as expired.
Duplicated pagination numbers on (only on mobile screens):
https://filamentphp.com.test/plugins
https://filamentphp.com.test/community
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?
The discord links for plugins have empty hrefs so they just reload the page.
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)
Github markdowns have special highlight blocks:
https://github.com/orgs/community/discussions/16925
They're not rendered properly as you can compare here:
https://filamentphp.com/plugins/mokhosh-kanban#before-you-start
with the same block on github itself:
https://github.com/mokhosh/filament-kanban#before-you-start
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
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.
Hi,
Dark mode doesn't work.
When i clicked in button,the dark mode doesn't change.
https://filamentphp.com/plugins
Thanks, a lot for new features.
When installing and running migrations for this site, I got the following error: SQLSTATE[HY000]: General error: 1 duplicate column name: author_name (SQL: alter table "plugins" add column "author_name" varchar)
On the original Links migration, author_name
is not added.
But on the original plugins migration, it is:
It is then added again to the Plugins table in a later migration, causing the error.
Maybe this info would be helpful in the "Plugin development" section of the documentation
If you want to contribute to Filament you might want to to test it in a real Laravel project.
patch-2.x
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
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.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.