kisut
kisut
FFilament
Created by kisut on 10/12/2024 in #❓┊help
Visual Builder Email Template Error
Hi, I'm using Email Template editor plugin from Visual Builder https://github.com/visualbuilder/email-templates and using postgre database, the plugin is working nicely on local server. And then I got this error on production server:
"SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: boolean = integer LINE 1: ...om "vb_email_templates_themes" where "is_default" = 1 and "v... ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts. (Connection: pgsql, SQL: select * from "vb_email_templates_themes" where "is_default" = 1 and "vb_email_templates_themes"."deleted_at" is null limit 1)"
"SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: boolean = integer LINE 1: ...om "vb_email_templates_themes" where "is_default" = 1 and "v... ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts. (Connection: pgsql, SQL: select * from "vb_email_templates_themes" where "is_default" = 1 and "vb_email_templates_themes"."deleted_at" is null limit 1)"
Maybe someone using this plugin too and can help me to solve this? The column on the database is already mapped with boolean type and filled in with True or False condition.
5 replies
FFilament
Created by kisut on 10/1/2024 in #❓┊help
Column Order Number Error
Hi, I'm trying to use column_order for my relation manager. This is my code: Track Model
public function releases()
{
return $this->belongsToMany(Release::class, 'track_album', 'track_id', 'release_id')
->withPivot('track_order')
->orderBy('track_order');
}
public function releases()
{
return $this->belongsToMany(Release::class, 'track_album', 'track_id', 'release_id')
->withPivot('track_order')
->orderBy('track_order');
}
Release Model
public function tracks()
{
return $this->belongsToMany(Track::class, 'track_album', 'release_id', 'track_id')
->withPivot('track_order')
->orderBy('track_album.track_order');
}

public function addTrack(Track $track)
{
$maxOrder = $this->tracks()->max('track_order') ?? 0;
$this->tracks()->attach($track->id, ['track_order' => $maxOrder + 1]);
}
public function tracks()
{
return $this->belongsToMany(Track::class, 'track_album', 'release_id', 'track_id')
->withPivot('track_order')
->orderBy('track_album.track_order');
}

