dyo
Error in searchable TextColumn
I have attributes of name and phone using TextColumn searchable method.
the user sometimes accidentally paste the text in search input with emoticon in it, and these error appeared..
Error: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,COERCIBLE) for operation 'like' (Connection: mysql, SQL: select * from
prospek
where phone
LIKE %asyaaAllahAlhamdul% or name
LIKE %Maa syaa Allah Alhamdulillah.. 🤲🤲% limit 10)
how can I return the search result to null, or remove the emoticon if it exist in the string again?3 replies
Problem in running render test at ManageRelatedRecords class
This is my test code
And I got error when I run the test:
I already make sure that the global variable above is correct.
$this->user is a model record user.
$this->sample_data is a model record of campaign.
What probably did I missed?
4 replies
Optimize duplicate queries in 2 method at the same TextColumn Class
Can someone help me to optimize with this case,
TextColumn::make('jenisDonasi.nama_jenis')
->tooltip(function ($record) {
if ($record->campaign) {
return 'Campaign: ' . $record->campaign->judul;
}
})
->description(function ($record) {
if ($record->campaign) {
return 'Lihat campaign';
}
})
The $record->campaign is a belongsTo relationship query, which is duplicate.
How can I execute only one $record->campaign to both method above in TextColumn?
10 replies
Problems in duplicate query detected at debugbar
Here's a table action I'm using, with some conditions to be visible
Action::make('verifikasi')
->icon('heroicon-o-magnifying-glass')
->visible(function ($record) {
if (
$record->trans_ref != null
&& in_array($record->status_konf, ['Baru', 'Pending', 'Cek Lagi'])
) {
return Setoran::unconfirm()
->where('rekening_id', $record->rekening_id)
->whereDate('tanggal', '>=', date('Y-m-d', strtotime($record->tanggal)))
->where('dana', $record->dana)
->exists();
}
})
The problem is, why the query of model Setoran above is detected duplicate or executed twice in debugbar queries tab?
The conditions above is only met in one record at the table.
I hope someone can explain me what's wrong.
2 replies
Problem in modal form
Action::make('import')
->form([
FileUpload::make('upload'),
])
->action(function (array $data) {
Excel::import(new DistribusiFirstSheet, $data['upload']);
}),
I want to create a modal form with FileUpload in it, but when i submit the uploaded form i got error:
Illuminate \ Contracts \ Filesystem \ FileNotFoundException
What did I miss?
9 replies
Set dependant value of Datepicker in form() Filter
In table filter class, how can I set other Filter form based on other value?
In my example, if konfirmasi_hari_ini is checked, then the value of filter ['tanggal']['from'] and ['tanggal']['until'] is set to now()
3 replies