lmendes / package-name
A Laravel package description
Requires
- php: ^8.1
- illuminate/console: ^10.0|^11.0
- illuminate/database: ^10.0|^11.0
- illuminate/routing: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.0
This package is not auto-updated.
Last update: 2026-04-13 02:41:53 UTC
README
A short description of your Laravel package.
Requirements
- PHP ^8.1
- Composer ^2.0
- Node.js ^18 & NPM
- Laravel ^10.0 or ^11.0
Local Development Setup
Follow these steps to get the project running on your machine.
1. Clone & go to the project folder
cd ~/Downloads/laravel-package
2. Install PHP dependencies
composer install
This will generate the
vendor/folder andcomposer.lockautomatically.
3. Set up the environment file
cp .env.example .env php artisan key:generate
Edit
.envto configure your database, mail, etc. By default, SQLite is used — no extra setup needed.
4. Run the database migrations
php artisan migrate
Optionally seed the database with test data:
php artisan db:seed
5. Install JS dependencies & start the dev server
npm install npm run dev
For a production build, use
npm run buildinstead.
Your application is now running at http://localhost:8000 (or use php artisan serve).
Installation via Packagist
Once published, install the package in any Laravel project:
composer require vendor-name/package-name
The package will auto-discover its service provider via Laravel's package auto-discovery.
Publish the config file (optional)
php artisan vendor:publish --tag=package-name-config
Publish the migrations (optional)
php artisan vendor:publish --tag=package-name-migrations php artisan migrate
Run the installer command (optional)
php artisan package-name:install
Configuration
After publishing, edit config/package-name.php:
return [ 'enabled' => env('PACKAGE_NAME_ENABLED', true), 'option_one' => env('PACKAGE_NAME_OPTION_ONE', 'default_value'), ];
Usage
Via Facade
use VendorName\PackageName\Facades\PackageName; echo PackageName::hello(); // "Hello from PackageName!"
Via Dependency Injection
use VendorName\PackageName\PackageName; class MyController extends Controller { public function __construct(protected PackageName $package) {} public function index() { return $this->package->hello(); } }
Via Service Container
$package = app('package-name'); echo $package->hello();
Testing
composer test
Changelog
Please see CHANGELOG.md for information on recent changes.
Contributing
Please see CONTRIBUTING.md for details.
License
The MIT License (MIT). Please see LICENSE.md for more information.