It seems like you're trying to adjust the height of a Trend metric in Laravel Nova. The fixedHeight method should indeed set the height of the metric card. However, if it's not working as expected, there might be a few reasons why this is happening.
First, ensure that you are using the latest version of Laravel Nova, as earlier versions might not support this feature or might have bugs related to it.
If you are on the latest version and it's still not working, you can try to clear your browser cache or use a hard refresh (Ctrl+F5 on Windows or Cmd+Shift+R on Mac) to ensure that the latest CSS is being applied.
If the issue persists, you can apply custom CSS to override the default styles. You can add custom CSS to your Nova tool by publishing Nova's assets and editing the app.css file located in the resources/views/vendor/nova directory.
Here's how you can publish Nova's assets:
php artisan nova:publish
After running this command, you can add your custom CSS to the app.css file:
/* resources/views/vendor/nova/app.css */
.card.metric {
height: 500px !important;
}
Make sure to clear your cache and refresh the page after making these changes.
If you want to apply the custom height to only a specific metric card, you can add a custom class to your metric component and then target that class in your CSS:
In your metric component:
public function jsonSerialize()
{
return array_merge(parent::jsonSerialize(), [
'class' => 'custom-metric-height',
]);
}
And then in your app.css:
/* resources/views/vendor/nova/app.css */
.card.metric.custom-metric-height {
height: 500px !important;
}
Remember that using !important is generally not recommended unless necessary, as it can make future CSS maintenance harder. Use it judiciously.
If none of these solutions work, it might be worth checking the Laravel Nova issues on GitHub or asking for further assistance on the Laracasts forum, as there might be a more specific issue at play with your Nova installation.