Skip to content

Commit 5107201

Browse files
committed
Create database and autoload issue fix
1 parent 404c5cd commit 5107201

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

composer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"autoload": {
1313
"psr-4" : {
14-
"SoftinkLab\\LaravelKeyvalueStorage\\" : "src"
14+
"SoftinkLab\\LaravelKeyvalueStorage\\" : "src/"
1515
}
1616
},
1717
"license": "MIT",
@@ -21,5 +21,12 @@
2121
"email": "pasan@softinklab.com"
2222
}
2323
],
24-
"minimum-stability": "dev"
24+
"minimum-stability": "dev",
25+
"extra": {
26+
"laravel": {
27+
"providers": [
28+
"SoftinkLab\\LaravelKeyvalueStorage\\KeyValueStorageServiceProvider"
29+
]
30+
}
31+
}
2532
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class CreateKvOptionsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('kv_options', function (Blueprint $table) {
17+
$table->bigIncrements('id');
18+
$table->string('key')->unique();
19+
$table->text('value');
20+
$table->text('comment');
21+
});
22+
}
23+
24+
/**
25+
* Reverse the migrations.
26+
*
27+
* @return void
28+
*/
29+
public function down()
30+
{
31+
Schema::dropIfExists('kv_options');
32+
}
33+
}

src/Providers/KeyValueStorageServiceProvider.php renamed to src/KeyValueStorageServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22

3-
namespace SoftinkLab\LaravelKeyvalueStorage\Providers;
3+
namespace SoftinkLab\LaravelKeyvalueStorage;
44

55
use Illuminate\Support\ServiceProvider;
66

77
class KeyValueStorageServiceProvider extends ServiceProvider
88
{
99
public function boot()
1010
{
11-
11+
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
1212
}
1313

1414
public function register()

0 commit comments

Comments
 (0)