https://github.com/sohelamin/laravel-package-boilerplate
Laravel Package Boilerplate
https://github.com/sohelamin/laravel-package-boilerplate
Last synced: 6 months ago
JSON representation
Laravel Package Boilerplate
- Host: GitHub
- URL: https://github.com/sohelamin/laravel-package-boilerplate
- Owner: sohelamin
- Created: 2015-08-14T16:57:27.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-14T17:54:56.000Z (about 10 years ago)
- Last Synced: 2025-04-02T15:11:10.245Z (6 months ago)
- Language: PHP
- Size: 102 KB
- Stars: 8
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel Package Boilerplate
Laravel 5 Package Boilerplate### Requirements
Laravel >=5.1
PHP >= 5.5.9
## Installation1. Make your vendor directory under your project's main vendor directory.
```
cd vendor
mkdir my-vendor
```
2. Clone the package's boilerplate from github repo into your vendor's package directory.
```
git clone https://github.com/sohelamin/laravel-package-boilerplate.git my-package
```3. Add your package dir to your project's main **composer.json** file.
```
"psr-4": {
"App\\": "app/",
"MyVendor\\MyPackage\\": "vendor/my-vendor/my-package/src"
}
```
Note: When you will submit your package to **packagist.org** for composer package then you don't need to follow above instruction #3.4. Add service provider into **/config/app.php** file.
```php
'providers' => [
...
MyVendor\MyPackage\MyPackageServiceProvider::class,
],
```5. Navigate to your project directory and run.
```
composer dump-autoload
composer update
```## Usage
See the bellow snippets.
```php
$myPackage = $this->app['MyPackageClass'];
echo $myPackage::sayHi();
```##Author