โ˜… Refactoring to actions

1 ยท Freek Van der Herten ยท June 10, 2019, 9:12 a.m.
In our recent projects at Spatie, we've started using a concept called "actions". It keeps our controllers and models skinny. It's a straightforward practice. In this blog post, I'd like to explain it to you. From logic in controllers and models... # Consider you have a Laravel powered blog where you want to publish posts. When a post is published, the app should tweet out the title and link to it. The controller that does that might look like this: class PostsController { public function c...