ProstoCode

@prostocode
2 Followers
3 Following
23 Posts
Web development tips and tricks
Websitehttps://prostocode.com/
How to reload model data from database in Laravel

In Laravel, you can use either refresh() or fresh() to reload model data from the database, but they behave differently.

ProstoCode
How to disable CSRF middleware for specific route in Laravel

The method to disable CSRF protection might be different depending on your Laravel version, so we are going to explore different ways to do it.

ProstoCode
How to use Pinia with Storybook

Using Pinia in Storybook allows you to test components with a shared state. Since Storybook runs outside your main Vue app, you need to manually set up a Pinia instance for each story.

ProstoCode
Switch background color when changing theme in Storybook

Changing the background color when switching themes in Storybook can be done easily with withThemeByClassName. This method applies theme-related classes directly to the body tag.

ProstoCode
Vue.js: How to Force a Component to Rerender

In Vue.js, components automatically update when reactive data changes. But if you need to force a full rerender, the best way is to use a key binding.

ProstoCode
How to Enable API Routes in Laravel 11+

In Laravel 11, the default routes/api.php file is removed, so API routes won't work out of the box. But it's easy to make it work again.

ProstoCode
How to add classes to body and html in Nuxt

You can add any attributes to body and html tags in nuxt.config.ts file.

ProstoCode
How to init a Nuxt app in current folder with npx

You should use the--force flag to create a new Nuxt app in existing folder.

ProstoCode
Get the largest number from an array with JavaScript

You can use the Math.max() static method to find the maximum value in an array of numbers

ProstoCode
How to remove model by attribute from Eloquent collection

Here's a snippet to remove a model by a specific attribute from an Eloquent collection in Laravel:

ProstoCode