PHPackages                             janole/laravel-composer-package - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. janole/laravel-composer-package

ActiveProject[Testing &amp; Quality](/categories/testing)

janole/laravel-composer-package
===============================

Just a demo composer package for Laravel ...

v1.0.0(7y ago)126MITPHPCI failing

Since May 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/janole/laravel-composer-package)[ Packagist](https://packagist.org/packages/janole/laravel-composer-package)[ RSS](/packages/janole-laravel-composer-package/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

laravel-composer-package
========================

[](#laravel-composer-package)

This is a demo composer package for Laravel. It will show you how to add views, routes and even an `artisan` command. You could use this project as a starting point for creating your own packages 😉.

Installation
------------

[](#installation)

Just require the package in your Laravel app:

```
composer require janole/laravel-composer-package
```

Now you will have a new `artisan` command:

```
$ php artisan demo:command
Hello, world!
```

And there will be some demo routes as well:

```
$ php artisan route:list
+--------+----------+-----------+------+---------+--------------+
| Domain | Method   | URI       | Name | Action  | Middleware   |
+--------+----------+-----------+------+---------+--------------+
|        | GET|HEAD | /         |      | Closure | web          |
|        | GET|HEAD | api/v1/me |      | Closure | api          |
|        | GET|HEAD | hello     |      | Closure |              |
|        | GET|HEAD | me        |      | Closure | web          |
+--------+----------+-----------+------+---------+--------------+

```

How does this work? (... is it magic? ... no!)
----------------------------------------------

[](#how-does-this-work--is-it-magic--no)

First, you need to register your package with Laravel.

Just extend an `Illuminate\Support\ServiceProvider` class and add it to an `extra -> laravel -> providers` block in the **composer.json** package description file:

```
{
    "name": "janole/laravel-composer-package",
    "type": "project",
    "description": "Just a demo composer package for Laravel ...",
    ...
    "extra": {
        "laravel": {
            "providers": [
                "janole\\Demo\\PackageServiceProvider"
            ]
        }
    }
}

```

#### Inside of the `PackageServiceProvider`

[](#inside-of-the-packageserviceprovider)

Use the `boot()` function of the extended provider class to register commands, routes or views:

```
class PackageServiceProvider extends ServiceProvider
{
    ...

    public function boot()
    {
        // Register an artisan command ... (php artisan demo:command)
        $this->commands([\janole\Demo\Console\Commands\DemoCommand::class]);

        // Register some demo routes
        $this->loadRoutesFrom(__DIR__.'/../routes/routes.php');

        // Register some demo views
        // (use them with the corresponding prefix like: @include("demo-views::the-view-name"))
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'demo-views');
    }
}
```

Using the views
---------------

[](#using-the-views)

When registering views, you can specify a **prefix**:

```
$this->loadViewsFrom(__DIR__.'/../resources/views', 'prefix');
```

Now, you can simply start using the views (*Blade Templates*) in your **Laravel** app like this:

```
@include("prefix::the-view-name", ...)
```

References
----------

[](#references)

- [Laravel Package Development](https://laravel.com/docs/5.8/packages) from the official Laravel documentation
- [Laravel Package Development Basics](https://pineco.de/laravel-package-development-basics/) from Pineco.de

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 52.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2617d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75067d4a9c12f733986115dab9301ab8c43faf179f9e15a373438b60edc679cb?d=identicon)[janole](/maintainers/janole)

---

Top Contributors

[![rocketole](https://avatars.githubusercontent.com/u/170500402?v=4)](https://github.com/rocketole "rocketole (9 commits)")[![janole](https://avatars.githubusercontent.com/u/1439712?v=4)](https://github.com/janole "janole (8 commits)")

---

Tags

testlaraveldemo

### Embed Badge

![Health badge](/badges/janole-laravel-composer-package/health.svg)

```
[![Health](https://phpackages.com/badges/janole-laravel-composer-package/health.svg)](https://phpackages.com/packages/janole-laravel-composer-package)
```

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k41.3M38.9k](/packages/orchestra-testbench)[hotmeteor/spectator

Testing helpers for your OpenAPI spec

3051.5M1](/packages/hotmeteor-spectator)[benconstable/phpspec-laravel

Test your Laravel applications with PhpSpec

144350.6k15](/packages/benconstable-phpspec-laravel)[guanguans/laravel-soar

SQL optimizer and rewriter for laravel. - laravel 的 SQL 优化器和重写器。

2228.3k](/packages/guanguans-laravel-soar)[hughsaffar/laravel-test-trap

Laravel Test Trap

18406.8k](/packages/hughsaffar-laravel-test-trap)[spurwork/spectator

Testing helpers for your OpenAPI spec

3041.5k](/packages/spurwork-spectator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
