CarbonNanotubes
CarbonNanotubes
Explore posts from servers
FFilament
Created by CarbonNanotubes on 10/3/2024 in #β“β”Šhelp
Displaying Custom Model attributes in a table
Before I upgraded to V3 I was able to access my custom attribute by like so
TagColumn::make('triggers.definedName)
TagColumn::make('triggers.definedName)
but since upgrading this seems to no longer work.
TextColumn::make('triggers.definedName')
->badge(),
TextColumn::make('triggers.definedName')
->badge(),
Here is my attribute
public function definedName(): Attribute
{
return Attribute::make(
get: function (mixed $value, array $attribute) {
if ($attribute['machine_status_id'] != null) {
return $attribute['line_status->name'];
}

if ($attribute['machine_state_id'] != null) {
return $attribute['machine_state->name'];
}

return $attribute['name'];
}
);
}
public function definedName(): Attribute
{
return Attribute::make(
get: function (mixed $value, array $attribute) {
if ($attribute['machine_status_id'] != null) {
return $attribute['line_status->name'];
}

if ($attribute['machine_state_id'] != null) {
return $attribute['machine_state->name'];
}

return $attribute['name'];
}
);
}
I can access it in Tinker
$t = Trigger::first()
[!] Aliasing 'Trigger' to 'App\Models\Trigger' for this Tinker session.
= App\Models\Trigger {#7658
id: "1",
criteria: "max",
value: "5",
unit_of_measure: "parts",
created_at: "2023-01-24 17:32:09.333",
updated_at: "2023-12-11 16:33:13.657",
machine_status_id: null,
task_id: null,
machine_state_id: null,
name: "First Occurrence",
}

> $t->definedName;
= "First Occurrence"
$t = Trigger::first()
[!] Aliasing 'Trigger' to 'App\Models\Trigger' for this Tinker session.
= App\Models\Trigger {#7658
id: "1",
criteria: "max",
value: "5",
unit_of_measure: "parts",
created_at: "2023-01-24 17:32:09.333",
updated_at: "2023-12-11 16:33:13.657",
machine_status_id: null,
task_id: null,
machine_state_id: null,
name: "First Occurrence",
}

> $t->definedName;
= "First Occurrence"
4 replies
FFilament
Created by CarbonNanotubes on 10/2/2024 in #β“β”Šhelp
filament:install Error 255
I am attempting to upgrade from docker filament v2 to v3. The following plugins installed: awcodes/overlook bezhansalleh/filament-shield kenepa/resource-lock z3d0x/filament-logger dutchcodingcompany/filament-socialite I had to remove all the plugins when upgrading to livewire v3 as they were causing dependency conflicts. Once I upgraded livewire, I ran the filamentv3 upgrade script provided in the docs and all looked well. I upgraded filament in composer.json and added all my plugins, and ran composer update. Once that was completed I attempted to run php artisan filament:install I get "Error: 255", see the console output below
artisan filament:install
Creating imm-server_artisan_run ... done
⇂ public/js/filament/forms/components/color-picker.js
⇂ public/js/filament/forms/components/date-time-picker.js
⇂ public/js/filament/forms/components/file-upload.js
⇂ public/js/filament/forms/components/key-value.js
⇂ public/js/filament/forms/components/markdown-editor.js
⇂ public/js/filament/forms/components/rich-editor.js
⇂ public/js/filament/forms/components/select.js
⇂ public/js/filament/forms/components/tags-input.js
⇂ public/js/filament/forms/components/textarea.js
⇂ public/js/filament/tables/components/table.js
⇂ public/js/filament/widgets/components/chart.js
⇂ public/js/filament/widgets/components/stats-overview/stat/chart.js
⇂ public/js/filament/filament/app.js
⇂ public/js/filament/filament/echo.js
⇂ public/js/filament/notifications/notifications.js
⇂ public/js/filament/support/async-alpine.js
⇂ public/js/filament/support/support.js
⇂ public/css/filament/forms/forms.css
⇂ public/css/filament/support/support.css
⇂ public/css/filament/filament/app.css

INFO Successfully published assets!

INFO Configuration cache cleared successfully.

INFO Route cache cleared successfully.

ERROR: 255
artisan filament:install
Creating imm-server_artisan_run ... done
⇂ public/js/filament/forms/components/color-picker.js
⇂ public/js/filament/forms/components/date-time-picker.js
⇂ public/js/filament/forms/components/file-upload.js
⇂ public/js/filament/forms/components/key-value.js
⇂ public/js/filament/forms/components/markdown-editor.js
⇂ public/js/filament/forms/components/rich-editor.js
⇂ public/js/filament/forms/components/select.js
⇂ public/js/filament/forms/components/tags-input.js
⇂ public/js/filament/forms/components/textarea.js
⇂ public/js/filament/tables/components/table.js
⇂ public/js/filament/widgets/components/chart.js
⇂ public/js/filament/widgets/components/stats-overview/stat/chart.js
⇂ public/js/filament/filament/app.js
⇂ public/js/filament/filament/echo.js
⇂ public/js/filament/notifications/notifications.js
⇂ public/js/filament/support/async-alpine.js
⇂ public/js/filament/support/support.js
⇂ public/css/filament/forms/forms.css
⇂ public/css/filament/support/support.css
⇂ public/css/filament/filament/app.css

INFO Successfully published assets!

INFO Configuration cache cleared successfully.

INFO Route cache cleared successfully.

ERROR: 255
I get the same error when running php artisan view:clear
23 replies
PD🧩 Plasmo Developers
Created by CarbonNanotubes on 3/14/2024 in #πŸ”°newbie
Typescript Confusion
No description
1 replies
FFilament
Created by CarbonNanotubes on 5/8/2023 in #β“β”Šhelp
Filter by multiple Relationship attributes
On a select is it possible to filter by multiple attributes?
6 replies
FFilament
Created by CarbonNanotubes on 3/8/2023 in #β“β”Šhelp
Change Delete Icon of Repeater
5 replies
FFilament
Created by CarbonNanotubes on 3/7/2023 in #β“β”Šhelp
CSS and JS blocked in new project
19 replies
FFilament
Created by CarbonNanotubes on 3/6/2023 in #β“β”Šhelp
Dashboard Navigation not working
12 replies