You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/2.0/packages/create-package.md
+56-1Lines changed: 56 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,61 @@ return [
77
77
];
78
78
```
79
79
80
+
### Registering Your Package Using CLI
81
+
82
+
#### Step 1: Verify the `composer.json` File
83
+
84
+
Before proceeding, ensure that your package has a valid `composer.json` file. This file defines your package's configuration and dependencies. Below is an example of what the `composer.json` file for `krayin/laravel-admin` should look like:
- **Package Name:** `"krayin/laravel-admin"` – The name of the package to be installed.
116
+
- **License:** `"MIT"` – Defines the license for the package.
117
+
- **Authors:** Information about the package authors, such as name and email.
118
+
- **Autoloading:**
119
+
- `"psr-4"` autoloading is used to map the `Webkul\Admin` namespace to the `src/` directory.
120
+
- **Providers:** The `AdminServiceProvider` is listed as a provider to be registered with Laravel automatically.
121
+
- **Minimum Stability:** Set to `"dev"` to allow development versions of the package to be installed.
122
+
123
+
#### Step 2: Install the Package Locally
124
+
125
+
Once the `composer.json` file is set up, you can install the package locally via Composer's command-line interface.
126
+
127
+
Run the following command:
128
+
129
+
```bash
130
+
composer require krayin/laravel-admin dev-master
131
+
```
132
+
133
+
This command tells Composer to require the `krayin/laravel-admin` package and install it along with any other dependencies listed in the package's `composer.json`.
134
+
80
135
### Run the Commands
81
136
82
137
Run the following commands to autoload your package and publish its assets and configurations:
@@ -202,4 +257,4 @@ Run the following command to autoload your package:
0 commit comments