PHPackages                             visiarch/laravel-service - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. visiarch/laravel-service

ActiveLibrary[CLI &amp; Console](/categories/cli)

visiarch/laravel-service
========================

A simple Laravel package to create service, using artisan commands

1.0.0(2y ago)0171MITPHP

Since Jun 28Pushed 2y agoCompare

[ Source](https://github.com/visiarch/laravel-service)[ Packagist](https://packagist.org/packages/visiarch/laravel-service)[ Docs](https://github.com/visiarch/laravel-service)[ RSS](/packages/visiarch-laravel-service/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (1)

[![laravel Service](https://github.com/visiarch/laravel-service/raw/main/images/laravel-service-banner.png)](https://github.com/visiarch/laravel-service/blob/main/images/laravel-service-banner.png)

laravel-service
===============

[](#laravel-service)

[![Latest Stable Version](https://camo.githubusercontent.com/78e93a989df51015d59e7439b93706679647d86082215323754e04b186bd299a/687474703a2f2f706f7365722e707567782e6f72672f76697369617263682f6c61726176656c2d736572766963652f76)](https://packagist.org/packages/visiarch/laravel-service)[![License](https://camo.githubusercontent.com/e039c298ac6556beef76931adf14c50a0ac361b7bbb39ce3ae61f1c2f35abd42/687474703a2f2f706f7365722e707567782e6f72672f76697369617263682f6c61726176656c2d736572766963652f6c6963656e7365)](https://packagist.org/packages/visiarch/laravel-service)

[!["Buy Me A Coffee"](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/bagussuandana)

> A Simple Package to create services, using artisan commands in laravel.

This package extends the `make:` commands to help you easily create service classes in Laravel 9+.

What is Service ?
=================

[](#what-is-service-)

A service is a component that is responsible for executing an application's business logic. This is a place to place logic that may be too complex or inappropriate to place in the controller.

Install
=======

[](#install)

```
composer require visiarch/laravel-service
```

Once it is installed, you can use any of the commands in your terminal.

Usage
=====

[](#usage)

Services are used to separate business logic from the controller, making the controller leaner and focused on handling HTTP requests and providing appropriate responses.

#### With interface

[](#with-interface)

```
php artisan make:service {name} --i
```

#### Without interface

[](#without-interface)

```
php artisan make:service {name}
```

Examples
========

[](#examples)

Create a service class with interface
-------------------------------------

[](#create-a-service-class-with-interface)

```
php artisan make:service PostService --i
```

`app/Services/Interfaces/PostServiceInterface.php`

```
