Laravel 10 package development from scratch

Ivan Kolodii
tenantcloud-engineering
4 min readApr 9, 2023

--

This article is an updated version of Laravel 7 package development article

Step 1. Create a new project

I prefer using the Laravel installer. You can read more about the installation here: https://laravel.com/docs/10.x/installation

laravel new lara-dg

I prefer using SQLite for testing and package development. Adjust your.env file

DB_CONNECTION=sqlite
DB_DATABASE=/Users/ivan/code/packages/test-project/database/database.sqlite

Then let’s create our package skeleton. We will be using a CLI tool. It will generate all necessary files

composer require jeroen-g/laravel-packager

Then you can run generation command. Webkid stands for vendor name(your namespace) and LaravelDiagnostic as the name of your project

php artisan packager:new Webkid LaravelDiagnostic --i

Then type information about your package and you. It should look like that

Console output

Now you have packages folder inside of your project with Webkid directory inside and all necessary files inside.

This package is automatically loaded via composer. I prefer using a relative path:

"repositories": {…

--

--

tenantcloud-engineering
tenantcloud-engineering

Published in tenantcloud-engineering

Explore the forefront of technology with TenantCloud’s engineering team. Discover the latest in property tech, cloud solutions, DevOps, AI integration, and more as we build technology to shape the future of real estate. 🏠🚀

Ivan Kolodii
Ivan Kolodii

No responses yet