public function addTrack(Track $track)
{
$maxOrder = $this->tracks()->max('track_order') ?? 0;
$this->tracks()->attach($track->id, ['track_order' => $maxOrder + 1]);
}
Relation manager
->reorderable(fn () => str($this->getPageClass())->contains('TrackList') ? 'track_order' : null)
->defaultSort('track_order')
->reorderRecordsTriggerAction(
fn (ActionsAction $action, bool $isReordering) => $action
->button()
->label($isReordering ? 'Cancel Reordering' : 'Reorder Tracks')
)
->reorderable(fn () => str($this->getPageClass())->contains('TrackList') ? 'track_order' : null)
->defaultSort('track_order')
->reorderRecordsTriggerAction(
fn (ActionsAction $action, bool $isReordering) => $action
->button()
->label($isReordering ? 'Cancel Reordering' : 'Reorder Tracks')
)
Why when I create/attach data, the column_order (in my case track_order) is not auto created? I need to reorder it first so the order number is showed and save into database. Is this a bug or what? because I didn't get this error before
6 replies
FFilament
Created by kisut on 9/23/2024 in #❓┊help
Override Reset Password Laravel Basic Template
Hi, I'm using this plugin by visualbuilder https://github.com/visualbuilder/email-templates I want to override the basic laravel reset password email template by template that i created on that plugin. I've follow all the step but the basic email always coming. User Model:
class User extends Authenticatable
{
use HasFactory, Notifiable, HasRoles;


/**
* @param $token
*
* @return void
*/
public function sendPasswordResetNotification($token)
{
$url = \Illuminate\Support\Facades\URL::secure(route('password.reset', ['token' => $token, 'email' =>$this->email]));

$this->notify(new UserResetPasswordRequestNotification($url));
}
class User extends Authenticatable
{
use HasFactory, Notifiable, HasRoles;


/**
* @param $token
*
* @return void
*/
public function sendPasswordResetNotification($token)
{
$url = \Illuminate\Support\Facades\URL::secure(route('password.reset', ['token' => $token, 'email' =>$this->email]));

$this->notify(new UserResetPasswordRequestNotification($url));
}
Also when I save the template, the preview does not come from the email content that I have created? but rather like the template provided by the plugin. I'm little bit confused about this. Thank you
3 replies
FFilament
Created by kisut on 9/21/2024 in #❓┊help
Select Field empty on Edit Page
No description
2 replies
FFilament
Created by kisut on 8/28/2024 in #❓┊help
Disable Reorder Table on View
Hi, I use relation manager and enable reoder, everything works normally. But I want reoder only active on edit page, how to implement it?  I used visible/hidden but both are inactive (view and edit page).  Thanks
5 replies
FFilament
Created by kisut on 8/23/2024 in #❓┊help
Unable to check existence S3 Storage R2 Cloudflare
Hi, I'm using R2 Cloudflare, the file successfully uploaded to bucket, but it's getting error
Unable to check existence for: release/cover-art/file-name.jpg
Unable to check existence for: release/cover-art/file-name.jpg
My resource
Forms\Components\FileUpload::make('cover_art')
->disk('s3')
->directory('release/cover-art')
->storeFileNamesIn('original_image_name')
Forms\Components\FileUpload::make('cover_art')
->disk('s3')
->directory('release/cover-art')
->storeFileNamesIn('original_image_name')
Filesystem
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'directory_env' => env('AWS_DIRECTORY'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
'bucket_endpoint' => true,
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'directory_env' => env('AWS_DIRECTORY'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
'bucket_endpoint' => true,
'visibility' => 'public',
],
Any thoughts about this?
30 replies
FFilament
Created by kisut on 8/19/2024 in #❓┊help
Relation Manager section didn't show up
Hi, I created a belongsToMany relation between two models with this setting. Track Model
public function releases()
{
return $this->belongsToMany(Release::class);
}
public function releases()
{
return $this->belongsToMany(Release::class);
}
Release Model
public function trackAlbum()
{
return $this->belongsToMany(Track::class, 'album_track', 'release_id', 'track_id');
}
public function trackAlbum()
{
return $this->belongsToMany(Track::class, 'album_track', 'release_id', 'track_id');
}
and I created a relation manager with commands like this
php artisan make:filament-relation-manager ReleaseResource trackAlbum track_title
php artisan make:filament-relation-manager ReleaseResource trackAlbum track_title
I have registered the relation in Release resource but the section relation under the form is not showing up. Is there a mistake?
11 replies
FFilament
Created by kisut on 8/17/2024 in #❓┊help
Select with Relationship always Null
No description
19 replies
FFilament
Created by kisut on 6/28/2024 in #❓┊help
Not saving all the input
I created a form, but why aren't all inputs saved? My model
protected $fillable = [
'user_id',
'track_title',
'track_primary_artist',
'track_featuring_artist',
'genre_track',
'preview_track',
'isrc_track',
'language_track',
'explicit_track',
'writer_track',
];
protected $fillable = [
'user_id',
'track_title',
'track_primary_artist',
'track_featuring_artist',
'genre_track',
'preview_track',
'isrc_track',
'language_track',
'explicit_track',
'writer_track',
];
Error message
SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "track_primary_artist" of relation "tracks" violates not-null constraint DETAIL: Failing row contains (16, 1, null, Surga & Neraka, null, null, Hip-Hop/Rap, 11:24, null, ID, null, ["Hildan Ramdani"], 2024-06-28 03:43:38, 2024-06-28 03:43:38). (Connection: pgsql, SQL: insert into "tracks" ("track_title", "genre_track", "preview_track", "isrc_track", "language_track", "writer_track", "user_id", "updated_at", "created_at") values (Surga & Neraka, Hip-Hop/Rap, 11:24, ?, ID, ["Hildan Ramdani"], 1, 2024-06-28 03:43:38, 2024-06-28 03:43:38) returning "id")
SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "track_primary_artist" of relation "tracks" violates not-null constraint DETAIL: Failing row contains (16, 1, null, Surga & Neraka, null, null, Hip-Hop/Rap, 11:24, null, ID, null, ["Hildan Ramdani"], 2024-06-28 03:43:38, 2024-06-28 03:43:38). (Connection: pgsql, SQL: insert into "tracks" ("track_title", "genre_track", "preview_track", "isrc_track", "language_track", "writer_track", "user_id", "updated_at", "created_at") values (Surga & Neraka, Hip-Hop/Rap, 11:24, ?, ID, ["Hildan Ramdani"], 1, 2024-06-28 03:43:38, 2024-06-28 03:43:38) returning "id")
Is there anyone who can help me?
2 replies
FFilament
Created by kisut on 6/5/2024 in #❓┊help
Array to String Conversion Problem
No description
15 replies
FFilament
Created by kisut on 5/15/2024 in #❓┊help
Cloudinary FileUpload Integration
I'm new in Filament, either in Laravel. I want to integrate FileUpload component with Cloudinary. I want user can upload image on the component, and its gonna store on database. I'm using this package of Cloudinary Laravel: https://github.com/cloudinary-community/cloudinary-laravel My form schema is
FileUpload::make('cover_art')
->disk('cloudinary')
FileUpload::make('cover_art')
->disk('cloudinary')
and have this function on model
public function store(Request $request)
{
$uploadedFile = $request->file('cover_art');

if ($uploadedFile) {
$result = $uploadedFile->storeOnCloudinary();

$url = $result->getSecurePath();
return response()->json([
'url' => $url,
'size' => $result->getSize(),
'fileType' => $result->getFileType(),
'fileName' => $result->getFileName(),
'originalFileName' => $result->getOriginalFileName(),
'publicId' => $result->getPublicId(),
'extension' => $result->getExtension(),
'width' => $result->getWidth(),
'height' => $result->getHeight(),
'timeUploaded' => $result->getTimeUploaded(),
]);
}

return response()->json(['error' => 'No file uploaded'], 400);
}
public function store(Request $request)
{
$uploadedFile = $request->file('cover_art');

if ($uploadedFile) {
$result = $uploadedFile->storeOnCloudinary();

$url = $result->getSecurePath();
return response()->json([
'url' => $url,
'size' => $result->getSize(),
'fileType' => $result->getFileType(),
'fileName' => $result->getFileName(),
'originalFileName' => $result->getOriginalFileName(),
'publicId' => $result->getPublicId(),
'extension' => $result->getExtension(),
'width' => $result->getWidth(),
'height' => $result->getHeight(),
'timeUploaded' => $result->getTimeUploaded(),
]);
}

return response()->json(['error' => 'No file uploaded'], 400);
}
and when I run it, it's got
The GET method is not supported for route livewire/upload-file. Supported methods: POST.
The GET method is not supported for route livewire/upload-file. Supported methods: POST.
on console, and
PHP Fatal error: Trait "League\Flysystem\Adapter\Polyfill\NotSupportingVisibilityTrait" not found in C:\Users\rizky\soundmera\vendor\cloudinary-labs\cloudinary-laravel\src\CloudinaryAdapter.php on line 16
PHP Fatal error: Trait "League\Flysystem\Adapter\Polyfill\NotSupportingVisibilityTrait" not found in C:\Users\rizky\soundmera\vendor\cloudinary-labs\cloudinary-laravel\src\CloudinaryAdapter.php on line 16
on terminal Is there any mistake? I'm very confused. Or maybe anyone have some article/video about this? Thanks
11 replies