Carlos Lopes
Carlos Lopes
FFilament
Created by Carlos Lopes on 2/28/2024 in #❓┊help
Set first and last day of month in DatePicker
tks @Saade work fine!
6 replies
FFilament
Created by Carlos Lopes on 2/28/2024 in #❓┊help
Set first and last day of month in DatePicker
tks @Saade but not work , datepicker not receive value $this->form->fill([ 'dataInicio' => '2024-02-01' 'dataFim' => '2024-02-29' ]);
6 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
contratoItem or Proposta generates the error
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
[ "numeroContrato" => "10004154-0" "ativo" => true "dataCriacao" => "2023-11-23T17:50:31.000+00:00" "dataAtualizacao" => null "id" => "1b8759b8" "contratoItem" => ['id' => '10154'] "usuarioCriacao" => "10914" "usuarioAtualizacao" => null "propostas" => ['id' => '25', 'name' => 'Marcos Viega','proposta_id' => '25987457'] "contratoAtualizacaoCci" => null ]
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
and this result
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Sushi\Sushi; use Illuminate\Support\Arr; use App\Facades\ApiConciliadorFacades; class ContratoApi extends Model { use HasFactory; use Sushi; // protected $casts = [ // 'contratoItem' => 'json', // 'propostas' => 'json', // ]; // protected $schema = [ // 'contratoItem' => 'json', // 'propostas' => 'json', // ]; public function getRows() {
//API $dados = ApiConciliadorFacades::ApiData()->get('/contrato')->json(); $dados = Arr::map($dados['data'], function ($item) { return Arr::only($item, [ 'id', 'numeroContrato', 'ativo', 'dataCriacao', 'dataAtualizacao', 'contratoItem',
'usuarioCriacao', 'usuarioAtualizacao', 'propostas',
'contratoAtualizacaoCci', ]); });
return $dados; }
}
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
this would be the model
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
Sorry, I'm new and I'm not using github, can I give you the model and data array here?
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
Well, I had read these 2 articles before too and used your article as a basis but without success. It wasn't a problem with Sushi, it seems that he can't read the propostaarrays
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
contratoItem and propostas this causing array to string error
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
debugging the model returns this object but cannot pass it to the filament table
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
[▼ "numeroContrato" => "10004154-0" "ativo" => true "dataCriacao" => "2023-11-23T17:50:31.000+00:00" "dataAtualizacao" => null "id" => "1b8759b8" "contratoItem" => array:2 [▶] "usuarioCriacao" => "10914" "usuarioAtualizacao" => null "propostas" => array:103 [▶] "contratoAtualizacaoCci" => null ]
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Filament Api
@Leandro FerreiraHi Leandro, due to an error that I cannot resolve in Suchi a simple array, as in the documentation, everything is fine, but when I have an array within arrays it returns an error Array to string conversion,Do you have any idea what it could be? I appreciate your help
16 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Laravel filament v3 sushi
@Matthew same error, if I remove these two fields it can read the data but there is data within these arrays that I also need to recover
6 replies
FFilament
Created by Carlos Lopes on 11/27/2023 in #❓┊help
Laravel filament v3 sushi
Hi Dennis, my model is configured this way <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Sushi\Sushi; use Illuminate\Support\Arr; use App\Facades\ApiConciliadorFacades; class ContratoApi extends Model { use HasFactory; use Sushi; public function getRows() {
//API $dados = ApiConciliadorFacades::ApiData()->get('/contrato')->json(); //filtering some attributes $dados = Arr::map($dados['data'], function ($item) {
return Arr::only($item, [ 'id', 'numeroContrato', 'ativo', 'dataCriacao', 'dataAtualizacao', 'contratoItem', 'usuarioCriacao', 'usuarioAtualizacao', 'propostas', 'contratoAtualizacaoCci', ] ); });
return $dados; } } and its result is this array:10 [▼ // app\Models\ContratoApi.php:45 "numeroContrato" => "10004154-0" "ativo" => true "dataCriacao" => "2023-11-23T17:50:31.000+00:00" "dataAtualizacao" => null "id" => "1b8759b8" "contratoItem" => array:1 [▶] "usuarioCriacao" => "10914" "usuarioAtualizacao" => null "propostas" => array:103 [▶] "contratoAtualizacaoCci" => null ] in my resource table have return this Array to string conversion
6 replies