Support the ongoing development of Laravel.io →
Packages

I want to create a custom package for laravel 5.3 but I get the error


It's my first time doing this.   
My package map

   vendor/
  kenny/
    proxmox/
      src/
        ProxmoxServiceProvider.php
      composer.json
my package composer
{
    "name": "Kenny/Proxmox",
    "description": "NULL",
    "type": "Package Type (e.g. library, project, metapackage, composer-plugin) []: NULL",
    "require": {
        
    },
    "authors": [
        {
            "name": "Kenny Sinkeler",
            "email": "info@kennysinkeler.nl"
        }
    ], 
    
        "psr-4": {
           
            "Kenny\\Proxmox\\": "/src"
        }
    },


}
my ProxmoxServiceProvider.php
<?php
namespace Kenny\Proxmox;

use Illuminate\Support\ServiceProvider;

class ProxmoxServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
and of course my main composer.json
{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*"
       
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*"

    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/",
            "Kenny\\Proxmox\\" :"vendor/kenny/Proxmox/src"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php",
            "app/User.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}
I don't know what is wrong. I have used auto-dump but that was not working.
Maybe I have a wrong code. Idk please help me!
Last updated 3 years ago.
0

You need to define the provider class in the config/app.php

0

astroanu said:

You need to define the provider class in the config/app.php

I have Kenny\Proxmox\ProxmoxServiceProvider::class In app.php

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.