---
title: 'Service vs Action Classes in Laravel: What''s the Difference?'
source: 'https://youtube.com/watch?v=n9Kaj88k62Q'
video_id: 'n9Kaj88k62Q'
date: 2026-08-14
duration_sec: 58
---

# Service vs Action Classes in Laravel: What's the Difference?

> Source: [Service vs Action Classes in Laravel: What's the Difference?](https://youtube.com/watch?v=n9Kaj88k62Q)

## Summary

The video explains the difference between service and action classes in Laravel. It provides examples of how each is used in controllers and queued jobs, and emphasizes that both are flexible PHP classes.

### Key Points

- **Service Class Definition** [00:00] — A service class groups methods around a specific Eloquent model or topic, with all public methods callable individually.
- **Service Usage in Queued Jobs** [00:15] — Services can be used in queued jobs by creating a new object and calling methods like getBrowser(), getOS(), getDevice().
- **Service Usage in Controllers** [00:30] — In controllers, services are instantiated to call a single method, like getting the operating system.
- **Action Class Definition** [00:30] — Action classes typically have one method like handle() or invoke(), but can have more methods.
- **Action Usage in Controllers** [00:46] — Action classes are used in controllers by creating a new object and calling the handle() method with parameters.
- **Flexibility and Conclusion** [00:46] — Both service and action classes are just PHP classes, so you can structure them however you want.

## Transcript

Service and action classes in Laravel. Typically service is a group of methods around the same eloquent model, but not necessarily, it could be one topic like user agent. And as you can see, all methods here are public, which means they can be called individually, or at the end there is a
method to call multiple methods with one public method. And how that service is used, for example, in a queued job we create a new class object and then get browser, get OS, get device. Another example in controller, we also create a new object of that service, but in this case just to get the
operating system. And here's an example of action class from another project. Typically action class has one method like handle or invoke, but no one is restricting you from creating more methods inside of the same action class like this. And this is how it is used in the controller, we create
a new object of action, and then we just call one method handle with parameters. So I hope you see the difference between service and actions, but at the end of the day they are both PHP classes, and you can structure them however you want.
