Soundmit
Add Printjs to infolist action
Hi, in my app i have an infolist with a button 'print'
this action all a route that generate and show a pdf in the browser (same tab)
now i want to add printerjs in order to print it directly
i've added print js with npm
import in app.js
compiled with npm run build
and inspecting the code, the library seems to be loaded right
now
16 replies
Custom widget, passing variables to blade
I'm trying to make a custom widget (all other widgets works)
class
blade
$record in template works but i want to prepare the variable in my class and then send it to the tpl
but i tried several options, like mount, getData... no one works.
4 replies
getHEaderWidgetColumns not works in resource view
In my resource view, i have a stats widget wit 5 boxes divided in 2 rows 3 and 2
i want 5 block in a row, so i added getHeaderWidgetsColumns() to my widget but it doens't works
i want 5 columns only for this widget not for the otherd
``
<?php
namespace App\Filament\Resources\RepairResource\Widgets;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
class RepairOverview extends BaseWidget
{
public function getHeaderWidgetsColumns(): int | array
{
return 5;
}
protected function getStats(): array
{
$quote = 165;
$paid = 175;
$costs = 120;
$profit = $quote - $costs;
$finalProfit = $paid - $costs;
return [
Stat::make('Preventivo', $quote) ,
Stat::make('Incasso', $paid),
Stat::make('Costi', $costs),
Stat::make('Utile previsto', $profit),
Stat::make('Utile effettivo', $finalProfit)
->description('7% decrease'),
];
}
}
```
3 replies
Kernel.php in V3 t oregister middleware
I'm trying to use https://github.com/mcamara/laravel-localization
in filamentphp. At some point, i need t oregeister the middleware in the Kernel.php file but there is no Kernel.php file in v3
i need this middleware outside of the panel, in my frontend.
Do i need to override the Kernel.php cby creating a new file in App\Http or there is another way to register middleware?
https://github.com/mcamara/laravel-localization#register-middleware
You may register the package middleware in the app/Http/Kernel.php file:
<?php namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel {
/
* The application's route middleware.
*
* @var array
*/
protected $middlewareAliases = [
/** OTHER MIDDLEWARE **/
'localize' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRoutes::class,
'localizationRedirect' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRedirectFilter::class,
'localeSessionRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect::class,
'localeCookieRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleCookieRedirect::class,
'localeViewPath' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationViewPath::class
];
}
3 replies
Please help with frontend translation
I've decided to quit my 17 years job as developer because i can't find a way to translate a laravel frontend 🙂
Joke aside,
I'm able (80%) to set the language in the session with a language switcher
but i can't redirect to the translated page...
i use spatie/translatable and i have a page with
en slug: test-en
it slug: test-it
When in the english page i try to translate in italian
but the slug doesn't change
the language switcher
the link produced
https://test.ddev.site/language/en/test-en
https://test.ddev.site/language/it/test-en
i think that the links need to be
https://test.ddev.site/test-en
https://test.ddev.site/test-it
5 replies
Concatenate 2 fields in infoList
Need to formatStateUsing of a textEntry in my infolist by concatenate his value + the value of another field
but i get this error
Non-static method App\Enums\PaymentStatus::getLabel() cannot be called statically
2 replies
Best Practices for Websites with FilamentPHP
Now that I understand how to use FilamentPHP for creating apps and backends, I need to create the frontend. I would use Filament as if it were a CMS. The typical website has static content pages, a blog or news section, plus some custom content. Developing this part shouldn't be a problem.
As for the frontend, I would use the TALL stack, and this shouldn't be an issue either.
However, I'm wondering how to implement the following:
Content visible to everyone and restricted content (should I create a panel for users?)
Menus: how do you manage menus that have links to pages which can be created by users?
I've never done frontend with Laravel, but it seems that working with routes and views is sufficient.
Can you give me some advice?
12 replies
translate notifications
i send notification to user with this code
app language is italian
user language is english, his ui is all translated in english but notification are sent in italian...
if admin UI is set to english, notification are sent in english
any suggestion?
thanks
11 replies
Route and livewire pages display error
In my app i have a page with a livewire component
without a route, i simply call the page /customer/my-repairs
but now i need to add the route in my web.php route file
ListMyRepairs is the livewire component
at the end of the file i call the view
list-my-repairs.blade.php
but i get this error
15 replies
Argument: Web Routes
I'm in the final step of my app, then i would make a proper demo test for you!
I need to tweak the web routes, more in depth
I have 2 panels
- Admin (for admin and technicians)
- Customer (for client)
When i create a customer (and related local user) i send an invitation email with a link to a 'choose your password' form
The same when i create the Technician.
The difference are that customer goes to Customer Panel
and Technician to the Admin Panel
Here i have the first problem, sometimes the customer goes to the admin panel, with error...
Problems is in the route
Which is the best practice for this use case?
2 replies
Foreach error with repeater field
Hi, i have strange behaviour with a repeater field (never encountered before)
i have a simple repeater
when i create a new item, it works
when i try to edit an exhisting item, populated with a seeder
i have the error 'foreach() argument must be of type array|object, string given'
the field is a longtext field, with cast as array (but if i change cast to json is the same)
in the database, it saved like this (new from form)
while the seeder save like this
6 replies
Brainstorming about CMS
Hi!
after several months of Filament, my app is almost done
the next chapter will be: made a CMS or use third part CMS?
I have a lot of experience with WinterCMS (laravel cms)
but i'm feel confident that it's better to build a CMS my self.
The purpouse is making n basic websites
with: news, static pages, blog posts, galleries, user roles etc.. on top of this, customization if needed.
what do you suggests?
12 replies
Trix v2 update bug
after the 3.2.77 update, i'm facing the same problem of some weeks ago
https://discord.com/channels/883083792112300104/1218180234512302101/1218192873644753050
I think is the exact problem
15 replies