generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/JhumanJ/laravel-model-stats
- Loading branch information
Showing
24 changed files
with
199 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Jhumanj\LaravelModelStats\Database\Factories; | ||
|
||
use Jhumanj\LaravelModelStats\Models\Dashboard; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
class DashboardFactory extends Factory | ||
{ | ||
protected $model = Dashboard::class; | ||
|
||
public function definition(): array | ||
{ | ||
return [ | ||
'name' => $this->faker->name, | ||
'description' => $this->faker->sentence, | ||
'body' => '{"widgets":[]}', | ||
]; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Config; | ||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
public function up() | ||
return new class extends Migration { | ||
|
||
public function up(): void | ||
{ | ||
Schema::create('model-stats-dashboards', function (Blueprint $table) { | ||
Schema::create(Config::get('model-stats.table_name'), function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('name'); | ||
$table->text('description'); | ||
$table->jsonb('body')->default('{"widgets":[]}'); | ||
if (Config::get('database.defaults') === 'pgsql') { | ||
$table->jsonb('body')->default('{"widgets":[]}'); | ||
} else { | ||
$table->json('body'); | ||
} | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
public function down() | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('model-stats-dashboards'); | ||
Schema::dropIfExists(Config::get('model-stats.table_name')); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.