New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

imjonos/laravel-base-service

Laravel base service
1,002

Larablocks Analysis

imjonos/laravel-base-service works with Laravel 5 to 13 (latest release 1.1.5, Apr 9, 2026).

Promising: maintained and up to date, meets 2 of 4 checks; not yet widely used.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Apr 9, 2026)
  • 33 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Maintained
  • Last stable release: Apr 9, 2026.
  • 3 releases in the last 12 months.
  • First released: Nov 24, 2022.
  • Monthly downloads: 33.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.

Install
composer require imjonos/laravel-base-service
Latest Version:1.1.5
Laravel:5 – 13
License:MIT
Last Updated:Apr 9, 2026
Links: GitHub  ·  Packagist
Maintainer: Eugeny Nosenko

📦 Laravel Base Service

Latest Version on Packagist
Total Downloads

A generic base service class for Laravel projects that provides a consistent and reusable way to handle business logic and data access. It integrates with laravel-base-repository and simplifies working with Eloquent models by encapsulating common operations like create, read, update, delete (CRUD), pagination, and more. The package also includes debugging capabilities through the DebugInterface and Debuggable trait, allowing for enhanced troubleshooting during development.


🧩 Overview

This package provides an abstract BaseService class that wraps around a repository and offers a clean interface for handling business logic in a structured and testable way. It is designed to be used in conjunction with the laravel-base-repository package, but it can also work with any custom repository implementing the required interface.


🛠 Installation

Install the package via Composer:

composer require imjonos/laravel-base-service

✅ This package depends on imjonos/laravel-base-repository. Make sure it is installed in your project as well.


✅ Usage

1. Create Your Service Class

Create a new service class that extends BaseService and specifies the repository class:

namespace App\Services;

use App\Repositories\OrderRepository;
use Nos\BaseService\BaseService;

class OrderService extends BaseService
{
    protected string $repositoryClass = OrderRepository::class;
}

2. Use the Service in a Controller or Other Logic

Inject the service and use its methods:

namespace App\Http\Controllers;

use App\Services\OrderService;
use Illuminate\Http\Request;

class OrderController extends Controller
{
    protected $orderService;

    public function __construct(OrderService $orderService)
    {
        $this->orderService = $orderService;
    }

    public function index()
    {
        $orders = $this->orderService->all();
        return view('orders.index', compact('orders'));
    }

    public function store(Request $request)
    {
        $order = $this->orderService->create($request->all());
        return redirect()->route('orders.show', $order->id);
    }
}

🔧 Available Methods

Method Description
getRepository() Returns the repository instance
all() Get all records
count() Count all records
find(int $modelId) Find a record by ID
exists(int $modelId) Check if a record exists
create(array $data) Create a new record (throws exception on failure)
update(int $modelId, array $data) Update a record by ID
delete(int $modelId) Delete a record by ID
updateOrCreate(array $attributes, array $data) Update or create a record
paginate(int $pageNumber, int $pageSize, callable $builderCallback) Paginate results with optional query builder callback

🌐 Project Structure

vendor/
└── imjonos/
    └── laravel-base-service/
        ├── src/
        │   └── BaseService.php

📦 Requirements

  • PHP 8.0+
  • Laravel 9+

🧪 Testing

You can easily mock the service and its repository in your tests, which helps keep your application logic decoupled and improves test coverage.


📝 License

This package is open-sourced software licensed under the MIT license. Please see the license file for more information.


🚀 Contributing

Please see contributing.md for details and a todolist.

Related Packages

smorken/service

Services for PHP/Laravel

3,786
capeandbay/laravel-service-generator
1,038 0
bulaohe/lumensdk-rrd-client

Service Client

35 0
bulaohe/lumensdk-rrd-queue

Queue Service Sdk

34 0
bulaohe/lumensdk-rrd-stock

Stock Service Sdk

34 0

Version History

Version Released Laravel License
1.1.5 ~5|~6|~7|~8|~9|~10|~11|~12|~13 MIT
1.1.4 ~5|~6|~7|~8|~9|~10|~11|~12|~13 MIT
1.1.3 ~5|~6|~7|~8|~9|~10|~11|~12 MIT
1.1.2 ~5|~6|~7|~8|~9|~10|~11|~12 MIT
1.1.1 ~5|~6|~7|~8|~9|~10|~11|~12 MIT