PHPnews.io

How and When to Extract Component Logic

Written by Laracasts / Original link on Jun. 23, 2020

Alpine does not require you to store all logic as HTML attribute values. When necessary, you can easily reference a global function that returns an object. Here, you can declare your component's data and behavior separately from the HTML. In this episode, we'll use a basic task app example to discuss how (and when) to extract component logic. We'll also review some important considerations when bundling your code. View the source code for this episode on GitHub.

laracasts

« Abstract resources in Laravel Nova - Why Class&nbspConstants Should be Typed »