Skip to content

Commit 3ad9661

Browse files
authored
Merge pull request #3 from codebar-ag/feature-improved-migration-handling
Feature Improved Migration Handling
2 parents 16899d2 + 0e458e2 commit 3ad9661

File tree

6 files changed

+397
-364
lines changed

6 files changed

+397
-364
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ php artisan vendor:publish --provider="CodebarAg\\LaravelEventLogs\\LaravelEvent
4545

4646
This will publish the configuration file to `config/laravel-event-logs.php` where you can customize the package settings.
4747

48+
### Publish Migrations (Optional)
49+
50+
If you want to customize the migrations or need them in your application's `database/migrations` directory, you can publish them:
51+
52+
```bash
53+
php artisan vendor:publish --tag=laravel-event-logs-migrations
54+
```
55+
56+
**Note**: Migrations are automatically loaded from the package, so publishing is optional. However, if you plan to use the `event-logs:schema:create` command, it's recommended to publish the migrations first, or the command will automatically publish them for you.
57+
4858
## Configuration
4959

5060
### Database Connection
@@ -82,10 +92,11 @@ php artisan event-logs:schema:create
8292

8393
This command will:
8494
- Check if the event logs connection is configured
85-
- Verify if the schema already exists
95+
- Verify if the `event_logs` table already exists
8696
- Run the migration to create the `event_logs` table if it doesn't exist
97+
- Automatically publish migrations if they haven't been published yet
8798

88-
**Note**: The command requires the `connection` configuration to be set. If not configured, the command will fail with an error message.
99+
**Note**: The command requires the `connection` configuration to be set. If not configured, the command will fail with an error message. If migrations are not published, the command will automatically publish them before running the migration.
89100

90101
#### Drop Schema
91102

0 commit comments

Comments
 (0)