Merge branch 'refs/heads/develop' into bug/sc-24884
# Conflicts: # routes/api.php
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Asset;
|
||||
use App\Models\License;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
@@ -15,6 +16,15 @@ class LicenseSeatFactory extends Factory
|
||||
];
|
||||
}
|
||||
|
||||
public function assignedToAsset(Asset $asset = null)
|
||||
{
|
||||
return $this->state(function () use ($asset) {
|
||||
return [
|
||||
'asset_id' => $asset->id ?? Asset::factory(),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function assignedToUser(User $user = null)
|
||||
{
|
||||
return $this->state(function () use ($user) {
|
||||
|
||||
@@ -46,6 +46,11 @@ class StatuslabelFactory extends Factory
|
||||
});
|
||||
}
|
||||
|
||||
public function readyToDeploy()
|
||||
{
|
||||
return $this->rtd();
|
||||
}
|
||||
|
||||
public function pending()
|
||||
{
|
||||
return $this->state(function () {
|
||||
|
||||
@@ -38,6 +38,16 @@ class UserFactory extends Factory
|
||||
];
|
||||
}
|
||||
|
||||
public function deletedUser()
|
||||
{
|
||||
return $this->state(function () {
|
||||
return [
|
||||
'deleted_at' => $this->faker->dateTime(),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function firstAdmin()
|
||||
{
|
||||
return $this->state(function () {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddParentIdIndexToLocations extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('locations', function (Blueprint $table) {
|
||||
$table->index('parent_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('locations', function (Blueprint $table) {
|
||||
//
|
||||
$table->dropIndex('locations_parent_id_index');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->boolean('profile_edit')->nullable()->default(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('settings', 'profile_edit')) {
|
||||
$table->dropColumn('profile_edit');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user