Skip to content

Commit 75b34f4

Browse files
committed
FUNDING github and ...
1 parent 2260a0e commit 75b34f4

File tree

5 files changed

+10
-22
lines changed

5 files changed

+10
-22
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: ['https://idpay.ir/laravelir']

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ Laravelir\Attachmentable\Providers\AttachmentableServiceProvider::class,
2525
php artisan attachmentable:install
2626
```
2727

28+
3. Run the command below to migrate database:
29+
30+
```
31+
php artisan migrate
32+
```
33+
2834
## Uses
2935

3036
First add `Attachmentable` trait to models that you want have attachments

src/Console/Commands/InstallPackageCommand.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,4 @@ private function publishConfig()
6464
]);
6565
}
6666

67-
// protected function publishMigrations()
68-
// {
69-
// if (empty(File::glob(database_path('migrations/*_create_attachmentables_tables.php')))) {
70-
71-
// $this->publishes([
72-
// __DIR__ . '/../../database/migrations/create_attachmentables_table.stub.php' => database_path() . "/migrations//" . date('Y_m_d_His', time()) . "_create_attachmentables_tables.php",
73-
// ], 'attachmentable-migrations');
74-
// } else {
75-
// $list = File::glob(database_path('migrations\*_create_attachmentables_tables.php'));
76-
// collect($list)->each(function ($item) {
77-
// File::delete($item);
78-
// dd("delete");
79-
// });
80-
81-
// Artisan::call('php artisan vendor:publish --provider=Laravelir\\Attachmentable\\Providers\\AttachmentableServiceProvider --tag=attachmentable-migrations --force');
82-
// }
83-
// }
8467
}

src/Providers/AttachmentableServiceProvider.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Laravelir\Attachmentable\Providers;
44

5-
use Illuminate\Support\Facades\Artisan;
6-
use Illuminate\Support\Facades\File;
75
use Illuminate\Support\ServiceProvider;
86
use Laravelir\Attachmentable\Facades\AttachmentableFacade;
97
use Laravelir\Attachmentable\Console\Commands\InstallPackageCommand;
@@ -14,10 +12,9 @@ class AttachmentableServiceProvider extends ServiceProvider
1412
public function register()
1513
{
1614
$this->mergeConfigFrom(__DIR__ . "/../../config/attachmentable.php", 'attachmentable');
15+
$this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
1716

1817
$this->registerFacades();
19-
20-
$this->publishMigrations();
2118
}
2219

2320
/**
@@ -30,6 +27,7 @@ public function boot()
3027
$this->publishConfig();
3128

3229
if ($this->app->runningInConsole()) {
30+
$this->publishMigrations();
3331
$this->registerCommands();
3432
}
3533
}
@@ -58,7 +56,7 @@ public function publishConfig()
5856
protected function publishMigrations()
5957
{
6058
$this->publishes([
61-
__DIR__ . '/../../database/migrations/create_attachmentables_table.stub.php' => database_path() . "/migrations//" . date('Y_m_d_His', time()) . "_create_attachmentables_tables.php",
59+
__DIR__ . '/../../database/migrations/create_attachmentables_table.stub' => database_path() . "/migrations//" . date('Y_m_d_His', time()) . "_create_attachmentables_table.php",
6260
], 'attachmentable-migrations');
6361
}
6462
}

0 commit comments

Comments
 (0)