Skip to content

A free open source IT asset/license management system

Apply pint to database directory

snipeb5a46a370f85
diff --git a/database/factories/AccessoryFactory.php b/database/factories/AccessoryFactory.php
index f2c01dc8fb..0e44fcedcf 100644
--- a/database/factories/AccessoryFactory.php
+++ b/database/factories/AccessoryFactory.php
@@ -144,7 +144,7 @@ class AccessoryFactory extends Factory
});
}
- public function checkedOutToUser(User $user = null)
+ public function checkedOutToUser(?User $user = null)
{
return $this->afterCreating(function (Accessory $accessory) use ($user) {
$accessory->checkouts()->create([
@@ -172,7 +172,7 @@ class AccessoryFactory extends Factory
});
}
- public function checkedOutToAsset(Asset $asset = null)
+ public function checkedOutToAsset(?Asset $asset = null)
{
return $this->afterCreating(function (Accessory $accessory) use ($asset) {
$accessory->checkouts()->create([
@@ -185,7 +185,7 @@ class AccessoryFactory extends Factory
});
}
- public function checkedOutToLocation(Location $location = null)
+ public function checkedOutToLocation(?Location $location = null)
{
return $this->afterCreating(function (Accessory $accessory) use ($location) {
$accessory->checkouts()->create([
diff --git a/database/factories/ActionlogFactory.php b/database/factories/ActionlogFactory.php
index 4773b39532..edf9955198 100644
--- a/database/factories/ActionlogFactory.php
+++ b/database/factories/ActionlogFactory.php
@@ -41,18 +41,18 @@ class ActionlogFactory extends Factory
$asset = Asset::inRandomOrder()->RTD()->first();
$asset->update(
- [
- 'assigned_to' => $target->id,
- 'assigned_type' => User::class,
- 'location_id' => $target->location_id,
- ]
- );
-
+ [
+ 'assigned_to' => $target->id,
+ 'assigned_type' => User::class,
+ 'location_id' => $target->location_id,
+ ]
+ );
+
return [
- 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
+ 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
'action_type' => 'checkout',
'item_id' => $asset->id,
- 'item_type' => Asset::class,
+ 'item_type' => Asset::class,
'target_id' => $target->id,
'target_type' => User::class,
];
@@ -66,18 +66,18 @@ class ActionlogFactory extends Factory
$asset = Asset::inRandomOrder()->RTD()->first();
$asset->update(
- [
- 'assigned_to' => $target->id,
- 'assigned_type' => Location::class,
- 'location_id' => $target->id,
- ]
- );
+ [
+ 'assigned_to' => $target->id,
+ 'assigned_type' => Location::class,
+ 'location_id' => $target->id,
+ ]
+ );
return [
- 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
+ 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
'action_type' => 'checkout',
'item_id' => $asset->id,
- 'item_type' => Asset::class,
+ 'item_type' => Asset::class,
'target_id' => $target->id,
'target_type' => Location::class,
];
@@ -88,10 +88,10 @@ class ActionlogFactory extends Factory
* This sets up an ActionLog representing a manually added note tied to an Asset,
* with an optional User as the creator. If no User is provided, one is generated.
*
- * @param User|null $user Optional user to associate as the creator of the note.
- * @return \Illuminate\Database\Eloquent\Factories\Factory<ActionLog>
+ * @param User|null $user Optional user to associate as the creator of the note.
+ * @return Factory<Actionlog>
*/
- public function assetNote(?User $user=null)
+ public function assetNote(?User $user = null)
{
return $this
->state(function () use ($user) {
@@ -118,10 +118,10 @@ class ActionlogFactory extends Factory
]);
return [
- 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
+ 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
'action_type' => 'checkout',
'item_id' => $licenseSeat->license->id,
- 'item_type' => License::class,
+ 'item_type' => License::class,
'target_id' => $target->id,
'target_type' => User::class,
];
@@ -133,10 +133,10 @@ class ActionlogFactory extends Factory
return $this->state(function () {
return [
- 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
+ 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
'action_type' => 'uploaded',
- 'item_type' => User::class,
- 'filename' => $this->faker->unixTime('now'),
+ 'item_type' => User::class,
+ 'filename' => $this->faker->unixTime('now'),
];
});
}
@@ -148,12 +148,12 @@ class ActionlogFactory extends Factory
$asset = Asset::factory()->create();
return [
- 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
+ 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
'action_type' => 'accepted',
'item_id' => $asset->id,
- 'item_type' => Asset::class,
- 'target_type' => User::class,
- 'accept_signature' => $this->faker->unixTime('now'),
+ 'item_type' => Asset::class,
+ 'target_type' => User::class,
+ 'accept_signature' => $this->faker->unixTime('now'),
];
});
}
@@ -165,12 +165,12 @@ class ActionlogFactory extends Factory
$asset = Asset::factory()->create();
return [
- 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
+ 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
'action_type' => 'accepted',
'item_id' => $asset->id,
- 'item_type' => Asset::class,
- 'target_type' => User::class,
- 'filename' => $this->faker->unixTime('now'),
+ 'item_type' => Asset::class,
+ 'target_type' => User::class,
+ 'filename' => $this->faker->unixTime('now'),
];
});
}
@@ -180,10 +180,10 @@ class ActionlogFactory extends Factory
return $this->state(function () {
return [
- 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
+ 'created_at' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
'action_type' => 'update',
- 'target_type' => User::class,
- 'item_type' => User::class,
+ 'target_type' => User::class,
+ 'item_type' => User::class,
];
});
}
diff --git a/database/factories/AssetFactory.php b/database/factories/AssetFactory.php
index ca85c23584..58b2b941b8 100644
--- a/database/factories/AssetFactory.php
+++ b/database/factories/AssetFactory.php
@@ -4,7 +4,6 @@ namespace Database\Factories;
use App\Models\Asset;
use App\Models\AssetModel;
-use App\Models\Category;
use App\Models\CustomField;
use App\Models\Location;
use App\Models\Statuslabel;
@@ -39,7 +38,7 @@ class AssetFactory extends Factory
},
'created_by' => User::factory()->superuser(),
'asset_tag' => $this->faker->unixTime('now'),
- 'notes' => 'Created by DB seeder',
+ 'notes' => 'Created by DB seeder',
'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get())->format('Y-m-d'),
'purchase_cost' => $this->faker->randomFloat(2, '299.99', '2999.99'),
'order_number' => (string) $this->faker->numberBetween(1000000, 50000000),
@@ -49,17 +48,16 @@ class AssetFactory extends Factory
'assigned_type' => null,
'next_audit_date' => null,
'last_checkout' => null,
- 'asset_eol_date' => null
+ 'asset_eol_date' => null,
];
}
-
-
+
public function configure()
{
return $this->afterMaking(function (Asset $asset) {
// calculates the EOL date most of the time, but sometimes sets a random date so we have some explicits
- // the explicit boolean gets set in the saving() method on the observer
- $asset->asset_eol_date = $this->faker->boolean(5)
+ // the explicit boolean gets set in the saving() method on the observer
+ $asset->asset_eol_date = $this->faker->boolean(5)
? CarbonImmutable::parse($asset->purchase_date)->addMonths(rand(0, 20))->format('Y-m-d')
: CarbonImmutable::parse($asset->purchase_date)->addMonths($asset->model->eol)->format('Y-m-d');
});
@@ -291,7 +289,7 @@ class AssetFactory extends Factory
});
}
- public function assignedToUser(User $user = null)
+ public function assignedToUser(?User $user = null)
{
return $this->state(function () use ($user) {
return [
@@ -302,7 +300,7 @@ class AssetFactory extends Factory
});
}
- public function assignedToLocation(Location $location = null)
+ public function assignedToLocation(?Location $location = null)
{
return $this->state(function () use ($location) {
return [
@@ -358,20 +356,22 @@ class AssetFactory extends Factory
public function requestable()
{
$id = Statuslabel::factory()->create([
- 'archived' => false,
+ 'archived' => false,
'deployable' => true,
- 'pending' => true,
+ 'pending' => true,
])->id;
+
return $this->state(['status_id' => $id, 'requestable' => true]);
}
public function nonrequestable()
{
$id = Statuslabel::factory()->create([
- 'archived' => true,
+ 'archived' => true,
'deployable' => false,
- 'pending' => false,
+ 'pending' => false,
])->id;
+
return $this->state(['status_id' => $id, 'requestable' => false]);
}
@@ -380,13 +380,12 @@ class AssetFactory extends Factory
return $this->afterCreating(function (Asset $asset) {
$asset->update([
'purchase_date' => null,
- 'asset_eol_date' => null
+ 'asset_eol_date' => null,
]);
});
}
-
- public function hasEncryptedCustomField(CustomField $field = null)
+ public function hasEncryptedCustomField(?CustomField $field = null)
{
return $this->state(function () use ($field) {
return [
@@ -395,7 +394,7 @@ class AssetFactory extends Factory
});
}
- public function hasMultipleCustomFields(array $fields = null): self
+ public function hasMultipleCustomFields(?array $fields = null): self
{
return $this->state(function () use ($fields) {
return [
@@ -408,6 +407,7 @@ class AssetFactory extends Factory
* This allows bypassing model level validation if you want to purposefully
* create an asset in an invalid state. Validation is turned back on
* after the model is created via the factory.
+ *
* @return AssetFactory
*/
public function canBeInvalidUponCreation()
diff --git a/database/factories/AssetModelFactory.php b/database/factories/AssetModelFactory.php
index b59293cdbe..ebacba9840 100644
--- a/database/factories/AssetModelFactory.php
+++ b/database/factories/AssetModelFactory.php
@@ -3,13 +3,13 @@
namespace Database\Factories;
use App\Models\AssetModel;
+use App\Models\Category;
use App\Models\CustomField;
use App\Models\CustomFieldset;
use App\Models\Depreciation;
use App\Models\Manufacturer;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
-use App\Models\Category;
class AssetModelFactory extends Factory
{
@@ -201,7 +201,7 @@ class AssetModelFactory extends Factory
return $this->state(function () {
return [
'name' => 'iMac Pro',
- 'category_id' => function (){
+ 'category_id' => function () {
return Category::where('name', 'Desktops')->first() ?? Category::factory()->assetDesktopCategory();
},
'manufacturer_id' => function () {
@@ -247,7 +247,7 @@ class AssetModelFactory extends Factory
return $this->state(function () {
return [
'name' => 'OptiPlex',
- 'category_id' => function (){
+ 'category_id' => function () {
return Category::where('name', 'Desktops')->first() ?? Category::factory()->assetDesktopCategory();
},
'manufacturer_id' => function () {
@@ -432,7 +432,7 @@ class AssetModelFactory extends Factory
});
}
- public function hasEncryptedCustomField(CustomField $field = null)
+ public function hasEncryptedCustomField(?CustomField $field = null)
{
return $this->state(function () use ($field) {
return [
@@ -441,7 +441,7 @@ class AssetModelFactory extends Factory
});
}
- public function hasMultipleCustomFields(array $fields = null)
+ public function hasMultipleCustomFields(?array $fields = null)
{
return $this->state(function () use ($fields) {
return [
diff --git a/database/factories/CategoryFactory.php b/database/factories/CategoryFactory.php
index d2dd6a8b0b..b9a5fe8b4a 100644
--- a/database/factories/CategoryFactory.php
+++ b/database/factories/CategoryFactory.php
@@ -2,9 +2,9 @@
namespace Database\Factories;
+use App\Models\Category;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
-use App\Models\Category;
class CategoryFactory extends Factory
{
@@ -28,7 +28,7 @@ class CategoryFactory extends Factory
'created_by' => User::factory()->superuser(),
'eula_text' => $this->faker->paragraph(),
'name' => $this->faker->catchPhrase(),
- 'notes' => 'Created by DB seeder',
+ 'notes' => 'Created by DB seeder',
'require_acceptance' => false,
'tag_color' => $this->faker->hexColor(),
'use_default_eula' => false,
@@ -64,115 +64,113 @@ class CategoryFactory extends Factory
]);
}
- // usage: Category::factory()->assetTabletCategory();
- public function assetTabletCategory()
- {
- return $this->state([
- 'name' => 'Tablets',
- 'category_type' => 'asset',
- ]);
- }
-
- // usage: Category::factory()->assetMobileCategory();
- public function assetMobileCategory()
- {
- return $this->state([
- 'name' => 'Mobile Phones',
- 'category_type' => 'asset',
- ]);
- }
-
- // usage: Category::factory()->assetConferenceCategory();
- public function assetConferenceCategory()
- {
- return $this->state([
- 'name' => 'Conference Phones',
- 'category_type' => 'asset',
- ]);
- }
-
-
- // usage: Category::factory()->assetVoipCategory();
- public function assetVoipCategory()
- {
- return $this->state([
- 'name' => 'VOIP Phones',
- 'category_type' => 'asset',
- ]);
- }
-
- // usage: Category::factory()->accessoryKeyboardCategory();
- public function accessoryKeyboardCategory()
- {
- return $this->state([
- 'name' => 'Keyboards',
- 'category_type' => 'accessory',
- ]);
- }
-
-
- // usage: Category::factory()->accessoryMouseCategory();
- public function accessoryMouseCategory()
- {
- return $this->state([
- 'name' => 'Mouse',
- 'category_type' => 'accessory',
- ]);
- }
-
- // usage: Category::factory()->componentHddCategory();
- public function componentHddCategory()
- {
- return $this->state([
- 'name' => 'HDD/SSD',
- 'category_type' => 'component',
- ]);
- }
-
- // usage: Category::factory()->componentRamCategory();
- public function componentRamCategory()
- {
- return $this->state([
- 'name' => 'RAM',
- 'category_type' => 'component',
- ]);
- }
-
- // usage: Category::factory()->consumablePaperCategory();
- public function consumablePaperCategory()
- {
- return $this->state([
- 'name' => 'Printer Paper',
- 'category_type' => 'consumable',
- ]);
- }
-
- // usage: Category::factory()->consumableInkCategory();
- public function consumableInkCategory()
- {
- return $this->state([
- 'name' => 'Printer Ink',
- 'category_type' => 'consumable',
- ]);
- }
-
- // usage: Category::factory()->licenseGraphicsCategory();
- public function licenseGraphicsCategory()
- {
- return $this->state([
- 'name' => 'Graphics Software',
- 'category_type' => 'license',
- ]);
- }
-
- // usage: Category::factory()->licenseGraphicsCategory();
- public function licenseOfficeCategory()
- {
- return $this->state([
- 'name' => 'Office Software',
- 'category_type' => 'license',
- ]);
- }
+ // usage: Category::factory()->assetTabletCategory();
+ public function assetTabletCategory()
+ {
+ return $this->state([
+ 'name' => 'Tablets',
+ 'category_type' => 'asset',
+ ]);
+ }
+
+ // usage: Category::factory()->assetMobileCategory();
+ public function assetMobileCategory()
+ {
+ return $this->state([
+ 'name' => 'Mobile Phones',
+ 'category_type' => 'asset',
+ ]);
+ }
+
+ // usage: Category::factory()->assetConferenceCategory();
+ public function assetConferenceCategory()
+ {
+ return $this->state([
+ 'name' => 'Conference Phones',
+ 'category_type' => 'asset',
+ ]);
+ }
+
+ // usage: Category::factory()->assetVoipCategory();
+ public function assetVoipCategory()
+ {
+ return $this->state([
+ 'name' => 'VOIP Phones',
+ 'category_type' => 'asset',
+ ]);
+ }
+
+ // usage: Category::factory()->accessoryKeyboardCategory();
+ public function accessoryKeyboardCategory()
+ {
+ return $this->state([
+ 'name' => 'Keyboards',
+ 'category_type' => 'accessory',
+ ]);
+ }
+
+ // usage: Category::factory()->accessoryMouseCategory();
+ public function accessoryMouseCategory()
+ {
+ return $this->state([
+ 'name' => 'Mouse',
+ 'category_type' => 'accessory',
+ ]);
+ }
+
+ // usage: Category::factory()->componentHddCategory();
+ public function componentHddCategory()
+ {
+ return $this->state([
+ 'name' => 'HDD/SSD',
+ 'category_type' => 'component',
+ ]);
+ }
+
+ // usage: Category::factory()->componentRamCategory();
+ public function componentRamCategory()
+ {
+ return $this->state([
+ 'name' => 'RAM',
+ 'category_type' => 'component',
+ ]);
+ }
+
+ // usage: Category::factory()->consumablePaperCategory();
+ public function consumablePaperCategory()
+ {
+ return $this->state([
+ 'name' => 'Printer Paper',
+ 'category_type' => 'consumable',
+ ]);
+ }
+
+ // usage: Category::factory()->consumableInkCategory();
+ public function consumableInkCategory()
+ {
+ return $this->state([
+ 'name' => 'Printer Ink',
+ 'category_type' => 'consumable',
+ ]);
+ }
+
+ // usage: Category::factory()->licenseGraphicsCategory();
+ public function licenseGraphicsCategory()
+ {
+ return $this->state([
+ 'name' => 'Graphics Software',
+ 'category_type' => 'license',
+ ]);
+ }
+
+ // usage: Category::factory()->licenseGraphicsCategory();
+ public function licenseOfficeCategory()
+ {
+ return $this->state([
+ 'name' => 'Office Software',
+ 'category_type' => 'license',
+ ]);
+ }
public function forAccessories()
{
diff --git a/database/factories/CheckoutAcceptanceFactory.php b/database/factories/CheckoutAcceptanceFactory.php
index 1cd139176e..4ff49cdd83 100644
--- a/database/factories/CheckoutAcceptanceFactory.php
+++ b/database/factories/CheckoutAcceptanceFactory.php
@@ -23,6 +23,7 @@ class CheckoutAcceptanceFactory extends Factory
'assigned_to_id' => User::factory(),
];
}
+
protected static bool $skipActionLog = false;
public function withoutActionLog(): static
@@ -48,14 +49,13 @@ class CheckoutAcceptanceFactory extends Factory
if ($acceptance->checkoutable instanceof Asset && $acceptance->assignedTo instanceof User) {
$acceptance->checkoutable->update([
- 'assigned_to' => $acceptance->assigned_to_id,
- 'assigned_type'=> get_class($acceptance->assignedTo),
+ 'assigned_to' => $acceptance->assigned_to_id,
+ 'assigned_type' => get_class($acceptance->assignedTo),
]);
}
});
}
-
public function forAccessory()
{
return $this->state([
diff --git a/database/factories/CompanyFactory.php b/database/factories/CompanyFactory.php
index bebde357a6..e9f2cb0669 100644
--- a/database/factories/CompanyFactory.php
+++ b/database/factories/CompanyFactory.php
@@ -24,7 +24,7 @@ class CompanyFactory extends Factory
return [
'name' => $this->faker->unique()->company(),
'created_by' => 1,
- 'notes' => 'Created by DB seeder',
+ 'notes' => 'Created by DB seeder',
'tag_color' => $this->faker->hexColor(),
];
}
diff --git a/database/factories/ComponentFactory.php b/database/factories/ComponentFactory.php
index 9230d2cafc..bde37c4e3f 100644
--- a/database/factories/ComponentFactory.php
+++ b/database/factories/ComponentFactory.php
@@ -2,18 +2,16 @@
namespace Database\Factories;
-use App\Models\Accessory;
use App\Models\Asset;
use App\Models\Category;
use App\Models\Company;
use App\Models\Component;
-use App\Models\Manufacturer;
-use App\Models\Consumable;
use App\Models\Location;
+use App\Models\Manufacturer;
+use App\Models\Supplier;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\Factory;
-use App\Models\Supplier;
class ComponentFactory extends Factory
{
@@ -44,7 +42,7 @@ class ComponentFactory extends Factory
'purchase_cost' => $this->faker->randomFloat(2),
'purchase_date' => $this->faker->dateTime()->format('Y-m-d'),
'qty' => $this->faker->numberBetween(3, 10),
- 'serial' => $this->faker->uuid(),
+ 'serial' => $this->faker->uuid(),
'supplier_id' => Supplier::factory(),
];
}
@@ -52,6 +50,7 @@ class ComponentFactory extends Factory
public function ramCrucial4()
{
$manufacturer = Manufacturer::where('name', 'Crucial')->first() ?? Manufacturer::factory()->create(['name' => 'Crucial']);
+
return $this->state(function () use ($manufacturer) {
return [
'name' => 'Crucial 4GB DDR3L-1600 SODIMM',
@@ -69,6 +68,7 @@ class ComponentFactory extends Factory
public function ramCrucial8()
{
$manufacturer = Manufacturer::where('name', 'Crucial')->first() ?? Manufacturer::factory()->create(['name' => 'Crucial']);
+
return $this->state(function () use ($manufacturer) {
return [
'name' => 'Crucial 8GB DDR3L-1600 SODIMM Memory for Mac',
@@ -85,6 +85,7 @@ class ComponentFactory extends Factory
public function ssdCrucial120()
{
$manufacturer = Manufacturer::where('name', 'Crucial')->first() ?? Manufacturer::factory()->create(['name' => 'Crucial']);
+
return $this->state(function () use ($manufacturer) {
return [
'name' => 'Crucial BX300 120GB SATA Internal SSD',
@@ -101,6 +102,7 @@ class ComponentFactory extends Factory
public function ssdCrucial240()
{
$manufacturer = Manufacturer::where('name', 'Crucial')->first() ?? Manufacturer::factory()->create(['name' => 'Crucial']);
+
return $this->state(function () use ($manufacturer) {
return [
'name' => 'Crucial BX300 240GB SATA Internal SSD',
@@ -114,7 +116,7 @@ class ComponentFactory extends Factory
});
}
- public function checkedOutToAsset(Asset $asset = null)
+ public function checkedOutToAsset(?Asset $asset = null)
{
return $this->afterCreating(function (Component $component) use ($asset) {
$component->assets()->attach($component->id, [
@@ -125,5 +127,4 @@ class ComponentFactory extends Factory
]);
});
}
-
}
diff --git a/database/factories/ConsumableFactory.php b/database/factories/ConsumableFactory.php
index 775e286dd4..a8787e8c85 100644
--- a/database/factories/ConsumableFactory.php
+++ b/database/factories/ConsumableFactory.php
@@ -6,10 +6,10 @@ use App\Models\Category;
use App\Models\Company;
use App\Models\Consumable;
use App\Models\Manufacturer;
+use App\Models\Supplier;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\Factory;
-use App\Models\Supplier;
class ConsumableFactory extends Factory
{
@@ -118,7 +118,7 @@ class ConsumableFactory extends Factory
});
}
- public function checkedOutToUser(User $user = null)
+ public function checkedOutToUser(?User $user = null)
{
return $this->afterCreating(function (Consumable $consumable) use ($user) {
$consumable->users()->attach($consumable->id, [
diff --git a/database/factories/CustomFieldFactory.php b/database/factories/CustomFieldFactory.php
index ac1fc1f1f5..599625e377 100644
--- a/database/factories/CustomFieldFactory.php
+++ b/database/factories/CustomFieldFactory.php
@@ -138,7 +138,7 @@ class CustomFieldFactory extends Factory
'name' => 'Test Checkbox',
'help_text' => 'This is a sample checkbox.',
'field_values' => "One\r\nTwo\r\nThree",
- 'element' => 'checkbox',
+ 'element' => 'checkbox',
];
});
}
@@ -150,9 +150,8 @@ class CustomFieldFactory extends Factory
'name' => 'Test Radio',
'help_text' => 'This is a sample radio.',
'field_values' => "One\r\nTwo\r\nThree",
- 'element' => 'radio',
+ 'element' => 'radio',
];
});
}
-
}
diff --git a/database/factories/CustomFieldsetFactory.php b/database/factories/CustomFieldsetFactory.php
index a9e8b9ae12..e2f17d1564 100644
--- a/database/factories/CustomFieldsetFactory.php
+++ b/database/factories/CustomFieldsetFactory.php
@@ -2,8 +2,8 @@
namespace Database\Factories;
-use App\Models\CustomFieldset;
use App\Models\CustomField;
+use App\Models\CustomFieldset;
use Illuminate\Database\Eloquent\Factories\Factory;
class CustomFieldsetFactory extends Factory
@@ -45,7 +45,7 @@ class CustomFieldsetFactory extends Factory
});
}
- public function hasEncryptedCustomField(CustomField $field = null)
+ public function hasEncryptedCustomField(?CustomField $field = null)
{
return $this->afterCreating(function (CustomFieldset $fieldset) use ($field) {
$field = $field ?? CustomField::factory()->testEncrypted()->create();
@@ -54,17 +54,17 @@ class CustomFieldsetFactory extends Factory
});
}
- public function hasMultipleCustomFields(array $fields = null): self
+ public function hasMultipleCustomFields(?array $fields = null): self
{
return $this->afterCreating(function (CustomFieldset $fieldset) use ($fields) {
if (empty($fields)) {
- $mac_address = CustomField::factory()->macAddress()->create();
- $ram = CustomField::factory()->ram()->create();
- $cpu = CustomField::factory()->cpu()->create();
+ $mac_address = CustomField::factory()->macAddress()->create();
+ $ram = CustomField::factory()->ram()->create();
+ $cpu = CustomField::factory()->cpu()->create();
- $fieldset->fields()->attach($mac_address, ['order' => '1', 'required' => false]);
- $fieldset->fields()->attach($ram, ['order' => '2', 'required' => false]);
- $fieldset->fields()->attach($cpu, ['order' => '3', 'required' => false]);
+ $fieldset->fields()->attach($mac_address, ['order' => '1', 'required' => false]);
+ $fieldset->fields()->attach($ram, ['order' => '2', 'required' => false]);
+ $fieldset->fields()->attach($cpu, ['order' => '3', 'required' => false]);
} else {
foreach ($fields as $field) {
$fieldset->fields()->attach($field, ['order' => '1', 'required' => false]);
diff --git a/database/factories/DepartmentFactory.php b/database/factories/DepartmentFactory.php
index bf2a4db683..e42c4cc371 100644
--- a/database/factories/DepartmentFactory.php
+++ b/database/factories/DepartmentFactory.php
@@ -26,8 +26,8 @@ class DepartmentFactory extends Factory
return [
'created_by' => User::factory()->superuser(),
'location_id' => Location::factory(),
- 'name' => $this->faker->unique()->word() . ' Department',
- 'notes' => 'Created by DB seeder',
+ 'name' => $this->faker->unique()->word().' Department',
+ 'notes' => 'Created by DB seeder',
'tag_color' => $this->faker->hexColor(),
];
}
diff --git a/database/factories/GroupFactory.php b/database/factories/GroupFactory.php
index 44bdb94cfd..4ee65f473e 100644
--- a/database/factories/GroupFactory.php
+++ b/database/factories/GroupFactory.php
@@ -25,7 +25,7 @@ class GroupFactory extends Factory
return [
'created_by' => User::factory()->superuser(),
'name' => $this->faker->name(),
- 'notes' => 'Created by DB seeder',
+ 'notes' => 'Created by DB seeder',
'permissions' => json_encode([]),
];
}
diff --git a/database/factories/ImportFactory.php b/database/factories/ImportFactory.php
index 5355cac834..a51edb014d 100644
--- a/database/factories/ImportFactory.php
+++ b/database/factories/ImportFactory.php
@@ -3,8 +3,8 @@
namespace Database\Factories;
use App\Models\Import;
-use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Str;
use Tests\Support\Importing;
/**
@@ -13,19 +13,19 @@ use Tests\Support\Importing;
class ImportFactory extends Factory
{
/**
- * @inheritdoc
+ * {@inheritdoc}
*/
protected $model = Import::class;
/**
- * @inheritdoc
+ * {@inheritdoc}
*/
public function definition()
{
return [
- 'name' => $this->faker->company,
+ 'name' => $this->faker->company,
'file_path' => Str::random().'.csv',
- 'filesize' => $this->faker->randomDigitNotNull(),
+ 'filesize' => $this->faker->randomDigitNotNull(),
'field_map' => null,
];
}
@@ -106,7 +106,7 @@ class ImportFactory extends Factory
});
}
- /**
+ /**
* Create a license import type.
*
* @return static
@@ -144,8 +144,6 @@ class ImportFactory extends Factory
});
}
-
-
/**
* Create an asset model import type.
*
@@ -231,6 +229,4 @@ class ImportFactory extends Factory
return $attributes;
});
}
-
-
}
diff --git a/database/factories/LicenseFactory.php b/database/factories/LicenseFactory.php
index c968a553c4..0ae43cdc87 100644
--- a/database/factories/LicenseFactory.php
+++ b/database/factories/LicenseFactory.php
@@ -1,4 +1,5 @@
<?php
+
namespace Database\Factories;
use App\Models\Category;
@@ -30,7 +31,7 @@ class LicenseFactory extends Factory
'expiration_date' => null,
'license_email' => $this->faker->safeEmail(),
'name' => $this->faker->name(),
- 'notes' => 'Created by DB seeder',
+ 'notes' => 'Created by DB seeder',
'order_number' => $this->faker->numberBetween(1000000, 50000000),
'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get())->format('Y-m-d'),
'reassignable' => $this->faker->boolean(),
@@ -95,7 +96,6 @@ class LicenseFactory extends Factory
return Category::where('name', 'Graphics Software')->first() ?? Category::factory()->licenseGraphicsCategory();
},
];
-
return $data;
});
diff --git a/database/factories/LicenseSeatFactory.php b/database/factories/LicenseSeatFactory.php
index 7146a61333..61579f153c 100644
--- a/database/factories/LicenseSeatFactory.php
+++ b/database/factories/LicenseSeatFactory.php
@@ -18,7 +18,7 @@ class LicenseSeatFactory extends Factory
];
}
- public function assignedToAsset(Asset $asset = null)
+ public function assignedToAsset(?Asset $asset = null)
{
return $this->state(function () use ($asset) {
return [
@@ -27,7 +27,7 @@ class LicenseSeatFactory extends Factory
});
}
- public function assignedToUser(User $user = null)
+ public function assignedToUser(?User $user = null)
{
return $this->state(function () use ($user) {
return [
diff --git a/database/factories/LocationFactory.php b/database/factories/LocationFactory.php
index 4dbb4d09a2..531cb60a8d 100644
--- a/database/factories/LocationFactory.php
+++ b/database/factories/LocationFactory.php
@@ -23,19 +23,19 @@ class LocationFactory extends Factory
'currency' => $this->faker->currencyCode(),
'image' => rand(1, 9).'.jpg',
'name' => $this->faker->city(),
- 'notes' => 'Created by DB seeder',
+ 'notes' => 'Created by DB seeder',
'state' => $this->faker->stateAbbr(),
'tag_color' => $this->faker->hexColor(),
'zip' => $this->faker->postcode(),
];
}
-
+
// one of these can eventuall go away - left temporarily for conflict resolution
public function deleted(): self
{
return $this->state(['deleted_at' => $this->faker->dateTime()]);
}
-
+
public function deletedLocation()
{
return $this->state(function () {
diff --git a/database/factories/MaintenanceFactory.php b/database/factories/MaintenanceFactory.php
index a77fdced20..a3ef7e191a 100644
--- a/database/factories/MaintenanceFactory.php
+++ b/database/factories/MaintenanceFactory.php
@@ -35,7 +35,7 @@ class MaintenanceFactory extends Factory
'url' => $this->faker->url(),
'cost' => $this->faker->randomFloat(),
'created_by' => User::factory()->superuser(),
- 'image' => $this->faker->numberBetween(1,11).'.png',
+ 'image' => $this->faker->numberBetween(1, 11).'.png',
];
}
}
diff --git a/database/factories/ManufacturerFactory.php b/database/factories/ManufacturerFactory.php
index c8c88f6da6..ac1916bae7 100644
--- a/database/factories/ManufacturerFactory.php
+++ b/database/factories/ManufacturerFactory.php
@@ -25,7 +25,7 @@ class ManufacturerFactory extends Factory
return [
'created_by' => User::factory()->superuser(),
'name' => $this->faker->unique()->company(),
- 'notes' => 'Created by DB seeder',
+ 'notes' => 'Created by DB seeder',
'support_email' => $this->faker->safeEmail(),
'support_phone' => $this->faker->phoneNumber(),
'tag_color' => $this->faker->hexColor(),
diff --git a/database/factories/PredefinedKitFactory.php b/database/factories/PredefinedKitFactory.php
index 32e192655f..8052f12df1 100644
--- a/database/factories/PredefinedKitFactory.php
+++ b/database/factories/PredefinedKitFactory.php
@@ -2,10 +2,11 @@
namespace Database\Factories;
+use App\Models\PredefinedKit;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
- * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\PredefinedKit>
+ * @extends Factory<PredefinedKit>
*/
class PredefinedKitFactory extends Factory
{
diff --git a/database/factories/ReportTemplateFactory.php b/database/factories/ReportTemplateFactory.php
index 4fdc41b40b..e28f1475fd 100644
--- a/database/factories/ReportTemplateFactory.php
+++ b/database/factories/ReportTemplateFactory.php
@@ -27,7 +27,7 @@ class ReportTemplateFactory extends Factory
public function shared()
{
return $this->state(function () {
- return['is_shared' => 1];
+ return ['is_shared' => 1];
});
}
diff --git a/database/factories/StatuslabelFactory.php b/database/factories/StatuslabelFactory.php
index 45154780b8..2a4d0f9c16 100644
--- a/database/factories/StatuslabelFactory.php
+++ b/database/factories/StatuslabelFactory.php
@@ -28,7 +28,7 @@ class StatuslabelFactory extends Factory
'created_by' => User::factory()->superuser(),
'deleted_at' => null,
'deployable' => 0,
- 'name' => $this->faker->sentence(),
+ 'name' => $this->faker->sentence(),
'notes' => '',
'pending' => 0,
'updated_at' => $this->faker->dateTime(),
@@ -87,7 +87,7 @@ class StatuslabelFactory extends Factory
{
return $this->state(function () {
return [
- 'name' => 'Out for Repair',
+ 'name' => 'Out for Repair',
'default_label' => 0,
];
});
@@ -97,7 +97,7 @@ class StatuslabelFactory extends Factory
{
return $this->state(function () {
return [
- 'name' => 'Broken - Not Fixable',
+ 'name' => 'Broken - Not Fixable',
'default_label' => 0,
];
});
@@ -107,7 +107,7 @@ class StatuslabelFactory extends Factory
{
return $this->state(function () {
return [
- 'name' => 'Lost/Stolen',
+ 'name' => 'Lost/Stolen',
'default_label' => 0,
];
});
diff --git a/database/factories/SupplierFactory.php b/database/factories/SupplierFactory.php
index 2c3e6af415..61d82b2ca4 100644
--- a/database/factories/SupplierFactory.php
+++ b/database/factories/SupplierFactory.php
@@ -30,13 +30,13 @@ class SupplierFactory extends Factory
'country' => $this->faker->countryCode(),
'created_by' => User::factory()->superuser(),
'email' => $this->faker->safeEmail(),
- 'fax' => $this->faker->phoneNumber(),
+ 'fax' => $this->faker->phoneNumber(),
'name' => $this->faker->company(),
'notes' => $this->faker->text(191), // Supplier notes can be a max of 255 characters.
'phone' => $this->faker->phoneNumber(),
'state' => $this->faker->stateAbbr(),
'tag_color' => $this->faker->hexColor(),
- 'url' => $this->faker->url(),
+ 'url' => $this->faker->url(),
'zip' => $this->faker->postCode(),
];
}
diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php
index 7b5d9045d0..874989e21c 100644
--- a/database/factories/UserFactory.php
+++ b/database/factories/UserFactory.php
@@ -5,7 +5,6 @@ namespace Database\Factories;
use App\Models\Company;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
-use \Auth;
/**
* @extends Factory<User>
@@ -53,7 +52,6 @@ class UserFactory extends Factory
});
}
-
public function firstAdmin()
{
return $this->state(function () {
@@ -362,7 +360,6 @@ class UserFactory extends Factory
return $this->appendPermission(['customfields.view' => '1']);
}
-
public function deleteCustomFields()
{
return $this->appendPermission(['customfields.delete' => '1']);
@@ -408,7 +405,6 @@ class UserFactory extends Factory
return $this->appendPermission(['assets.audit' => '1']);
}
-
private function appendPermission(array $permission)
{
return $this->state(function ($currentState) use ($permission) {
diff --git a/database/migrations/2012_12_06_225921_migration_cartalyst_sentry_install_users.php b/database/migrations/2012_12_06_225921_migration_cartalyst_sentry_install_users.php
index c4518f7926..eb11d905da 100644
--- a/database/migrations/2012_12_06_225921_migration_cartalyst_sentry_install_users.php
+++ b/database/migrations/2012_12_06_225921_migration_cartalyst_sentry_install_users.php
@@ -1,4 +1,5 @@
<?php
+
/**
* Part of the Sentry package.
*
@@ -11,9 +12,11 @@
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @version 2.0.0
+ *
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
+ *
* @link http://cartalyst.com
*/
diff --git a/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php b/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php
index 55d7318736..3f8512f0ff 100644
--- a/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php
+++ b/database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php
@@ -1,4 +1,5 @@
<?php
+
/**
* Part of the Sentry package.
*
@@ -11,9 +12,11 @@
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @version 2.0.0
+ *
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
+ *
* @link http://cartalyst.com
*/
diff --git a/database/migrations/2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivot.php b/database/migrations/2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivot.php
index d5ecbe35dd..4e270b17d6 100644
--- a/database/migrations/2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivot.php
+++ b/database/migrations/2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivot.php
@@ -1,4 +1,5 @@
<?php
+
/**
* Part of the Sentry package.
*
@@ -11,9 +12,11 @@
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @version 2.0.0
+ *
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
+ *
* @link http://cartalyst.com
*/
diff --git a/database/migrations/2012_12_06_225988_migration_cartalyst_sentry_install_throttle.php b/database/migrations/2012_12_06_225988_migration_cartalyst_sentry_install_throttle.php
index 641e3187b5..3a090dd32a 100644
--- a/database/migrations/2012_12_06_225988_migration_cartalyst_sentry_install_throttle.php
+++ b/database/migrations/2012_12_06_225988_migration_cartalyst_sentry_install_throttle.php
@@ -1,4 +1,5 @@
<?php
+
/**
* Part of the Sentry package.
*
@@ -11,9 +12,11 @@
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @version 2.0.0
+ *
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
+ *
* @link http://cartalyst.com
*/
diff --git a/database/migrations/2013_11_15_190357_create_temp_licenses_table.php b/database/migrations/2013_11_15_190357_create_temp_licenses_table.php
index 85f4e7c95e..bab2215088 100755
--- a/database/migrations/2013_11_15_190357_create_temp_licenses_table.php
+++ b/database/migrations/2013_11_15_190357_create_temp_licenses_table.php
@@ -6,17 +6,16 @@ class CreateTempLicensesTable extends Migration
{
/**
* Run the migrations.
- *
+ *
* This migration is overwritten by a later migration - 2013_11_25_recreate_licenses_table.php
*
* @return void
*/
public function up()
{
-
+
//
-
}
/**
diff --git a/database/migrations/2013_11_15_201848_add_license_name_to_licenses.php b/database/migrations/2013_11_15_201848_add_license_name_to_licenses.php
index f9094c4f02..efa800dfdf 100755
--- a/database/migrations/2013_11_15_201848_add_license_name_to_licenses.php
+++ b/database/migrations/2013_11_15_201848_add_license_name_to_licenses.php
@@ -9,9 +9,7 @@ class AddLicenseNameToLicenses extends Migration
*
* @return void
*/
- public function up()
- {
- }
+ public function up() {}
/**
* Reverse the migrations.
diff --git a/database/migrations/2013_11_16_040323_create_depreciations_table.php b/database/migrations/2013_11_16_040323_create_depreciations_table.php
index b35a04fee3..60117eaa45 100755
--- a/database/migrations/2013_11_16_040323_create_depreciations_table.php
+++ b/database/migrations/2013_11_16_040323_create_depreciations_table.php
@@ -18,7 +18,7 @@ class CreateDepreciationsTable extends Migration
$table->timestamps();
$table->integer('user_id')->nullable();
$table->engine = 'InnoDB';
- //$table->foreign('user_id')->references('id')->on('users');
+ // $table->foreign('user_id')->references('id')->on('users');
});
}
diff --git a/database/migrations/2013_11_16_103425_create_history_table.php b/database/migrations/2013_11_16_103425_create_history_table.php
index d3d84f3843..6c40feaf3e 100755
--- a/database/migrations/2013_11_16_103425_create_history_table.php
+++ b/database/migrations/2013_11_16_103425_create_history_table.php
@@ -28,6 +28,6 @@ class CreateHistoryTable extends Migration
*/
public function down()
{
- //Schema::drop('history');
+ // Schema::drop('history');
}
}
diff --git a/database/migrations/2013_11_17_054526_add_physical_to_assets.php b/database/migrations/2013_11_17_054526_add_physical_to_assets.php
index 28d1117201..a6ae23c8cd 100755
--- a/database/migrations/2013_11_17_054526_add_physical_to_assets.php
+++ b/database/migrations/2013_11_17_054526_add_physical_to_assets.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddPhysicalToAssets extends Migration
{
@@ -14,7 +13,7 @@ class AddPhysicalToAssets extends Migration
{
//
Schema::table('assets', function ($table) {
- //$table->boolean('physical')->default(1);
+ // $table->boolean('physical')->default(1);
$table->dropColumn('checkedout_to');
});
}
diff --git a/database/migrations/2013_11_18_164423_set_nullvalues_for_user.php b/database/migrations/2013_11_18_164423_set_nullvalues_for_user.php
index 6f52b47ee4..2c63cac983 100755
--- a/database/migrations/2013_11_18_164423_set_nullvalues_for_user.php
+++ b/database/migrations/2013_11_18_164423_set_nullvalues_for_user.php
@@ -13,8 +13,8 @@ class SetNullvaluesForUser extends Migration
{
//
// $prefix = DB::getTablePrefix();
- // DB::statement('ALTER TABLE '.$prefix.'users MODIFY phone varchar(20) null');
- // DB::statement('ALTER TABLE '.$prefix.'users MODIFY jobtitle varchar(50) null');
+ // DB::statement('ALTER TABLE '.$prefix.'users MODIFY phone varchar(20) null');
+ // DB::statement('ALTER TABLE '.$prefix.'users MODIFY jobtitle varchar(50) null');
}
/**
diff --git a/database/migrations/2013_11_22_213400_edits_to_settings_table.php b/database/migrations/2013_11_22_213400_edits_to_settings_table.php
index 942c82d3df..68e361ae34 100755
--- a/database/migrations/2013_11_22_213400_edits_to_settings_table.php
+++ b/database/migrations/2013_11_22_213400_edits_to_settings_table.php
@@ -13,7 +13,7 @@ class EditsToSettingsTable extends Migration
{
Schema::table('settings', function ($table) {
// $table->dropColumn('option_label');
- //$table->dropColumn('option_name');
+ // $table->dropColumn('option_name');
// $table->dropColumn('option_value');
$table->integer('per_page')->default(20);
$table->string('site_name', '100')->default('Snipe IT Asset Management');
diff --git a/database/migrations/2013_11_25_013244_recreate_licenses_table.php b/database/migrations/2013_11_25_013244_recreate_licenses_table.php
index a22349dcd6..658065096f 100755
--- a/database/migrations/2013_11_25_013244_recreate_licenses_table.php
+++ b/database/migrations/2013_11_25_013244_recreate_licenses_table.php
@@ -11,7 +11,7 @@ class ReCreateLicensesTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('licenses')) {
+ if (! Schema::hasTable('licenses')) {
Schema::create('licenses', function ($table) {
$table->increments('id');
$table->string('name');
diff --git a/database/migrations/2014_05_24_093839_alter_default_license_depreciation_id.php b/database/migrations/2014_05_24_093839_alter_default_license_depreciation_id.php
index d14195ff84..f5080f2b48 100755
--- a/database/migrations/2014_05_24_093839_alter_default_license_depreciation_id.php
+++ b/database/migrations/2014_05_24_093839_alter_default_license_depreciation_id.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AlterDefaultLicenseDepreciationId extends Migration
{
diff --git a/database/migrations/2014_05_27_231658_alter_default_values_licenses.php b/database/migrations/2014_05_27_231658_alter_default_values_licenses.php
index ba1219068b..a9cbe790b4 100755
--- a/database/migrations/2014_05_27_231658_alter_default_values_licenses.php
+++ b/database/migrations/2014_05_27_231658_alter_default_values_licenses.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AlterDefaultValuesLicenses extends Migration
{
diff --git a/database/migrations/2014_06_19_191508_add_asset_name_to_settings.php b/database/migrations/2014_06_19_191508_add_asset_name_to_settings.php
index bc336c7e87..f75f070ea1 100755
--- a/database/migrations/2014_06_19_191508_add_asset_name_to_settings.php
+++ b/database/migrations/2014_06_19_191508_add_asset_name_to_settings.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddAssetNameToSettings extends Migration
{
diff --git a/database/migrations/2014_06_20_004847_make_asset_log_checkedout_to_nullable.php b/database/migrations/2014_06_20_004847_make_asset_log_checkedout_to_nullable.php
index a430c41a8c..601e6d5645 100755
--- a/database/migrations/2014_06_20_004847_make_asset_log_checkedout_to_nullable.php
+++ b/database/migrations/2014_06_20_004847_make_asset_log_checkedout_to_nullable.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MakeAssetLogCheckedoutToNullable extends Migration
{
diff --git a/database/migrations/2014_06_20_005050_make_asset_log_purchasedate_to_nullable.php b/database/migrations/2014_06_20_005050_make_asset_log_purchasedate_to_nullable.php
index 4c28cb7536..e8a4638082 100755
--- a/database/migrations/2014_06_20_005050_make_asset_log_purchasedate_to_nullable.php
+++ b/database/migrations/2014_06_20_005050_make_asset_log_purchasedate_to_nullable.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MakeAssetLogPurchasedateToNullable extends Migration
{
diff --git a/database/migrations/2014_06_24_003011_add_suppliers.php b/database/migrations/2014_06_24_003011_add_suppliers.php
index 5fcc43a2b7..b95ce411b7 100755
--- a/database/migrations/2014_06_24_003011_add_suppliers.php
+++ b/database/migrations/2014_06_24_003011_add_suppliers.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddSuppliers extends Migration
{
diff --git a/database/migrations/2014_06_24_010742_add_supplier_id_to_asset.php b/database/migrations/2014_06_24_010742_add_supplier_id_to_asset.php
index 331e1739f2..2dc8f34e81 100755
--- a/database/migrations/2014_06_24_010742_add_supplier_id_to_asset.php
+++ b/database/migrations/2014_06_24_010742_add_supplier_id_to_asset.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddSupplierIdToAsset extends Migration
{
diff --git a/database/migrations/2014_06_24_012839_add_zip_to_supplier.php b/database/migrations/2014_06_24_012839_add_zip_to_supplier.php
index 5eb356257e..52bad5717c 100755
--- a/database/migrations/2014_06_24_012839_add_zip_to_supplier.php
+++ b/database/migrations/2014_06_24_012839_add_zip_to_supplier.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddZipToSupplier extends Migration
{
diff --git a/database/migrations/2014_06_24_033908_add_url_to_supplier.php b/database/migrations/2014_06_24_033908_add_url_to_supplier.php
index 9cb1bb198b..aec08794ab 100755
--- a/database/migrations/2014_06_24_033908_add_url_to_supplier.php
+++ b/database/migrations/2014_06_24_033908_add_url_to_supplier.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddUrlToSupplier extends Migration
{
diff --git a/database/migrations/2014_07_08_054116_add_employee_id_to_users.php b/database/migrations/2014_07_08_054116_add_employee_id_to_users.php
index fcf4336b54..ce1b243998 100755
--- a/database/migrations/2014_07_08_054116_add_employee_id_to_users.php
+++ b/database/migrations/2014_07_08_054116_add_employee_id_to_users.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddEmployeeIdToUsers extends Migration
{
diff --git a/database/migrations/2014_07_09_134316_add_requestable_to_assets.php b/database/migrations/2014_07_09_134316_add_requestable_to_assets.php
index a37939baaa..ebf962ee1d 100755
--- a/database/migrations/2014_07_09_134316_add_requestable_to_assets.php
+++ b/database/migrations/2014_07_09_134316_add_requestable_to_assets.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddRequestableToAssets extends Migration
{
diff --git a/database/migrations/2014_07_17_085822_add_asset_to_software.php b/database/migrations/2014_07_17_085822_add_asset_to_software.php
index e5e83cf882..56002785e0 100755
--- a/database/migrations/2014_07_17_085822_add_asset_to_software.php
+++ b/database/migrations/2014_07_17_085822_add_asset_to_software.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddAssetToSoftware extends Migration
{
diff --git a/database/migrations/2014_07_17_161625_make_asset_id_in_logs_nullable.php b/database/migrations/2014_07_17_161625_make_asset_id_in_logs_nullable.php
index 337f98e417..e7234b440d 100755
--- a/database/migrations/2014_07_17_161625_make_asset_id_in_logs_nullable.php
+++ b/database/migrations/2014_07_17_161625_make_asset_id_in_logs_nullable.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MakeAssetIdInLogsNullable extends Migration
{
diff --git a/database/migrations/2014_08_12_053504_alpha_0_4_2_release.php b/database/migrations/2014_08_12_053504_alpha_0_4_2_release.php
index 22ccb0c4bf..00d2a7227f 100755
--- a/database/migrations/2014_08_12_053504_alpha_0_4_2_release.php
+++ b/database/migrations/2014_08_12_053504_alpha_0_4_2_release.php
@@ -18,47 +18,47 @@ class Alpha042Release extends Migration
});
// DB::statement('UPDATE '.$prefix.'assets SET status_id="0" where status_id is null');
- // DB::statement('UPDATE '.$prefix.'assets SET purchase_cost=0 where purchase_cost is null');
- // DB::statement('UPDATE '.$prefix.'models SET eol=0 where eol is null');
- // DB::statement('UPDATE '.$prefix.'users SET location_id=0 where location_id is null');
- // DB::statement('UPDATE '.$prefix.'assets SET asset_tag=" " WHERE asset_tag is null');
- // DB::statement('UPDATE '.$prefix.'locations SET state=" " where state is null');
- // DB::statement('UPDATE '.$prefix.'models SET manufacturer_id="0" where manufacturer_id is null');
- // DB::statement('UPDATE '.$prefix.'models SET category_id="0" where category_id is null');
+ // DB::statement('UPDATE '.$prefix.'assets SET purchase_cost=0 where purchase_cost is null');
+ // DB::statement('UPDATE '.$prefix.'models SET eol=0 where eol is null');
+ // DB::statement('UPDATE '.$prefix.'users SET location_id=0 where location_id is null');
+ // DB::statement('UPDATE '.$prefix.'assets SET asset_tag=" " WHERE asset_tag is null');
+ // DB::statement('UPDATE '.$prefix.'locations SET state=" " where state is null');
+ // DB::statement('UPDATE '.$prefix.'models SET manufacturer_id="0" where manufacturer_id is null');
+ // DB::statement('UPDATE '.$prefix.'models SET category_id="0" where category_id is null');
- // DB::statement('ALTER TABLE '.$prefix.'assets '
- // . 'MODIFY COLUMN name VARCHAR(255) NULL , '
- // . 'MODIFY COLUMN asset_tag VARCHAR(255) NOT NULL , '
- // . 'MODIFY COLUMN purchase_cost DECIMAL(13,4) NOT NULL DEFAULT "0" , '
- // . 'MODIFY COLUMN order_number VARCHAR(255) NULL , '
- // . 'MODIFY COLUMN assigned_to INT(11) NULL , '
- // . 'MODIFY COLUMN notes TEXT NULL , '
- // . 'MODIFY COLUMN archived TINYINT(1) NOT NULL DEFAULT "0" , '
- // . 'MODIFY COLUMN depreciate TINYINT(1) NOT NULL DEFAULT "0"');
- //
- // DB::statement('ALTER TABLE '.$prefix.'licenses '
- // . 'MODIFY COLUMN purchase_cost DECIMAL(13,4) NULL , '
- // . 'MODIFY COLUMN depreciate TINYINT(1) NULL DEFAULT "0"');
- //
- // DB::statement('ALTER TABLE '.$prefix.'license_seats '
- // . 'MODIFY COLUMN assigned_to INT(11) NULL ');
- //
- // DB::statement('ALTER TABLE '.$prefix.'locations '
- // . 'MODIFY COLUMN state VARCHAR(255) NOT NULL ,'
- // . 'MODIFY COLUMN address2 VARCHAR(255) NULL ,'
- // . 'MODIFY COLUMN zip VARCHAR(10) NULL ');
- //
- // DB::statement('ALTER TABLE '.$prefix.'models '
- // . 'MODIFY COLUMN modelno VARCHAR(255) NULL , '
- // . 'MODIFY COLUMN manufacturer_id INT(11) NOT NULL , '
- // . 'MODIFY COLUMN category_id INT(11) NOT NULL , '
- // . 'MODIFY COLUMN depreciation_id INT(11) NOT NULL DEFAULT "0" , '
- // . 'MODIFY COLUMN eol INT(11) NULL DEFAULT "0"');
- //
- // DB::statement('ALTER TABLE '.$prefix.'users '
- // . 'MODIFY COLUMN first_name VARCHAR(255) NOT NULL , '
- // . 'MODIFY COLUMN last_name VARCHAR(255) NOT NULL , '
- // . 'MODIFY COLUMN location_id INT(11) NOT NULL');
+ // DB::statement('ALTER TABLE '.$prefix.'assets '
+ // . 'MODIFY COLUMN name VARCHAR(255) NULL , '
+ // . 'MODIFY COLUMN asset_tag VARCHAR(255) NOT NULL , '
+ // . 'MODIFY COLUMN purchase_cost DECIMAL(13,4) NOT NULL DEFAULT "0" , '
+ // . 'MODIFY COLUMN order_number VARCHAR(255) NULL , '
+ // . 'MODIFY COLUMN assigned_to INT(11) NULL , '
+ // . 'MODIFY COLUMN notes TEXT NULL , '
+ // . 'MODIFY COLUMN archived TINYINT(1) NOT NULL DEFAULT "0" , '
+ // . 'MODIFY COLUMN depreciate TINYINT(1) NOT NULL DEFAULT "0"');
+ //
+ // DB::statement('ALTER TABLE '.$prefix.'licenses '
+ // . 'MODIFY COLUMN purchase_cost DECIMAL(13,4) NULL , '
+ // . 'MODIFY COLUMN depreciate TINYINT(1) NULL DEFAULT "0"');
+ //
+ // DB::statement('ALTER TABLE '.$prefix.'license_seats '
+ // . 'MODIFY COLUMN assigned_to INT(11) NULL ');
+ //
+ // DB::statement('ALTER TABLE '.$prefix.'locations '
+ // . 'MODIFY COLUMN state VARCHAR(255) NOT NULL ,'
+ // . 'MODIFY COLUMN address2 VARCHAR(255) NULL ,'
+ // . 'MODIFY COLUMN zip VARCHAR(10) NULL ');
+ //
+ // DB::statement('ALTER TABLE '.$prefix.'models '
+ // . 'MODIFY COLUMN modelno VARCHAR(255) NULL , '
+ // . 'MODIFY COLUMN manufacturer_id INT(11) NOT NULL , '
+ // . 'MODIFY COLUMN category_id INT(11) NOT NULL , '
+ // . 'MODIFY COLUMN depreciation_id INT(11) NOT NULL DEFAULT "0" , '
+ // . 'MODIFY COLUMN eol INT(11) NULL DEFAULT "0"');
+ //
+ // DB::statement('ALTER TABLE '.$prefix.'users '
+ // . 'MODIFY COLUMN first_name VARCHAR(255) NOT NULL , '
+ // . 'MODIFY COLUMN last_name VARCHAR(255) NOT NULL , '
+ // . 'MODIFY COLUMN location_id INT(11) NOT NULL');
}
/**
diff --git a/database/migrations/2014_08_17_083523_make_location_id_nullable.php b/database/migrations/2014_08_17_083523_make_location_id_nullable.php
index fdfadc4814..7f1d57d387 100644
--- a/database/migrations/2014_08_17_083523_make_location_id_nullable.php
+++ b/database/migrations/2014_08_17_083523_make_location_id_nullable.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MakeLocationIdNullable extends Migration
{
diff --git a/database/migrations/2014_10_16_200626_add_rtd_location_to_assets.php b/database/migrations/2014_10_16_200626_add_rtd_location_to_assets.php
index 99578b1834..62da866836 100644
--- a/database/migrations/2014_10_16_200626_add_rtd_location_to_assets.php
+++ b/database/migrations/2014_10_16_200626_add_rtd_location_to_assets.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddRtdLocationToAssets extends Migration
{
diff --git a/database/migrations/2014_10_24_000417_alter_supplier_state_to_32.php b/database/migrations/2014_10_24_000417_alter_supplier_state_to_32.php
index da1fdaa518..d4afb43ca1 100644
--- a/database/migrations/2014_10_24_000417_alter_supplier_state_to_32.php
+++ b/database/migrations/2014_10_24_000417_alter_supplier_state_to_32.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AlterSupplierStateTo32 extends Migration
{
diff --git a/database/migrations/2014_10_24_015641_add_display_checkout_date.php b/database/migrations/2014_10_24_015641_add_display_checkout_date.php
index 633521a211..5f6411884b 100644
--- a/database/migrations/2014_10_24_015641_add_display_checkout_date.php
+++ b/database/migrations/2014_10_24_015641_add_display_checkout_date.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddDisplayCheckoutDate extends Migration
{
diff --git a/database/migrations/2014_11_01_214955_add_eol_display_to_settings.php b/database/migrations/2014_11_01_214955_add_eol_display_to_settings.php
index 82d69e12ba..b7c7dd9467 100644
--- a/database/migrations/2014_11_01_214955_add_eol_display_to_settings.php
+++ b/database/migrations/2014_11_01_214955_add_eol_display_to_settings.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddEolDisplayToSettings extends Migration
{
diff --git a/database/migrations/2014_11_04_231416_update_group_field_for_reporting.php b/database/migrations/2014_11_04_231416_update_group_field_for_reporting.php
index 26ce84e866..9e43278e9a 100644
--- a/database/migrations/2014_11_04_231416_update_group_field_for_reporting.php
+++ b/database/migrations/2014_11_04_231416_update_group_field_for_reporting.php
@@ -2,7 +2,6 @@
use App\Models\Group;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class UpdateGroupFieldForReporting extends Migration
{
diff --git a/database/migrations/2014_11_05_212408_add_fields_to_licenses.php b/database/migrations/2014_11_05_212408_add_fields_to_licenses.php
index f8909764e0..a79bf77868 100644
--- a/database/migrations/2014_11_05_212408_add_fields_to_licenses.php
+++ b/database/migrations/2014_11_05_212408_add_fields_to_licenses.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddFieldsToLicenses extends Migration
{
diff --git a/database/migrations/2014_11_21_104401_change_licence_type.php b/database/migrations/2014_11_21_104401_change_licence_type.php
index 97701d0b0f..5fe3106c88 100644
--- a/database/migrations/2014_11_21_104401_change_licence_type.php
+++ b/database/migrations/2014_11_21_104401_change_licence_type.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class ChangeLicenceType extends Migration
{
diff --git a/database/migrations/2014_12_09_082500_add_fields_maintained_term_to_licenses.php b/database/migrations/2014_12_09_082500_add_fields_maintained_term_to_licenses.php
index 231c2d3560..cf8b6616d5 100644
--- a/database/migrations/2014_12_09_082500_add_fields_maintained_term_to_licenses.php
+++ b/database/migrations/2014_12_09_082500_add_fields_maintained_term_to_licenses.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddFieldsMaintainedTermToLicenses extends Migration
{
diff --git a/database/migrations/2015_02_04_155757_increase_user_field_lengths.php b/database/migrations/2015_02_04_155757_increase_user_field_lengths.php
index 493e07ee41..e20041fdd6 100644
--- a/database/migrations/2015_02_04_155757_increase_user_field_lengths.php
+++ b/database/migrations/2015_02_04_155757_increase_user_field_lengths.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class IncreaseUserFieldLengths extends Migration
{
diff --git a/database/migrations/2015_02_07_013537_add_soft_deleted_to_log.php b/database/migrations/2015_02_07_013537_add_soft_deleted_to_log.php
index 160e680761..de40fff3f6 100644
--- a/database/migrations/2015_02_07_013537_add_soft_deleted_to_log.php
+++ b/database/migrations/2015_02_07_013537_add_soft_deleted_to_log.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddSoftDeletedToLog extends Migration
{
@@ -12,8 +11,8 @@ class AddSoftDeletedToLog extends Migration
*/
public function up()
{
- //$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
- //$platform->registerDoctrineTypeMapping('enum', 'string');
+ // $platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
+ // $platform->registerDoctrineTypeMapping('enum', 'string');
Schema::table('asset_logs', function ($table) {
$table->string('asset_type', 100)->nullable()->change();
@@ -24,7 +23,7 @@ class AddSoftDeletedToLog extends Migration
// Schema::table('asset_logs', function ($table) {
// $table->renameColumn('added_on', 'created_at');
// $table->timestamp('updated_at');
- // $table->softDeletes();
+ // $table->softDeletes();
// });
}
diff --git a/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php b/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php
index 36ba8f8caa..151ba26979 100644
--- a/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php
+++ b/database/migrations/2015_02_10_040958_fix_bad_assigned_to_ids.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class FixBadAssignedToIds extends Migration
{
diff --git a/database/migrations/2015_02_10_053310_migrate_data_to_new_statuses.php b/database/migrations/2015_02_10_053310_migrate_data_to_new_statuses.php
index 50dacc1f7a..f133bf37f3 100644
--- a/database/migrations/2015_02_10_053310_migrate_data_to_new_statuses.php
+++ b/database/migrations/2015_02_10_053310_migrate_data_to_new_statuses.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MigrateDataToNewStatuses extends Migration
{
@@ -34,7 +33,7 @@ class MigrateDataToNewStatuses extends Migration
$rtds = DB::table('assets')->where('status_id', 0)->where('physical', '1')->get();
foreach ($rtds as $rtd) {
- //DB::update('update users set votes = 100 where name = ?', array('John'));
+ // DB::update('update users set votes = 100 where name = ?', array('John'));
DB::update('update '.DB::getTablePrefix().'assets set status_id = ? where status_id = 0 AND physical=1', $rtd_id);
}
}
diff --git a/database/migrations/2015_02_11_044104_migrate_make_license_assigned_null.php b/database/migrations/2015_02_11_044104_migrate_make_license_assigned_null.php
index e3586b7763..faace99e22 100644
--- a/database/migrations/2015_02_11_044104_migrate_make_license_assigned_null.php
+++ b/database/migrations/2015_02_11_044104_migrate_make_license_assigned_null.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MigrateMakeLicenseAssignedNull extends Migration
{
diff --git a/database/migrations/2015_02_11_104406_migrate_create_requests_table.php b/database/migrations/2015_02_11_104406_migrate_create_requests_table.php
index 1bd04fff1f..2b76804e34 100644
--- a/database/migrations/2015_02_11_104406_migrate_create_requests_table.php
+++ b/database/migrations/2015_02_11_104406_migrate_create_requests_table.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MigrateCreateRequestsTable extends Migration
{
diff --git a/database/migrations/2015_02_12_001312_add_mac_address_to_asset.php b/database/migrations/2015_02_12_001312_add_mac_address_to_asset.php
index 8f0bf1385a..320a37e09b 100644
--- a/database/migrations/2015_02_12_001312_add_mac_address_to_asset.php
+++ b/database/migrations/2015_02_12_001312_add_mac_address_to_asset.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddMacAddressToAsset extends Migration
{
diff --git a/database/migrations/2015_02_12_024100_change_license_notes_type.php b/database/migrations/2015_02_12_024100_change_license_notes_type.php
index 7389dc8087..34fd0e5ad4 100644
--- a/database/migrations/2015_02_12_024100_change_license_notes_type.php
+++ b/database/migrations/2015_02_12_024100_change_license_notes_type.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class ChangeLicenseNotesType extends Migration
{
@@ -23,7 +22,5 @@ class ChangeLicenseNotesType extends Migration
*
* @return void
*/
- public function down()
- {
- }
+ public function down() {}
}
diff --git a/database/migrations/2015_02_17_231020_add_localonly_to_settings.php b/database/migrations/2015_02_17_231020_add_localonly_to_settings.php
index 5c5b0eeb95..2d00725c1c 100644
--- a/database/migrations/2015_02_17_231020_add_localonly_to_settings.php
+++ b/database/migrations/2015_02_17_231020_add_localonly_to_settings.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddLocalonlyToSettings extends Migration
{
diff --git a/database/migrations/2015_02_19_222322_add_logo_and_colors_to_settings.php b/database/migrations/2015_02_19_222322_add_logo_and_colors_to_settings.php
index cb2d7ac983..63b982bc15 100644
--- a/database/migrations/2015_02_19_222322_add_logo_and_colors_to_settings.php
+++ b/database/migrations/2015_02_19_222322_add_logo_and_colors_to_settings.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddLogoAndColorsToSettings extends Migration
{
diff --git a/database/migrations/2015_02_24_072043_add_alerts_to_settings.php b/database/migrations/2015_02_24_072043_add_alerts_to_settings.php
index d7119ab4cd..638e2e0ab8 100644
--- a/database/migrations/2015_02_24_072043_add_alerts_to_settings.php
+++ b/database/migrations/2015_02_24_072043_add_alerts_to_settings.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddAlertsToSettings extends Migration
{
diff --git a/database/migrations/2015_02_25_022931_add_eula_fields.php b/database/migrations/2015_02_25_022931_add_eula_fields.php
index 90c249dd49..cd470aa1a0 100644
--- a/database/migrations/2015_02_25_022931_add_eula_fields.php
+++ b/database/migrations/2015_02_25_022931_add_eula_fields.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddEulaFields extends Migration
{
diff --git a/database/migrations/2015_02_25_204513_add_accessories_table.php b/database/migrations/2015_02_25_204513_add_accessories_table.php
index 49d95d721f..30bc01a6c4 100644
--- a/database/migrations/2015_02_25_204513_add_accessories_table.php
+++ b/database/migrations/2015_02_25_204513_add_accessories_table.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddAccessoriesTable extends Migration
{
diff --git a/database/migrations/2015_02_26_091228_add_accessories_user_table.php b/database/migrations/2015_02_26_091228_add_accessories_user_table.php
index 38e1ac5b52..bf928a1952 100644
--- a/database/migrations/2015_02_26_091228_add_accessories_user_table.php
+++ b/database/migrations/2015_02_26_091228_add_accessories_user_table.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddAccessoriesUserTable extends Migration
{
diff --git a/database/migrations/2015_02_26_115128_add_deleted_at_models.php b/database/migrations/2015_02_26_115128_add_deleted_at_models.php
index 28f42d2366..e2773c32b4 100644
--- a/database/migrations/2015_02_26_115128_add_deleted_at_models.php
+++ b/database/migrations/2015_02_26_115128_add_deleted_at_models.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddDeletedAtModels extends Migration
{
diff --git a/database/migrations/2015_02_26_233005_add_category_type.php b/database/migrations/2015_02_26_233005_add_category_type.php
index 8f41f6fda9..67b24fa8ca 100644
--- a/database/migrations/2015_02_26_233005_add_category_type.php
+++ b/database/migrations/2015_02_26_233005_add_category_type.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddCategoryType extends Migration
{
diff --git a/database/migrations/2015_03_01_231912_update_accepted_at_to_acceptance_id.php b/database/migrations/2015_03_01_231912_update_accepted_at_to_acceptance_id.php
index 9cae90a791..91736c2ad6 100644
--- a/database/migrations/2015_03_01_231912_update_accepted_at_to_acceptance_id.php
+++ b/database/migrations/2015_03_01_231912_update_accepted_at_to_acceptance_id.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class UpdateAcceptedAtToAcceptanceId extends Migration
{
diff --git a/database/migrations/2015_03_05_011929_add_qr_type_to_settings.php b/database/migrations/2015_03_05_011929_add_qr_type_to_settings.php
index e85d79bd97..b2f5c5a1fd 100644
--- a/database/migrations/2015_03_05_011929_add_qr_type_to_settings.php
+++ b/database/migrations/2015_03_05_011929_add_qr_type_to_settings.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddQrTypeToSettings extends Migration
{
diff --git a/database/migrations/2015_03_18_055327_add_note_to_user.php b/database/migrations/2015_03_18_055327_add_note_to_user.php
index 191d34c572..bcab10ade3 100644
--- a/database/migrations/2015_03_18_055327_add_note_to_user.php
+++ b/database/migrations/2015_03_18_055327_add_note_to_user.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddNoteToUser extends Migration
{
diff --git a/database/migrations/2015_06_10_003314_fix_default_for_user_notes.php b/database/migrations/2015_06_10_003314_fix_default_for_user_notes.php
index 6fb202c443..6486a13be6 100644
--- a/database/migrations/2015_06_10_003314_fix_default_for_user_notes.php
+++ b/database/migrations/2015_06_10_003314_fix_default_for_user_notes.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class FixDefaultForUserNotes extends Migration
{
diff --git a/database/migrations/2015_06_10_003554_create_consumables.php b/database/migrations/2015_06_10_003554_create_consumables.php
index 2b2a5c4fe4..9f8df034f6 100644
--- a/database/migrations/2015_06_10_003554_create_consumables.php
+++ b/database/migrations/2015_06_10_003554_create_consumables.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class CreateConsumables extends Migration
{
diff --git a/database/migrations/2015_06_15_183253_move_email_to_username.php b/database/migrations/2015_06_15_183253_move_email_to_username.php
index 8506bd4d16..bf9040b1fd 100644
--- a/database/migrations/2015_06_15_183253_move_email_to_username.php
+++ b/database/migrations/2015_06_15_183253_move_email_to_username.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MoveEmailToUsername extends Migration
{
@@ -24,6 +23,6 @@ class MoveEmailToUsername extends Migration
public function down()
{
//
- //DB::statement('ALTER TABLE `users` MODIFY `notes` varchar(255);');
+ // DB::statement('ALTER TABLE `users` MODIFY `notes` varchar(255);');
}
}
diff --git a/database/migrations/2015_06_26_213716_create_asset_maintenances_table.php b/database/migrations/2015_06_26_213716_create_asset_maintenances_table.php
index 6838dde854..4c0de96e51 100644
--- a/database/migrations/2015_06_26_213716_create_asset_maintenances_table.php
+++ b/database/migrations/2015_06_26_213716_create_asset_maintenances_table.php
@@ -1,58 +1,58 @@
<?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
- class CreateAssetMaintenancesTable extends Migration
+class CreateAssetMaintenancesTable extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
{
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('asset_maintenances', function (Blueprint $table) {
- $table->increments('id');
- $table->integer('asset_id')
- ->unsigned();
- $table->integer('supplier_id')
- ->unsigned();
- $table->string('asset_maintenance_type');
- $table->string('title', 100);
- $table->boolean('is_warranty');
- $table->date('start_date');
- $table->date('completion_date')
- ->nullable();
- $table->integer('asset_maintenance_time')
- ->nullable();
- $table->longText('notes')
- ->nullable();
- $table->decimal('cost', 10, 2)
- ->nullable();
- $table->dateTime('deleted_at')
- ->nullable();
- $table->timestamps();
- });
- }
+ Schema::create('asset_maintenances', function (Blueprint $table) {
+ $table->increments('id');
+ $table->integer('asset_id')
+ ->unsigned();
+ $table->integer('supplier_id')
+ ->unsigned();
+ $table->string('asset_maintenance_type');
+ $table->string('title', 100);
+ $table->boolean('is_warranty');
+ $table->date('start_date');
+ $table->date('completion_date')
+ ->nullable();
+ $table->integer('asset_maintenance_time')
+ ->nullable();
+ $table->longText('notes')
+ ->nullable();
+ $table->decimal('cost', 10, 2)
+ ->nullable();
+ $table->dateTime('deleted_at')
+ ->nullable();
+ $table->timestamps();
+ });
+ }
- protected function getEnumFields()
- {
- return [
- trans('admin/maintenances/general.maintenance'),
- trans('admin/maintenances/general.repair'),
- trans('admin/maintenances/general.upgrade'),
- ];
- }
+ protected function getEnumFields()
+ {
+ return [
+ trans('admin/maintenances/general.maintenance'),
+ trans('admin/maintenances/general.repair'),
+ trans('admin/maintenances/general.upgrade'),
+ ];
+ }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('asset_maintenances');
- }
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('asset_maintenances');
}
+}
diff --git a/database/migrations/2015_07_04_212443_create_custom_fields_table.php b/database/migrations/2015_07_04_212443_create_custom_fields_table.php
index 3e3319c635..5a2f417290 100644
--- a/database/migrations/2015_07_04_212443_create_custom_fields_table.php
+++ b/database/migrations/2015_07_04_212443_create_custom_fields_table.php
@@ -1,6 +1,6 @@
<?php
-//use Illuminate\Database\Schema\Blueprint;
+// use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCustomFieldsTable extends Migration
diff --git a/database/migrations/2015_07_24_093845_add_checkin_email_to_category_table.php b/database/migrations/2015_07_24_093845_add_checkin_email_to_category_table.php
index 00e6aaa3d1..c296ef6854 100644
--- a/database/migrations/2015_07_24_093845_add_checkin_email_to_category_table.php
+++ b/database/migrations/2015_07_24_093845_add_checkin_email_to_category_table.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddCheckinEmailToCategoryTable extends Migration
{
diff --git a/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php b/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php
index f14dc078cc..17ad6e3b0f 100644
--- a/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php
+++ b/database/migrations/2015_07_29_230054_add_thread_id_to_asset_logs_table.php
@@ -1,203 +1,208 @@
<?php
- use App\Models\Actionlog;
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
+use App\Models\Actionlog;
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class AddThreadIdToAssetLogsTable extends Migration
+{
+ /**
+ * currentAssetId
+ *
+ * @var int
+ */
+ protected $currentAssetId = null;
+
+ /**
+ * currentAssetLogId
+ *
+ * @var int
+ */
+ protected $currentAssetLogId = null;
+
+ /**
+ * assetLogs
+ *
+ * @var array
+ */
+ protected $assetLogs = null;
+
+ /**
+ * startOfCurrentThread
+ *
+ * @var bool
+ */
+ protected $startOfCurrentThread = true;
+
+ /**
+ * threadStartingActionTypes
+ *
+ * @var array
+ */
+ protected $threadStartingActionTypes = ['checkout', 'requested'];
+
+ /**
+ * threadFinalActionTypes
+ *
+ * @var array
+ */
+ protected $threadFinalActionTypes = ['checkin from'];
+
+ /**
+ * actionlog
+ *
+ * @var \Actionlog
+ */
+ private $actionlog;
+
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+
+ // if (!Schema::hasColumn('asset_logs', 'thread_id')) {
+
+ // Schema::table( 'asset_logs', function ( Blueprint $table ) {
+
+ // $table->integer( 'thread_id' )
+ // ->nullable()
+ // ->default( null );
+ // $table->index( 'thread_id' );
+ // } );
+ // }
+
+ // $this->actionlog = new App\Models\Actionlog();
+ // $this->assetLogs = $this->actionlog->getListingOfActionLogsChronologicalOrder();
+
+ // foreach ($this->assetLogs as $assetLog) {
+
+ // if ($this->hasAssetChanged( $assetLog )) {
+ // $this->resetCurrentAssetInformation( $assetLog );
+ // }
+
+ // if ($this->hasBegunNewChain( $assetLog )) {
+ // $this->startOfCurrentThread = false;
+ // continue;
+ // }
+
+ // $this->updateAssetLogWithThreadInformation( $assetLog );
+
+ // if ($this->hasReachedEndOfChain( $assetLog )
+ // ) {
+ // $this->clearCurrentAssetInformation();
+ // }
+
+ // }
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ // Schema::table('asset_logs', function (Blueprint $table) {
+ // $table->dropIndex('thread_id');
+ // $table->dropColumn('thread_id');
+ // });
+ }
+
+ /**
+ * hasAssetChanged
+ *
+ *
+ * @return bool
+ *
+ * @author Vincent Sposato <[email protected]>
+ *
+ * @version v1.0
+ */
+ protected function hasAssetChanged($assetLog)
+ {
+ return $assetLog->asset_id !== $this->currentAssetId;
+ }
+
+ /**
+ * resetCurrentAssetInformation
+ *
+ *
+ * @author Vincent Sposato <[email protected]>
+ *
+ * @version v1.0
+ */
+ protected function resetCurrentAssetInformation($assetLog)
+ {
+ $this->currentAssetId = $assetLog->asset_id;
+ $this->currentAssetLogId = $assetLog->id;
+ $this->startOfCurrentThread = true;
+ }
+
+ /**
+ * hasReachedEndOfChain
+ *
+ *
+ * @return bool
+ *
+ * @author Vincent Sposato <[email protected]>
+ *
+ * @version v1.0
+ */
+ protected function hasReachedEndOfChain($assetLog)
+ {
+ return in_array($assetLog->action_type, $this->threadFinalActionTypes)
+ && $this->startOfCurrentThread == false;
+ }
+
+ /**
+ * clearCurrentAssetInformation
+ *
+ * @author Vincent Sposato <[email protected]>
+ *
+ * @version v1.0
+ */
+ protected function clearCurrentAssetInformation()
+ {
+ $this->startOfCurrentThread = true;
+ $this->currentAssetLogId = null;
+ $this->currentAssetId = null;
+ }
+
+ /**
+ * updateAssetLogWithThreadInformation
+ *
+ *
+ * @author Vincent Sposato <[email protected]>
+ *
+ * @version v1.0
+ */
+ protected function updateAssetLogWithThreadInformation($assetLog)
+ {
+ $loadedAssetLog = Actionlog::find($assetLog->id);
+
+ $loadedAssetLog->thread_id = $this->currentAssetLogId;
+
+ $loadedAssetLog->update();
+
+ unset($loadedAssetLog);
+ }
- class AddThreadIdToAssetLogsTable extends Migration
+ /**
+ * hasBegunNewChain
+ *
+ *
+ * @return bool
+ *
+ * @author Vincent Sposato <[email protected]>
+ *
+ * @version v1.0
+ */
+ protected function hasBegunNewChain($assetLog)
{
- /**
- * currentAssetId
- *
- * @var int
- */
- protected $currentAssetId = null;
-
- /**
- * currentAssetLogId
- *
- * @var int
- */
- protected $currentAssetLogId = null;
-
- /**
- * assetLogs
- *
- * @var array
- */
- protected $assetLogs = null;
-
- /**
- * startOfCurrentThread
- *
- * @var bool
- */
- protected $startOfCurrentThread = true;
-
- /**
- * threadStartingActionTypes
- *
- * @var array
- */
- protected $threadStartingActionTypes = ['checkout', 'requested'];
-
- /**
- * threadFinalActionTypes
- *
- * @var array
- */
- protected $threadFinalActionTypes = ['checkin from'];
-
- /**
- * actionlog
- *
- * @var \Actionlog
- */
- private $actionlog;
-
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
-
- // if (!Schema::hasColumn('asset_logs', 'thread_id')) {
-
- // Schema::table( 'asset_logs', function ( Blueprint $table ) {
-
- // $table->integer( 'thread_id' )
- // ->nullable()
- // ->default( null );
- // $table->index( 'thread_id' );
- // } );
- // }
-
- // $this->actionlog = new App\Models\Actionlog();
- // $this->assetLogs = $this->actionlog->getListingOfActionLogsChronologicalOrder();
-
- // foreach ($this->assetLogs as $assetLog) {
-
- // if ($this->hasAssetChanged( $assetLog )) {
- // $this->resetCurrentAssetInformation( $assetLog );
- // }
-
- // if ($this->hasBegunNewChain( $assetLog )) {
- // $this->startOfCurrentThread = false;
- // continue;
- // }
-
- // $this->updateAssetLogWithThreadInformation( $assetLog );
-
- // if ($this->hasReachedEndOfChain( $assetLog )
- // ) {
- // $this->clearCurrentAssetInformation();
- // }
-
- // }
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- // Schema::table('asset_logs', function (Blueprint $table) {
- // $table->dropIndex('thread_id');
- // $table->dropColumn('thread_id');
- // });
- }
-
- /**
- * hasAssetChanged
- *
- * @param $assetLog
- *
- * @return bool
- * @author Vincent Sposato <[email protected]>
- * @version v1.0
- */
- protected function hasAssetChanged($assetLog)
- {
- return $assetLog->asset_id !== $this->currentAssetId;
- }
-
- /**
- * resetCurrentAssetInformation
- *
- * @param $assetLog
- *
- * @author Vincent Sposato <[email protected]>
- * @version v1.0
- */
- protected function resetCurrentAssetInformation($assetLog)
- {
- $this->currentAssetId = $assetLog->asset_id;
- $this->currentAssetLogId = $assetLog->id;
- $this->startOfCurrentThread = true;
- }
-
- /**
- * hasReachedEndOfChain
- *
- * @param $assetLog
- *
- * @return bool
- * @author Vincent Sposato <[email protected]>
- * @version v1.0
- */
- protected function hasReachedEndOfChain($assetLog)
- {
- return in_array($assetLog->action_type, $this->threadFinalActionTypes)
- && $this->startOfCurrentThread == false;
- }
-
- /**
- * clearCurrentAssetInformation
- * @author Vincent Sposato <[email protected]>
- * @version v1.0
- */
- protected function clearCurrentAssetInformation()
- {
- $this->startOfCurrentThread = true;
- $this->currentAssetLogId = null;
- $this->currentAssetId = null;
- }
-
- /**
- * updateAssetLogWithThreadInformation
- *
- * @param $assetLog
- *
- * @author Vincent Sposato <[email protected]>
- * @version v1.0
- */
- protected function updateAssetLogWithThreadInformation($assetLog)
- {
- $loadedAssetLog = Actionlog::find($assetLog->id);
-
- $loadedAssetLog->thread_id = $this->currentAssetLogId;
-
- $loadedAssetLog->update();
-
- unset($loadedAssetLog);
- }
-
- /**
- * hasBegunNewChain
- *
- * @param $assetLog
- *
- * @return bool
- * @author Vincent Sposato <[email protected]>
- * @version v1.0
- */
- protected function hasBegunNewChain($assetLog)
- {
- return in_array($assetLog->action_type, $this->threadStartingActionTypes)
- && $this->startOfCurrentThread == true;
- }
+ return in_array($assetLog->action_type, $this->threadStartingActionTypes)
+ && $this->startOfCurrentThread == true;
}
+}
diff --git a/database/migrations/2015_09_21_235926_create_custom_field_custom_fieldset.php b/database/migrations/2015_09_21_235926_create_custom_field_custom_fieldset.php
index c093a4aeb5..ff6c423b34 100644
--- a/database/migrations/2015_09_21_235926_create_custom_field_custom_fieldset.php
+++ b/database/migrations/2015_09_21_235926_create_custom_field_custom_fieldset.php
@@ -1,7 +1,7 @@
<?php
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
class CreateCustomFieldCustomFieldset extends Migration
{
diff --git a/database/migrations/2015_09_22_003413_migrate_mac_address.php b/database/migrations/2015_09_22_003413_migrate_mac_address.php
index 4c65c29736..494a230f8c 100644
--- a/database/migrations/2015_09_22_003413_migrate_mac_address.php
+++ b/database/migrations/2015_09_22_003413_migrate_mac_address.php
@@ -1,5 +1,8 @@
<?php
+use App\Models\AssetModel;
+use App\Models\CustomField;
+use App\Models\CustomFieldset;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
@@ -12,23 +15,23 @@ class MigrateMacAddress extends Migration
*/
public function up()
{
- //DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
+ // DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
- $f2 = new \App\Models\CustomFieldset(['name' => 'Asset with MAC Address']);
- $f2->timestamps = false; //when this model was first created, it had no timestamps. But later on it gets them.
+ $f2 = new CustomFieldset(['name' => 'Asset with MAC Address']);
+ $f2->timestamps = false; // when this model was first created, it had no timestamps. But later on it gets them.
if (! $f2->save()) {
throw new Exception("couldn't save customfieldset");
}
$macid = DB::table('custom_fields')->insertGetId([
'name' => 'MAC Address',
- 'format' => \App\Models\CustomField::PREDEFINED_FORMATS['MAC'],
- 'element'=>'text', ]);
+ 'format' => CustomField::PREDEFINED_FORMATS['MAC'],
+ 'element' => 'text', ]);
if (! $macid) {
throw new Exception("Can't save MAC Custom field: $macid");
}
$f2->fields()->attach($macid, ['required' => false, 'order' => 1]);
- \App\Models\AssetModel::where(['show_mac_address' => true])->update(['fieldset_id'=>$f2->id]);
+ AssetModel::where(['show_mac_address' => true])->update(['fieldset_id' => $f2->id]);
Schema::table('assets', function (Blueprint $table) {
$table->renameColumn('mac_address', '_snipeit_mac_address');
@@ -48,7 +51,7 @@ class MigrateMacAddress extends Migration
*/
public function down()
{
- $f = \App\Models\CustomFieldset::where(['name' => 'Asset with MAC Address'])->first();
+ $f = CustomFieldset::where(['name' => 'Asset with MAC Address'])->first();
if ($f) {
$f->fields()->delete();
diff --git a/database/migrations/2015_10_01_024551_add_accessory_consumable_price_info.php b/database/migrations/2015_10_01_024551_add_accessory_consumable_price_info.php
index e9192fd56e..c0cf95a96a 100644
--- a/database/migrations/2015_10_01_024551_add_accessory_consumable_price_info.php
+++ b/database/migrations/2015_10_01_024551_add_accessory_consumable_price_info.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddAccessoryConsumablePriceInfo extends Migration
{
diff --git a/database/migrations/2015_10_22_003314_fix_defaults_accessories.php b/database/migrations/2015_10_22_003314_fix_defaults_accessories.php
index da7dcfbabe..155849508a 100644
--- a/database/migrations/2015_10_22_003314_fix_defaults_accessories.php
+++ b/database/migrations/2015_10_22_003314_fix_defaults_accessories.php
@@ -22,7 +22,7 @@ class FixDefaultsAccessories extends Migration
//
// DB::statement('ALTER TABLE `'.DB::getTablePrefix().'accessories` MODIFY `order_number` varchar(255) DEFAULT NULL;');
- //
+ //
// DB::statement('ALTER TABLE `'.DB::getTablePrefix().'consumables` MODIFY `order_number` varchar(255) DEFAULT NULL;');
}
diff --git a/database/migrations/2015_11_05_061115_add_company_id_to_consumables_table.php b/database/migrations/2015_11_05_061115_add_company_id_to_consumables_table.php
index afcb9e1c0f..bac88e3af4 100644
--- a/database/migrations/2015_11_05_061115_add_company_id_to_consumables_table.php
+++ b/database/migrations/2015_11_05_061115_add_company_id_to_consumables_table.php
@@ -14,7 +14,7 @@ class AddCompanyIdToConsumablesTable extends Migration
{
Schema::table('consumables', function (Blueprint $table) {
$table->integer('company_id')->unsigned()->nullable();
- //$table->foreign('company_id')->references('id')->on('companies');
+ // $table->foreign('company_id')->references('id')->on('companies');
});
}
@@ -26,7 +26,7 @@ class AddCompanyIdToConsumablesTable extends Migration
public function down()
{
Schema::table('consumables', function (Blueprint $table) {
- //$table->dropForeign('consumables_company_id_foreign');
+ // $table->dropForeign('consumables_company_id_foreign');
$table->dropColumn('company_id');
});
}
diff --git a/database/migrations/2015_11_05_183749_add_image_to_assets.php b/database/migrations/2015_11_05_183749_add_image_to_assets.php
index 598f71aa5b..e088bede16 100644
--- a/database/migrations/2015_11_05_183749_add_image_to_assets.php
+++ b/database/migrations/2015_11_05_183749_add_image_to_assets.php
@@ -24,7 +24,7 @@ class AddImageToAssets extends Migration
* field already exists. Thanks, I hate it. - snipe
*/
Schema::table('assets', function (Blueprint $table) {
- if (!Schema::hasColumn('assets', 'image')) {
+ if (! Schema::hasColumn('assets', 'image')) {
$table->text('image')->after('notes')->nullable()->default(null);
}
});
@@ -38,8 +38,8 @@ class AddImageToAssets extends Migration
public function down()
{
- /**
- * I'm leaving this one out, since it could destroy data that was already long-existing.
- */
+ /**
+ * I'm leaving this one out, since it could destroy data that was already long-existing.
+ */
}
}
diff --git a/database/migrations/2015_11_06_092038_add_company_id_to_accessories_table.php b/database/migrations/2015_11_06_092038_add_company_id_to_accessories_table.php
index e51cb797ef..af1973c2ad 100644
--- a/database/migrations/2015_11_06_092038_add_company_id_to_accessories_table.php
+++ b/database/migrations/2015_11_06_092038_add_company_id_to_accessories_table.php
@@ -14,7 +14,7 @@ class AddCompanyIdToAccessoriesTable extends Migration
{
Schema::table('accessories', function (Blueprint $table) {
$table->integer('company_id')->unsigned()->nullable();
- //$table->foreign('company_id')->references('id')->on('companies');
+ // $table->foreign('company_id')->references('id')->on('companies');
});
}
@@ -26,7 +26,7 @@ class AddCompanyIdToAccessoriesTable extends Migration
public function down()
{
Schema::table('accessories', function (Blueprint $table) {
- //$table->dropForeign('accessories_company_id_foreign');
+ // $table->dropForeign('accessories_company_id_foreign');
$table->dropColumn('company_id');
});
}
diff --git a/database/migrations/2015_11_06_100045_add_company_id_to_users_table.php b/database/migrations/2015_11_06_100045_add_company_id_to_users_table.php
index 37e8ce12ee..c0f3113d09 100644
--- a/database/migrations/2015_11_06_100045_add_company_id_to_users_table.php
+++ b/database/migrations/2015_11_06_100045_add_company_id_to_users_table.php
@@ -14,7 +14,7 @@ class AddCompanyIdToUsersTable extends Migration
{
Schema::table('users', function (Blueprint $table) {
$table->integer('company_id')->unsigned()->nullable();
- //$table->foreign('company_id')->references('id')->on('companies');
+ // $table->foreign('company_id')->references('id')->on('companies');
});
}
@@ -26,7 +26,7 @@ class AddCompanyIdToUsersTable extends Migration
public function down()
{
Schema::table('users', function (Blueprint $table) {
- //$table->dropForeign('users_company_id_foreign');
+ // $table->dropForeign('users_company_id_foreign');
$table->dropColumn('company_id');
});
}
diff --git a/database/migrations/2015_11_06_134742_add_company_id_to_licenses_table.php b/database/migrations/2015_11_06_134742_add_company_id_to_licenses_table.php
index 2d4a5ba9df..81291c8892 100644
--- a/database/migrations/2015_11_06_134742_add_company_id_to_licenses_table.php
+++ b/database/migrations/2015_11_06_134742_add_company_id_to_licenses_table.php
@@ -14,7 +14,7 @@ class AddCompanyIdToLicensesTable extends Migration
{
Schema::table('licenses', function (Blueprint $table) {
$table->integer('company_id')->unsigned()->nullable();
- //$table->foreign('company_id')->references('id')->on('companies');
+ // $table->foreign('company_id')->references('id')->on('companies');
});
}
@@ -26,7 +26,7 @@ class AddCompanyIdToLicensesTable extends Migration
public function down()
{
Schema::table('licenses', function (Blueprint $table) {
- //$table->dropForeign('licenses_company_id_foreign');
+ // $table->dropForeign('licenses_company_id_foreign');
$table->dropColumn('company_id');
});
}
diff --git a/database/migrations/2015_11_08_035832_add_company_id_to_assets_table.php b/database/migrations/2015_11_08_035832_add_company_id_to_assets_table.php
index 9aec3920eb..4654293638 100644
--- a/database/migrations/2015_11_08_035832_add_company_id_to_assets_table.php
+++ b/database/migrations/2015_11_08_035832_add_company_id_to_assets_table.php
@@ -14,7 +14,7 @@ class AddCompanyIdToAssetsTable extends Migration
{
Schema::table('assets', function (Blueprint $table) {
$table->integer('company_id')->unsigned()->nullable();
- //$table->foreign('company_id')->references('id')->on('companies');
+ // $table->foreign('company_id')->references('id')->on('companies');
});
}
diff --git a/database/migrations/2015_11_08_222305_add_ldap_fields_to_settings.php b/database/migrations/2015_11_08_222305_add_ldap_fields_to_settings.php
index 171258f27c..75874031dd 100644
--- a/database/migrations/2015_11_08_222305_add_ldap_fields_to_settings.php
+++ b/database/migrations/2015_11_08_222305_add_ldap_fields_to_settings.php
@@ -22,7 +22,7 @@ class AddLdapFieldsToSettings extends Migration
$table->string('ldap_username_field')->nullable()->default('samaccountname');
$table->string('ldap_lname_field')->nullable()->default('sn');
$table->string('ldap_fname_field')->nullable()->default('givenname');
- $table->string('ldap_auth_filter_query')->nullable()->default('uid=');
+ $table->string('ldap_auth_filter_query')->nullable()->default('uid=');
$table->integer('ldap_version')->nullable()->default(3);
$table->string('ldap_active_flag')->nullable()->default(null);
$table->string('ldap_emp_num')->nullable()->default(null);
diff --git a/database/migrations/2015_11_26_195528_import_ldap_settings.php b/database/migrations/2015_11_26_195528_import_ldap_settings.php
index eb66bf6f68..38068902c1 100644
--- a/database/migrations/2015_11_26_195528_import_ldap_settings.php
+++ b/database/migrations/2015_11_26_195528_import_ldap_settings.php
@@ -1,7 +1,7 @@
<?php
+use App\Models\Setting;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class ImportLdapSettings extends Migration
{
@@ -12,7 +12,7 @@ class ImportLdapSettings extends Migration
*/
public function up()
{
- $settings = \App\Models\Setting::first();
+ $settings = Setting::first();
// Only update the settings record if there IS an LDAP Config
// AND the Settings table doesn't already have LDAP settings in it
diff --git a/database/migrations/2015_11_30_191504_remove_fk_company_id.php b/database/migrations/2015_11_30_191504_remove_fk_company_id.php
index 37ec4a1833..40c2f3021f 100644
--- a/database/migrations/2015_11_30_191504_remove_fk_company_id.php
+++ b/database/migrations/2015_11_30_191504_remove_fk_company_id.php
@@ -13,30 +13,30 @@ class RemoveFkCompanyId extends Migration
public function up()
{
//
- // Schema::table('users', function(Blueprint $table)
- // {
- // $table->dropForeign('users_company_id_foreign');
- // });
- //
- // Schema::table('accessories', function(Blueprint $table)
- // {
- // $table->dropForeign('accessories_company_id_foreign');
- // });
- //
- // Schema::table('assets', function(Blueprint $table)
- // {
- // $table->dropForeign('assets_company_id_foreign');
- // });
- //
- // Schema::table('consumables', function(Blueprint $table)
- // {
- // $table->dropForeign('consumables_company_id_foreign');
- // });
- //
- // Schema::table('licenses', function(Blueprint $table)
- // {
- // $table->dropForeign('licenses_company_id_foreign');
- // });
+ // Schema::table('users', function(Blueprint $table)
+ // {
+ // $table->dropForeign('users_company_id_foreign');
+ // });
+ //
+ // Schema::table('accessories', function(Blueprint $table)
+ // {
+ // $table->dropForeign('accessories_company_id_foreign');
+ // });
+ //
+ // Schema::table('assets', function(Blueprint $table)
+ // {
+ // $table->dropForeign('assets_company_id_foreign');
+ // });
+ //
+ // Schema::table('consumables', function(Blueprint $table)
+ // {
+ // $table->dropForeign('consumables_company_id_foreign');
+ // });
+ //
+ // Schema::table('licenses', function(Blueprint $table)
+ // {
+ // $table->dropForeign('licenses_company_id_foreign');
+ // });
}
/**
diff --git a/database/migrations/2016_01_28_041048_add_notes_to_models.php b/database/migrations/2016_01_28_041048_add_notes_to_models.php
index abbc42dae1..ef40080a5a 100644
--- a/database/migrations/2016_01_28_041048_add_notes_to_models.php
+++ b/database/migrations/2016_01_28_041048_add_notes_to_models.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddNotesToModels extends Migration
{
diff --git a/database/migrations/2016_03_08_225351_create_components_table.php b/database/migrations/2016_03_08_225351_create_components_table.php
index 8a3dfb7c5a..0711e939cd 100644
--- a/database/migrations/2016_03_08_225351_create_components_table.php
+++ b/database/migrations/2016_03_08_225351_create_components_table.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class CreateComponentsTable extends Migration
{
diff --git a/database/migrations/2016_03_11_185621_add_label_settings_to_settings.php b/database/migrations/2016_03_11_185621_add_label_settings_to_settings.php
index 679bf51994..2bfe6c8b35 100644
--- a/database/migrations/2016_03_11_185621_add_label_settings_to_settings.php
+++ b/database/migrations/2016_03_11_185621_add_label_settings_to_settings.php
@@ -40,22 +40,22 @@ class AddLabelSettingsToSettings extends Migration
{
Schema::table('settings', function ($table) {
$table->dropColumn(
- 'labels_per_page',
- 'labels_width',
- 'labels_height',
- 'labels_pmargin_left',
- 'labels_pmargin_right',
- 'labels_pmargin_top',
- 'labels_pmargin_bottom',
- 'labels_display_bgutter',
- 'labels_display_sgutter',
- 'labels_fontsize',
- 'labels_pagewidth',
- 'labels_pageheight',
- 'labels_display_name',
- 'labels_display_serial',
- 'labels_display_tag'
- );
+ 'labels_per_page',
+ 'labels_width',
+ 'labels_height',
+ 'labels_pmargin_left',
+ 'labels_pmargin_right',
+ 'labels_pmargin_top',
+ 'labels_pmargin_bottom',
+ 'labels_display_bgutter',
+ 'labels_display_sgutter',
+ 'labels_fontsize',
+ 'labels_pagewidth',
+ 'labels_pageheight',
+ 'labels_display_name',
+ 'labels_display_serial',
+ 'labels_display_tag'
+ );
});
}
}
diff --git a/database/migrations/2016_03_22_125911_fix_custom_fields_regexes.php b/database/migrations/2016_03_22_125911_fix_custom_fields_regexes.php
index 8634ede9af..bee78d64f1 100644
--- a/database/migrations/2016_03_22_125911_fix_custom_fields_regexes.php
+++ b/database/migrations/2016_03_22_125911_fix_custom_fields_regexes.php
@@ -1,7 +1,7 @@
<?php
+use App\Models\CustomField;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class FixCustomFieldsRegexes extends Migration
{
@@ -12,7 +12,7 @@ class FixCustomFieldsRegexes extends Migration
*/
public function up()
{
- foreach (\App\Models\CustomField::all() as $custom_field) {
+ foreach (CustomField::all() as $custom_field) {
switch ($custom_field->format) {
case '[a-zA-Z]*':
@@ -27,7 +27,7 @@ class FixCustomFieldsRegexes extends Migration
$custom_field->format = 'IP';
break;
- //ANYTHING ELSE.
+ // ANYTHING ELSE.
default:
$custom_field->format = 'regex:/^'.$custom_field->format.'$/';
}
diff --git a/database/migrations/2016_07_22_003348_fix_custom_fields_regex_stuff.php b/database/migrations/2016_07_22_003348_fix_custom_fields_regex_stuff.php
index da81cb1e50..bc6c56ba91 100644
--- a/database/migrations/2016_07_22_003348_fix_custom_fields_regex_stuff.php
+++ b/database/migrations/2016_07_22_003348_fix_custom_fields_regex_stuff.php
@@ -1,7 +1,7 @@
<?php
+use App\Models\CustomField;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class FixCustomFieldsRegexStuff extends Migration
{
@@ -20,41 +20,41 @@ class FixCustomFieldsRegexStuff extends Migration
*/
public function up()
{
- foreach (\App\Models\CustomField::all() as $custom_field) {
+ foreach (CustomField::all() as $custom_field) {
// Handle alphanumeric
if (stripos($custom_field->format, 'ALPHA') !== false) {
$custom_field->format = 'alpha';
- // Numeric
+ // Numeric
} elseif (stripos($custom_field->format, 'NUMERIC') !== false) {
$custom_field->format = 'numeric';
- // IP
+ // IP
} elseif (stripos($custom_field->format, 'IP') !== false) {
$custom_field->format = 'ip';
- // Email
+ // Email
} elseif (stripos($custom_field->format, 'EMAIL') !== false) {
$custom_field->format = 'email';
- // MAC
+ // MAC
} elseif (stripos($custom_field->format, 'regex:/^[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}$/') !== false) {
$custom_field->format = 'regex:/^[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}$/';
- // Date
+ // Date
} elseif (stripos($custom_field->format, 'DATE') !== false) {
$custom_field->format = 'date';
- // URL
+ // URL
} elseif (stripos($custom_field->format, 'URL') !== false) {
$custom_field->format = 'url';
- // ANY
+ // ANY
} elseif (stripos($custom_field->format, 'ANY') !== false) {
$custom_field->format = '';
- // Fix any custom regexes
+ // Fix any custom regexes
} else {
$tmp_custom = str_replace('regex:/^', '', $custom_field->format);
$tmp_custom = str_replace('$/', '', $tmp_custom);
diff --git a/database/migrations/2016_07_22_054850_one_more_mac_addr_fix.php b/database/migrations/2016_07_22_054850_one_more_mac_addr_fix.php
index ac64e278fe..095b964648 100644
--- a/database/migrations/2016_07_22_054850_one_more_mac_addr_fix.php
+++ b/database/migrations/2016_07_22_054850_one_more_mac_addr_fix.php
@@ -1,7 +1,7 @@
<?php
+use App\Models\CustomField;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class OneMoreMacAddrFix extends Migration
{
@@ -12,7 +12,7 @@ class OneMoreMacAddrFix extends Migration
*/
public function up()
{
- foreach (\App\Models\CustomField::all() as $custom_field) {
+ foreach (CustomField::all() as $custom_field) {
if ($custom_field->format == 'regex:/^MAC$/') {
$custom_field->format = 'regex:/^[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}$/';
}
diff --git a/database/migrations/2016_08_30_084634_make_purchase_cost_nullable.php b/database/migrations/2016_08_30_084634_make_purchase_cost_nullable.php
index 742885b245..2dfe168304 100644
--- a/database/migrations/2016_08_30_084634_make_purchase_cost_nullable.php
+++ b/database/migrations/2016_08_30_084634_make_purchase_cost_nullable.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MakePurchaseCostNullable extends Migration
{
@@ -12,8 +11,8 @@ class MakePurchaseCostNullable extends Migration
*/
public function up()
{
- //$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
- //$platform->registerDoctrineTypeMapping('enum', 'string');
+ // $platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
+ // $platform->registerDoctrineTypeMapping('enum', 'string');
Schema::table('assets', function ($table) {
$table->decimal('purchase_cost', 8, 2)->nullable()->default(null)->change();
diff --git a/database/migrations/2016_09_01_141051_add_requestable_to_asset_model.php b/database/migrations/2016_09_01_141051_add_requestable_to_asset_model.php
index 89b5dfc556..59df0923f7 100644
--- a/database/migrations/2016_09_01_141051_add_requestable_to_asset_model.php
+++ b/database/migrations/2016_09_01_141051_add_requestable_to_asset_model.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddRequestableToAssetModel extends Migration
{
diff --git a/database/migrations/2016_09_04_182149_migrate_asset_log_to_action_log.php b/database/migrations/2016_09_04_182149_migrate_asset_log_to_action_log.php
index 874f7a6070..dd870d199c 100644
--- a/database/migrations/2016_09_04_182149_migrate_asset_log_to_action_log.php
+++ b/database/migrations/2016_09_04_182149_migrate_asset_log_to_action_log.php
@@ -1,9 +1,13 @@
<?php
+use App\Models\Accessory;
use App\Models\Actionlog;
+use App\Models\Asset;
+use App\Models\Component;
+use App\Models\Consumable;
+use App\Models\License;
use App\Models\User;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class MigrateAssetLogToActionLog extends Migration
{
@@ -26,20 +30,20 @@ class MigrateAssetLogToActionLog extends Migration
if (! is_null($log->asset_id)) {
$a->item_id = $log->asset_id;
if ($log->asset_type == 'hardware') {
- $a->item_type = \App\Models\Asset::class;
+ $a->item_type = Asset::class;
} else {
- $a->item_type = \App\Models\License::class;
+ $a->item_type = License::class;
}
}
if (! is_null($log->accessory_id)) {
$a->item_id = $log->accessory_id;
- $a->item_type = \App\Models\Accessory::class;
+ $a->item_type = Accessory::class;
} elseif (! is_null($log->consumable_id)) {
$a->item_id = $log->consumable_id;
- $a->item_type = \App\Models\Consumable::class;
+ $a->item_type = Consumable::class;
} elseif (! is_null($log->component_id)) {
$a->item_id = $log->component_id;
- $a->item_type = \App\Models\Component::class;
+ $a->item_type = Component::class;
}
$a->action_type = $log->action_type;
// $a->checkout_to = $log->checkout_to;
diff --git a/database/migrations/2016_09_19_235935_fix_fieldtype_for_target_type.php b/database/migrations/2016_09_19_235935_fix_fieldtype_for_target_type.php
index 0d74936ef6..94e3b33850 100644
--- a/database/migrations/2016_09_19_235935_fix_fieldtype_for_target_type.php
+++ b/database/migrations/2016_09_19_235935_fix_fieldtype_for_target_type.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class FixFieldtypeForTargetType extends Migration
{
diff --git a/database/migrations/2016_09_23_140722_fix_modelno_in_consumables_to_string.php b/database/migrations/2016_09_23_140722_fix_modelno_in_consumables_to_string.php
index 05b0f19327..5de7d527ce 100644
--- a/database/migrations/2016_09_23_140722_fix_modelno_in_consumables_to_string.php
+++ b/database/migrations/2016_09_23_140722_fix_modelno_in_consumables_to_string.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class FixModelnoInConsumablesToString extends Migration
{
diff --git a/database/migrations/2016_10_14_130709_fix_order_number_to_varchar.php b/database/migrations/2016_10_14_130709_fix_order_number_to_varchar.php
index 280984e33e..e867f8bfcb 100644
--- a/database/migrations/2016_10_14_130709_fix_order_number_to_varchar.php
+++ b/database/migrations/2016_10_14_130709_fix_order_number_to_varchar.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class FixOrderNumberToVarchar extends Migration
{
diff --git a/database/migrations/2016_10_19_145520_fix_order_number_in_components_to_string.php b/database/migrations/2016_10_19_145520_fix_order_number_in_components_to_string.php
index 6ad4932a68..f3bc555c85 100644
--- a/database/migrations/2016_10_19_145520_fix_order_number_in_components_to_string.php
+++ b/database/migrations/2016_10_19_145520_fix_order_number_in_components_to_string.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class FixOrderNumberInComponentsToString extends Migration
{
diff --git a/database/migrations/2016_10_27_151715_add_serial_to_components.php b/database/migrations/2016_10_27_151715_add_serial_to_components.php
index df73fcd87b..2a1784a41d 100644
--- a/database/migrations/2016_10_27_151715_add_serial_to_components.php
+++ b/database/migrations/2016_10_27_151715_add_serial_to_components.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddSerialToComponents extends Migration
{
diff --git a/database/migrations/2016_10_27_213251_increase_serial_field_capacity.php b/database/migrations/2016_10_27_213251_increase_serial_field_capacity.php
index 71302ff3ac..ac55793ef5 100644
--- a/database/migrations/2016_10_27_213251_increase_serial_field_capacity.php
+++ b/database/migrations/2016_10_27_213251_increase_serial_field_capacity.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class IncreaseSerialFieldCapacity extends Migration
{
diff --git a/database/migrations/2016_10_29_002724_enable_2fa_fields.php b/database/migrations/2016_10_29_002724_enable_2fa_fields.php
index 96e45e150e..7567ebf692 100644
--- a/database/migrations/2016_10_29_002724_enable_2fa_fields.php
+++ b/database/migrations/2016_10_29_002724_enable_2fa_fields.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class Enable2faFields extends Migration
{
diff --git a/database/migrations/2016_10_29_082408_add_signature_to_acceptance.php b/database/migrations/2016_10_29_082408_add_signature_to_acceptance.php
index 8a9d3ca79a..527ef556b8 100644
--- a/database/migrations/2016_10_29_082408_add_signature_to_acceptance.php
+++ b/database/migrations/2016_10_29_082408_add_signature_to_acceptance.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddSignatureToAcceptance extends Migration
{
diff --git a/database/migrations/2016_11_01_030818_fix_forgotten_filename_in_action_logs.php b/database/migrations/2016_11_01_030818_fix_forgotten_filename_in_action_logs.php
index 93ee1da534..73963dcc41 100644
--- a/database/migrations/2016_11_01_030818_fix_forgotten_filename_in_action_logs.php
+++ b/database/migrations/2016_11_01_030818_fix_forgotten_filename_in_action_logs.php
@@ -18,11 +18,11 @@ class FixForgottenFilenameInActionLogs extends Migration
//
foreach ($logs as $log) {
$matching_action_log = Actionlog::where('item_id', $log->asset_id)
- ->where('created_at', $log->created_at)
- ->where('note', $log->note)
- ->where('filename', null)
- ->withTrashed()
- ->get()->first();
+ ->where('created_at', $log->created_at)
+ ->where('note', $log->note)
+ ->where('filename', null)
+ ->withTrashed()
+ ->get()->first();
if ($matching_action_log) {
$matching_action_log->filename = $log->filename;
diff --git a/database/migrations/2016_11_13_020954_rename_component_serial_number_to_serial.php b/database/migrations/2016_11_13_020954_rename_component_serial_number_to_serial.php
index d6be3bb199..d03dbb271d 100644
--- a/database/migrations/2016_11_13_020954_rename_component_serial_number_to_serial.php
+++ b/database/migrations/2016_11_13_020954_rename_component_serial_number_to_serial.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class RenameComponentSerialNumberToSerial extends Migration
{
diff --git a/database/migrations/2016_11_16_172119_increase_purchase_cost_size.php b/database/migrations/2016_11_16_172119_increase_purchase_cost_size.php
index d463a97eb6..79e4ad50ad 100644
--- a/database/migrations/2016_11_16_172119_increase_purchase_cost_size.php
+++ b/database/migrations/2016_11_16_172119_increase_purchase_cost_size.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class IncreasePurchaseCostSize extends Migration
{
@@ -12,8 +11,8 @@ class IncreasePurchaseCostSize extends Migration
*/
public function up()
{
- //$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
- //$platform->registerDoctrineTypeMapping('enum', 'string');
+ // $platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
+ // $platform->registerDoctrineTypeMapping('enum', 'string');
Schema::table('assets', function ($table) {
$table->decimal('purchase_cost', 20, 2)->nullable()->default(null)->change();
@@ -47,8 +46,8 @@ class IncreasePurchaseCostSize extends Migration
*/
public function down()
{
- //$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
- //$platform->registerDoctrineTypeMapping('enum', 'string');
+ // $platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
+ // $platform->registerDoctrineTypeMapping('enum', 'string');
Schema::table('assets', function ($table) {
$table->decimal('purchase_cost', 8, 2)->nullable()->default(null)->change();
diff --git a/database/migrations/2016_11_17_161317_longer_state_field_in_location.php b/database/migrations/2016_11_17_161317_longer_state_field_in_location.php
index 3c77db6743..7a3bceacac 100644
--- a/database/migrations/2016_11_17_161317_longer_state_field_in_location.php
+++ b/database/migrations/2016_11_17_161317_longer_state_field_in_location.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class LongerStateFieldInLocation extends Migration
{
diff --git a/database/migrations/2016_11_17_193706_add_model_number_to_accessories.php b/database/migrations/2016_11_17_193706_add_model_number_to_accessories.php
index 048875a150..4a7d8922f8 100644
--- a/database/migrations/2016_11_17_193706_add_model_number_to_accessories.php
+++ b/database/migrations/2016_11_17_193706_add_model_number_to_accessories.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class AddModelNumberToAccessories extends Migration
{
diff --git a/database/migrations/2016_11_24_160405_add_missing_target_type_to_logs_table.php b/database/migrations/2016_11_24_160405_add_missing_target_type_to_logs_table.php
index bf0b5360a1..4480861965 100644
--- a/database/migrations/2016_11_24_160405_add_missing_target_type_to_logs_table.php
+++ b/database/migrations/2016_11_24_160405_add_missing_target_type_to_logs_table.php
@@ -1,7 +1,7 @@
<?php
+use App\Models\User;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
class AddMissingTargetTypeToLogsTable extends Migration
@@ -16,8 +16,8 @@ class AddMissingTargetTypeToLogsTable extends Migration
// Get list of action logs with a target id but not a target type. This fixes missing target_type in accept_asset
DB::table('action_logs')->where('target_type', null)->where(function ($query) {
$query->where('action_type', 'accepted')
- ->orWhere('action_type', 'declined');
- })->update(['target_type'=> \App\Models\User::class]);
+ ->orWhere('action_type', 'declined');
+ })->update(['target_type' => User::class]);
}
/**
diff --git a/database/migrations/2016_12_07_173720_increase_size_of_state_in_suppliers.php b/database/migrations/2016_12_07_173720_increase_size_of_state_in_suppliers.php
index 70539c1198..6ddcf62b0e 100644
--- a/database/migrations/2016_12_07_173720_increase_size_of_state_in_suppliers.php
+++ b/database/migrations/2016_12_07_173720_increase_size_of_state_in_suppliers.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
class IncreaseSizeOfStateInSuppliers extends Migration
{
diff --git a/database/migrations/2017_01_25_063357_fix_utf8_custom_field_column_names.php b/database/migrations/2017_01_25_063357_fix_utf8_custom_field_column_names.php
index 0df09864a5..76f42b768b 100644
--- a/database/migrations/2017_01_25_063357_fix_utf8_custom_field_column_names.php
+++ b/database/migrations/2017_01_25_063357_fix_utf8_custom_field_column_names.php
@@ -15,13 +15,15 @@ use Illuminate\Support\Str;
* as a one-time fix.
*
* @author [A. Gianotto] [<[email protected]>]
+ *
* @since [v4.0]
+ *
* @return array
*/
function updateLegacyColumnName($customfield)
{
$name_to_db_name = CustomField::name_to_db_name($customfield->name);
- //\Log::debug('Trying to rename '.$name_to_db_name." to ".$customfield->convertUnicodeDbSlug()."...\n");
+ // \Log::debug('Trying to rename '.$name_to_db_name." to ".$customfield->convertUnicodeDbSlug()."...\n");
if (Schema::hasColumn(CustomField::$table_name, $name_to_db_name)) {
return Schema::table(CustomField::$table_name,
@@ -30,7 +32,7 @@ function updateLegacyColumnName($customfield)
}
);
} else {
- //\Log::debug('Legacy DB column '.$name_to_db_name.' was not found on the assets table.');
+ // \Log::debug('Legacy DB column '.$name_to_db_name.' was not found on the assets table.');
}
}
@@ -43,8 +45,8 @@ class FixUtf8CustomFieldColumnNames extends Migration
*/
public function up()
{
- //$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
- //$platform->registerDoctrineTypeMapping('enum', 'string');
+ // $platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
+ // $platform->registerDoctrineTypeMapping('enum', 'string');
if (! Schema::hasColumn('custom_fields', 'db_column')) {
Schema::table('custom_fields', function ($table) {
diff --git a/database/migrations/2017_05_08_195520_increase_size_of_field_values_in_custom_fields.php b/database/migrations/2017_05_08_195520_increase_size_of_field_values_in_custom_fields.php
index a0cd6ae122..7511058413 100644
--- a/database/migrations/2017_05_08_195520_increase_size_of_field_values_in_custom_fields.php
+++ b/database/migrations/2017_05_08_195520_increase_size_of_field_values_in_custom_fields.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class IncreaseSizeOfFieldValuesInCustomFields extends Migration
diff --git a/database/migrations/2017_06_14_122059_add_next_autoincrement_to_settings.php b/database/migrations/2017_06_14_122059_add_next_autoincrement_to_settings.php
index f6d97e820c..0f3b74cf84 100644
--- a/database/migrations/2017_06_14_122059_add_next_autoincrement_to_settings.php
+++ b/database/migrations/2017_06_14_122059_add_next_autoincrement_to_settings.php
@@ -1,6 +1,7 @@
<?php
use App\Models\Asset;
+use App\Models\Setting;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -19,13 +20,13 @@ class AddNextAutoincrementToSettings extends Migration
$next = 1;
}
- Schema::table('settings', function (Blueprint $table) use ($next) {
+ Schema::table('settings', function (Blueprint $table) {
$table->bigInteger('next_auto_tag_base')->default('1');
});
- //\Log::debug('Setting '.$next.' as default auto-increment');
+ // \Log::debug('Setting '.$next.' as default auto-increment');
- if ($settings = App\Models\Setting::first()) {
+ if ($settings = Setting::first()) {
$settings->next_auto_tag_base = $next;
$settings->save();
}
diff --git a/database/migrations/2017_08_03_160105_set_asset_archived_to_zero_default.php b/database/migrations/2017_08_03_160105_set_asset_archived_to_zero_default.php
index 1e794ef695..579bb5b885 100644
--- a/database/migrations/2017_08_03_160105_set_asset_archived_to_zero_default.php
+++ b/database/migrations/2017_08_03_160105_set_asset_archived_to_zero_default.php
@@ -13,8 +13,8 @@ class SetAssetArchivedToZeroDefault extends Migration
*/
public function up()
{
- //$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
- //$platform->registerDoctrineTypeMapping('enum', 'string');
+ // $platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
+ // $platform->registerDoctrineTypeMapping('enum', 'string');
Schema::table('assets', function (Blueprint $table) {
$table->boolean('archived')->default(0)->nullable()->change();
diff --git a/database/migrations/2017_09_18_225619_fix_assigned_type_not_being_nulled.php b/database/migrations/2017_09_18_225619_fix_assigned_type_not_being_nulled.php
index ef7c3cd4c0..66e008b6df 100644
--- a/database/migrations/2017_09_18_225619_fix_assigned_type_not_being_nulled.php
+++ b/database/migrations/2017_09_18_225619_fix_assigned_type_not_being_nulled.php
@@ -1,9 +1,8 @@
<?php
use App\Models\Asset;
+use App\Models\User;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
class FixAssignedTypeNotBeingNulled extends Migration
{
@@ -11,6 +10,7 @@ class FixAssignedTypeNotBeingNulled extends Migration
* Run the migrations.
* There was a point in the v4 beta process where assigned_type was not nulled on checkin
* This manually nulls all assets where there is an assigned_type but not an assigned_to.
+ *
* @return void
*/
public function up()
@@ -21,7 +21,7 @@ class FixAssignedTypeNotBeingNulled extends Migration
// Additionally, the importer did not set assigned_type when importing.
// In the case where we have an assigned_to but not an assigned_type, set the assigned_type to User.
- Asset::whereNotNull('assigned_to')->whereNull('assigned_type')->update(['assigned_type' => \App\Models\User::class]);
+ Asset::whereNotNull('assigned_to')->whereNull('assigned_type')->update(['assigned_type' => User::class]);
}
/**
diff --git a/database/migrations/2017_10_03_015503_drop_foreign_keys.php b/database/migrations/2017_10_03_015503_drop_foreign_keys.php
index 9f42fc068e..d57e922d2a 100644
--- a/database/migrations/2017_10_03_015503_drop_foreign_keys.php
+++ b/database/migrations/2017_10_03_015503_drop_foreign_keys.php
@@ -17,48 +17,48 @@ class DropForeignKeys extends Migration
Schema::table('accessories', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
- } catch (\Exception $e) {
- //echo $e;
+ } catch (Exception $e) {
+ // echo $e;
}
try {
Schema::table('users', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
- } catch (\Exception $e) {
- //echo $e;
+ } catch (Exception $e) {
+ // echo $e;
}
try {
Schema::table('assets', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
- } catch (\Exception $e) {
- //echo $e;
+ } catch (Exception $e) {
+ // echo $e;
}
try {
Schema::table('components', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
- } catch (\Exception $e) {
- //echo $e;
+ } catch (Exception $e) {
+ // echo $e;
}
try {
Schema::table('consumables', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
- } catch (\Exception $e) {
- //echo $e;
+ } catch (Exception $e) {
+ // echo $e;
}
try {
Schema::table('licenses', function (Blueprint $table) {
$table->dropForeign(['company_id']);
});
- } catch (\Exception $e) {
- //echo $e;
+ } catch (Exception $e) {
+ // echo $e;
}
}
diff --git a/database/migrations/2017_10_27_192423_migrate_denormed_asset_locations.php b/database/migrations/2017_10_27_192423_migrate_denormed_asset_locations.php
index e0e10e1a88..4af1a4f6f3 100644
--- a/database/migrations/2017_10_27_192423_migrate_denormed_asset_locations.php
+++ b/database/migrations/2017_10_27_192423_migrate_denormed_asset_locations.php
@@ -15,7 +15,7 @@ class MigrateDenormedAssetLocations extends Migration
// I know its gross to edit a migration, but we had to do this for support purposes. - @snipe
Artisan::call('snipeit:sync-asset-locations', ['--output' => 'all']);
$output = Artisan::output();
- \Log::info($output);
+ Log::info($output);
}
/**
diff --git a/database/migrations/2017_12_26_170856_re_normalize_last_audit.php b/database/migrations/2017_12_26_170856_re_normalize_last_audit.php
index 3cb8cbb52a..18afb4bcce 100644
--- a/database/migrations/2017_12_26_170856_re_normalize_last_audit.php
+++ b/database/migrations/2017_12_26_170856_re_normalize_last_audit.php
@@ -3,7 +3,6 @@
use App\Models\Actionlog;
use App\Models\Asset;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ReNormalizeLastAudit extends Migration
diff --git a/database/migrations/2018_05_04_075235_add_update_license_category.php b/database/migrations/2018_05_04_075235_add_update_license_category.php
index 964ca103fc..1ca63299c6 100644
--- a/database/migrations/2018_05_04_075235_add_update_license_category.php
+++ b/database/migrations/2018_05_04_075235_add_update_license_category.php
@@ -3,8 +3,6 @@
use App\Models\Category;
use App\Models\License;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
class AddUpdateLicenseCategory extends Migration
{
@@ -34,7 +32,7 @@ class AddUpdateLicenseCategory extends Migration
*/
public function down()
{
- App\Models\Category::where('name', 'Misc Software')->forceDelete();
+ Category::where('name', 'Misc Software')->forceDelete();
License::whereNotNull('category_id')
->update(['category_id' => null]);
diff --git a/database/migrations/2018_05_16_153409_add_first_counter_totals_to_assets.php b/database/migrations/2018_05_16_153409_add_first_counter_totals_to_assets.php
index 893e76f803..ef5baa71db 100644
--- a/database/migrations/2018_05_16_153409_add_first_counter_totals_to_assets.php
+++ b/database/migrations/2018_05_16_153409_add_first_counter_totals_to_assets.php
@@ -1,9 +1,6 @@
<?php
-use App\Models\Asset;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
class AddFirstCounterTotalsToAssets extends Migration
{
@@ -15,10 +12,10 @@ class AddFirstCounterTotalsToAssets extends Migration
public function up()
{
// This artisan call may take a while
- \Log::info('This could take a while.... ');
+ Log::info('This could take a while.... ');
Artisan::call('snipeit:counter-sync');
$output = Artisan::output();
- \Log::info($output);
+ Log::info($output);
}
/**
diff --git a/database/migrations/2018_07_28_023826_create_checkout_acceptances_table.php b/database/migrations/2018_07_28_023826_create_checkout_acceptances_table.php
index 7f0d2d3c01..9c7d6296a1 100644
--- a/database/migrations/2018_07_28_023826_create_checkout_acceptances_table.php
+++ b/database/migrations/2018_07_28_023826_create_checkout_acceptances_table.php
@@ -13,7 +13,7 @@ class CreateCheckoutAcceptancesTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('checkout_acceptances')) {
+ if (! Schema::hasTable('checkout_acceptances')) {
Schema::create('checkout_acceptances', function (Blueprint $table) {
$table->increments('id');
diff --git a/database/migrations/2018_08_08_100000_create_telescope_entries_table.php b/database/migrations/2018_08_08_100000_create_telescope_entries_table.php
index 91b753b6a7..d39fe1eafc 100644
--- a/database/migrations/2018_08_08_100000_create_telescope_entries_table.php
+++ b/database/migrations/2018_08_08_100000_create_telescope_entries_table.php
@@ -21,7 +21,7 @@ return new class extends Migration
{
$schema = Schema::connection($this->getConnection());
- if (! Schema::hasTable('telescope_entries') ) {
+ if (! Schema::hasTable('telescope_entries')) {
$schema->create('telescope_entries', function (Blueprint $table) {
$table->bigIncrements('sequence');
$table->uuid('uuid');
@@ -40,7 +40,7 @@ return new class extends Migration
});
}
- if (! Schema::hasTable('telescope_entries_tags') ) {
+ if (! Schema::hasTable('telescope_entries_tags')) {
$schema->create('telescope_entries_tags', function (Blueprint $table) {
$table->uuid('entry_uuid');
$table->string('tag');
@@ -55,7 +55,7 @@ return new class extends Migration
});
}
- if (! Schema::hasTable('telescope_monitoring') ) {
+ if (! Schema::hasTable('telescope_monitoring')) {
$schema->create('telescope_monitoring', function (Blueprint $table) {
$table->string('tag')->primary();
});
diff --git a/database/migrations/2018_09_10_082212_create_checkout_acceptances_for_unaccepted_assets.php b/database/migrations/2018_09_10_082212_create_checkout_acceptances_for_unaccepted_assets.php
index 2885f5ef84..6f872b6128 100644
--- a/database/migrations/2018_09_10_082212_create_checkout_acceptances_for_unaccepted_assets.php
+++ b/database/migrations/2018_09_10_082212_create_checkout_acceptances_for_unaccepted_assets.php
@@ -1,10 +1,9 @@
<?php
-use App\Models\Actionlog;
+use App\Models\Asset;
+use App\Models\User;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
-use Illuminate\Support\Facades\Schema;
class CreateCheckoutAcceptancesForUnacceptedAssets extends Migration
{
@@ -16,15 +15,15 @@ class CreateCheckoutAcceptancesForUnacceptedAssets extends Migration
public function up()
{
// Get all assets not accepted
- $assets = DB::table('assets')->where('assigned_type', \App\Models\User::class)->where('accepted', 'pending')->get();
+ $assets = DB::table('assets')->where('assigned_type', User::class)->where('accepted', 'pending')->get();
$acceptances = [];
foreach ($assets as $asset) {
$acceptances[] = [
- 'checkoutable_type' => \App\Models\Asset::class,
- 'checkoutable_id' => $asset->id,
- 'assigned_to_id' => $asset->assigned_to,
+ 'checkoutable_type' => Asset::class,
+ 'checkoutable_id' => $asset->id,
+ 'assigned_to_id' => $asset->assigned_to,
];
}
diff --git a/database/migrations/2018_10_18_191228_add_kits_licenses_table.php b/database/migrations/2018_10_18_191228_add_kits_licenses_table.php
index 5461742022..0995637af8 100644
--- a/database/migrations/2018_10_18_191228_add_kits_licenses_table.php
+++ b/database/migrations/2018_10_18_191228_add_kits_licenses_table.php
@@ -1,10 +1,8 @@
<?php
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
-
class AddKitsLicensesTable extends Migration
{
/**
@@ -14,16 +12,16 @@ class AddKitsLicensesTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('kits_licenses')) {
+ if (! Schema::hasTable('kits_licenses')) {
Schema::create('kits_licenses', function ($table) {
$table->increments('id');
- $table->integer('kit_id')->nullable()->default(NULL);
- $table->integer('license_id')->nullable()->default(NULL);
+ $table->integer('kit_id')->nullable()->default(null);
+ $table->integer('license_id')->nullable()->default(null);
$table->integer('quantity')->default(1);
$table->timestamps();
});
}
- }
+ }
/**
* Reverse the migrations.
@@ -32,9 +30,8 @@ class AddKitsLicensesTable extends Migration
*/
public function down()
{
- if (Schema::hasTable('kits_licenses')) {
- Schema::drop('kits_licenses');
+ if (Schema::hasTable('kits_licenses')) {
+ Schema::drop('kits_licenses');
}
- }
-
+ }
}
diff --git a/database/migrations/2018_10_19_153910_add_kits_table.php b/database/migrations/2018_10_19_153910_add_kits_table.php
index 08d04d29e8..8891581361 100644
--- a/database/migrations/2018_10_19_153910_add_kits_table.php
+++ b/database/migrations/2018_10_19_153910_add_kits_table.php
@@ -1,6 +1,5 @@
<?php
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
@@ -13,16 +12,16 @@ class AddKitsTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('kits')) {
+ if (! Schema::hasTable('kits')) {
Schema::create('kits', function ($table) {
$table->increments('id');
- $table->string('name')->nullable()->default(NULL);
+ $table->string('name')->nullable()->default(null);
$table->timestamps();
$table->engine = 'InnoDB';
});
}
- }
+ }
/**
* Reverse the migrations.
@@ -31,10 +30,9 @@ class AddKitsTable extends Migration
*/
public function down()
{
- if (Schema::hasTable('kits')) {
- Schema::drop('kits');
+ if (Schema::hasTable('kits')) {
+ Schema::drop('kits');
}
- }
-
+ }
}
diff --git a/database/migrations/2018_10_19_154013_add_kits_models_table.php b/database/migrations/2018_10_19_154013_add_kits_models_table.php
index ea651085b5..a85c2872f9 100644
--- a/database/migrations/2018_10_19_154013_add_kits_models_table.php
+++ b/database/migrations/2018_10_19_154013_add_kits_models_table.php
@@ -1,10 +1,8 @@
<?php
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
-
class AddKitsModelsTable extends Migration
{
/**
@@ -14,16 +12,16 @@ class AddKitsModelsTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('kits_models')) {
+ if (! Schema::hasTable('kits_models')) {
Schema::create('kits_models', function ($table) {
$table->increments('id');
- $table->integer('kit_id')->nullable()->default(NULL);
- $table->integer('model_id')->nullable()->default(NULL);
+ $table->integer('kit_id')->nullable()->default(null);
+ $table->integer('model_id')->nullable()->default(null);
$table->integer('quantity')->default(1);
$table->timestamps();
});
}
- }
+ }
/**
* Reverse the migrations.
@@ -32,9 +30,8 @@ class AddKitsModelsTable extends Migration
*/
public function down()
{
- if (Schema::hasTable('kits_models')) {
- Schema::drop('kits_models');
+ if (Schema::hasTable('kits_models')) {
+ Schema::drop('kits_models');
}
}
-
}
diff --git a/database/migrations/2019_02_07_185953_add_kits_consumables_table.php b/database/migrations/2019_02_07_185953_add_kits_consumables_table.php
index 6f7595484a..3722458333 100644
--- a/database/migrations/2019_02_07_185953_add_kits_consumables_table.php
+++ b/database/migrations/2019_02_07_185953_add_kits_consumables_table.php
@@ -1,8 +1,7 @@
<?php
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Support\Facades\Schema;
class AddKitsConsumablesTable extends Migration
{
@@ -13,11 +12,11 @@ class AddKitsConsumablesTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('kits_consumables')) {
+ if (! Schema::hasTable('kits_consumables')) {
Schema::create('kits_consumables', function ($table) {
$table->increments('id');
- $table->integer('kit_id')->nullable()->default(NULL);
- $table->integer('consumable_id')->nullable()->default(NULL);
+ $table->integer('kit_id')->nullable()->default(null);
+ $table->integer('consumable_id')->nullable()->default(null);
$table->integer('quantity')->default(1);
$table->timestamps();
});
diff --git a/database/migrations/2019_02_07_190030_add_kits_accessories_table.php b/database/migrations/2019_02_07_190030_add_kits_accessories_table.php
index 242b283e52..bfbc2d214f 100644
--- a/database/migrations/2019_02_07_190030_add_kits_accessories_table.php
+++ b/database/migrations/2019_02_07_190030_add_kits_accessories_table.php
@@ -1,8 +1,7 @@
<?php
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Support\Facades\Schema;
class AddKitsAccessoriesTable extends Migration
{
@@ -13,11 +12,11 @@ class AddKitsAccessoriesTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('kits_accessories')) {
+ if (! Schema::hasTable('kits_accessories')) {
Schema::create('kits_accessories', function ($table) {
$table->increments('id');
- $table->integer('kit_id')->nullable()->default(NULL);
- $table->integer('accessory_id')->nullable()->default(NULL);
+ $table->integer('kit_id')->nullable()->default(null);
+ $table->integer('accessory_id')->nullable()->default(null);
$table->integer('quantity')->default(1);
$table->timestamps();
});
diff --git a/database/migrations/2019_02_20_234421_make_serial_nullable.php b/database/migrations/2019_02_20_234421_make_serial_nullable.php
index 295e66f27c..90944ff2db 100644
--- a/database/migrations/2019_02_20_234421_make_serial_nullable.php
+++ b/database/migrations/2019_02_20_234421_make_serial_nullable.php
@@ -13,8 +13,8 @@ class MakeSerialNullable extends Migration
*/
public function up()
{
- //$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
- //$platform->registerDoctrineTypeMapping('enum', 'string');
+ // $platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
+ // $platform->registerDoctrineTypeMapping('enum', 'string');
Schema::table('assets', function (Blueprint $table) {
$table->string('serial')->nullable()->default(null)->change();
diff --git a/database/migrations/2019_04_06_060145_add_user_skin_setting.php b/database/migrations/2019_04_06_060145_add_user_skin_setting.php
index 475f0c6aec..c0578ba726 100644
--- a/database/migrations/2019_04_06_060145_add_user_skin_setting.php
+++ b/database/migrations/2019_04_06_060145_add_user_skin_setting.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddUserSkinSetting extends Migration
diff --git a/database/migrations/2019_04_06_205355_add_setting_allow_user_skin.php b/database/migrations/2019_04_06_205355_add_setting_allow_user_skin.php
index e1281b01f1..c99d7eee58 100644
--- a/database/migrations/2019_04_06_205355_add_setting_allow_user_skin.php
+++ b/database/migrations/2019_04_06_205355_add_setting_allow_user_skin.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddSettingAllowUserSkin extends Migration
diff --git a/database/migrations/2019_06_12_184327_rename_groups_table.php b/database/migrations/2019_06_12_184327_rename_groups_table.php
index 58dafbc8f6..00cc01c527 100644
--- a/database/migrations/2019_06_12_184327_rename_groups_table.php
+++ b/database/migrations/2019_06_12_184327_rename_groups_table.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class RenameGroupsTable extends Migration
diff --git a/database/migrations/2020_02_04_172100_add_ad_append_domain_settings.php b/database/migrations/2020_02_04_172100_add_ad_append_domain_settings.php
index e5b62c8ce6..6ab222cb5f 100644
--- a/database/migrations/2020_02_04_172100_add_ad_append_domain_settings.php
+++ b/database/migrations/2020_02_04_172100_add_ad_append_domain_settings.php
@@ -19,7 +19,7 @@ class AddAdAppendDomainSettings extends Migration
});
$s = Setting::first(); // we are deliberately *not* using the ::getSettings() method, as it caches things, and our Settings table is being migrated right now
- if ($s && $s->is_ad && $s->ldap_enabled && $s->ad_domain) { //backwards-compatibility setting; < v5 always appended AD Domains
+ if ($s && $s->is_ad && $s->ldap_enabled && $s->ad_domain) { // backwards-compatibility setting; < v5 always appended AD Domains
$s->ad_append_domain = 1;
$s->save();
}
diff --git a/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php b/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php
index e6398909d3..43b11fbf28 100644
--- a/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php
+++ b/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php
@@ -2,6 +2,7 @@
use App\Models\Accessory;
use App\Models\Actionlog;
+use App\Models\User;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -16,60 +17,56 @@ class MoveAccessoryCheckoutNoteToJoinTable extends Migration
public function up()
{
- if (!Schema::hasColumn('accessories_users', 'note'))
- {
+ if (! Schema::hasColumn('accessories_users', 'note')) {
Schema::table('accessories_users', function (Blueprint $table) {
$table->string('note')->nullable(true)->default(null);
});
}
-
-
-
// Loop through the checked out accessories, find their related action_log entry, and copy over the note
// to the newly created note field
$accessories = Accessory::get();
$count = 0;
- \Log::debug('Accessory Count: '.$accessories->count());
+ Log::debug('Accessory Count: '.$accessories->count());
// Loop through all of the accessories
foreach ($accessories as $accessory) {
$count++;
- \Log::debug('Querying join logs');
+ Log::debug('Querying join logs');
$join_logs = DB::table('accessories_users')->get();
// Loop through the accessories_users records
foreach ($join_logs as $join_log) {
- \Log::debug($join_logs->count().' join log records');
- \Log::debug('Looking for accessories_users that match '.$join_log->created_at);
+ Log::debug($join_logs->count().' join log records');
+ Log::debug('Looking for accessories_users that match '.$join_log->created_at);
// Get the records from action_logs so we can copy the notes over to the new notes field
// on the accessories_users table
$action_log_entries = Actionlog::where('created_at', '=', $join_log->created_at)
->where('target_id', '=', $join_log->assigned_to)
->where('item_id', '=', $accessory->id)
- ->where('target_type', '=', \App\Models\User::class)
- ->where('item_type', '=','App\\Models\\Accessory')
+ ->where('target_type', '=', User::class)
+ ->where('item_type', '=', 'App\\Models\\Accessory')
->where('action_type', '=', 'checkout')
->where('note', '!=', '')
->orderBy('created_at', 'DESC')->get();
- \Log::debug($action_log_entries->count().' matching entries in the action_logs table');
- \Log::debug('Looking for action_logs that match '.$join_log->created_at);
+ Log::debug($action_log_entries->count().' matching entries in the action_logs table');
+ Log::debug('Looking for action_logs that match '.$join_log->created_at);
foreach ($action_log_entries as $action_log_entry) {
- \Log::debug('Checkout date in asset log: '.$action_log_entry->created_at.' against accessories_users: '.$join_log->created_at);
- \Log::debug('Action log: '.$action_log_entry->created_at);
- \Log::debug('Join log: '.$join_log->created_at);
+ Log::debug('Checkout date in asset log: '.$action_log_entry->created_at.' against accessories_users: '.$join_log->created_at);
+ Log::debug('Action log: '.$action_log_entry->created_at);
+ Log::debug('Join log: '.$join_log->created_at);
if ($action_log_entry->created_at == $join_log->created_at) {
DB::table('accessories_users')
->where('id', $join_log->id)
->update(['note' => $action_log_entry->note]);
} else {
- \Log::debug('No match');
+ Log::debug('No match');
}
}
}
@@ -84,14 +81,11 @@ class MoveAccessoryCheckoutNoteToJoinTable extends Migration
public function down()
{
- if (Schema::hasColumn('accessories_users', 'note'))
- {
- Schema::table('accessories_users', function (Blueprint $table)
- {
+ if (Schema::hasColumn('accessories_users', 'note')) {
+ Schema::table('accessories_users', function (Blueprint $table) {
$table->dropColumn('note');
});
}
-
}
}
diff --git a/database/migrations/2020_10_23_161736_fix_zero_values_for_locations.php b/database/migrations/2020_10_23_161736_fix_zero_values_for_locations.php
index 110a6c3e91..cabb9e7c51 100644
--- a/database/migrations/2020_10_23_161736_fix_zero_values_for_locations.php
+++ b/database/migrations/2020_10_23_161736_fix_zero_values_for_locations.php
@@ -3,8 +3,6 @@
use App\Models\Asset;
use App\Models\User;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
class FixZeroValuesForLocations extends Migration
{
@@ -15,13 +13,13 @@ class FixZeroValuesForLocations extends Migration
*/
public function up()
{
- App\Models\Asset::where('location_id', '=', '0')
+ Asset::where('location_id', '=', '0')
->update(['location_id' => null]);
- App\Models\Asset::where('rtd_location_id', '=', '0')
+ Asset::where('rtd_location_id', '=', '0')
->update(['rtd_location_id' => null]);
- App\Models\User::where('location_id', '=', '0')
+ User::where('location_id', '=', '0')
->update(['location_id' => null]);
}
diff --git a/database/migrations/2020_12_21_153235_update_min_password.php b/database/migrations/2020_12_21_153235_update_min_password.php
index a05ec88892..05e34332b9 100644
--- a/database/migrations/2020_12_21_153235_update_min_password.php
+++ b/database/migrations/2020_12_21_153235_update_min_password.php
@@ -1,8 +1,7 @@
<?php
+use App\Models\Setting;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
class UpdateMinPassword extends Migration
{
@@ -22,7 +21,7 @@ class UpdateMinPassword extends Migration
*/
public function up()
{
- App\Models\Setting::where('pwd_secure_min', '<', '8')
+ Setting::where('pwd_secure_min', '<', '8')
->update(['pwd_secure_min' => '8']);
}
diff --git a/database/migrations/2020_12_21_210105_fix_bad_ldap_server_url_for_v5.php b/database/migrations/2020_12_21_210105_fix_bad_ldap_server_url_for_v5.php
index a038251cd5..5209a06337 100644
--- a/database/migrations/2020_12_21_210105_fix_bad_ldap_server_url_for_v5.php
+++ b/database/migrations/2020_12_21_210105_fix_bad_ldap_server_url_for_v5.php
@@ -1,8 +1,7 @@
<?php
+use App\Models\Setting;
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
class FixBadLdapServerUrlForV5 extends Migration
{
@@ -22,7 +21,7 @@ class FixBadLdapServerUrlForV5 extends Migration
public function up()
{
// UPDATE settings SET ldap_server = CONCAT('ldap://',ldap_server) WHERE ldap_server NOT LIKE 'ldap://%' AND ldap_server NOT LIKE 'ldaps://%'
- $settings = App\Models\Setting::where('ldap_server', 'not like', 'ldap://%')->where('ldap_server', 'not like', 'ldaps://%');
+ $settings = Setting::where('ldap_server', 'not like', 'ldap://%')->where('ldap_server', 'not like', 'ldaps://%');
foreach ($settings->get() as $setting) { // we don't formally support having multiple settings records, but just in case they come up...
$setting->ldap_server = 'ldap://'.$setting->ldap_server;
$setting->save();
diff --git a/database/migrations/2021_07_28_040554_add_client_side_l_d_a_p_key_to_settings.php b/database/migrations/2021_07_28_040554_add_client_side_l_d_a_p_key_to_settings.php
index 46feeea9f0..f1105704da 100644
--- a/database/migrations/2021_07_28_040554_add_client_side_l_d_a_p_key_to_settings.php
+++ b/database/migrations/2021_07_28_040554_add_client_side_l_d_a_p_key_to_settings.php
@@ -14,7 +14,7 @@ class AddClientSideLDAPKeyToSettings extends Migration
public function up()
{
Schema::table('settings', function (Blueprint $table) {
- $table->text("ldap_client_tls_key")->nullable()->default(null);
+ $table->text('ldap_client_tls_key')->nullable()->default(null);
});
}
@@ -26,7 +26,7 @@ class AddClientSideLDAPKeyToSettings extends Migration
public function down()
{
Schema::table('settings', function (Blueprint $table) {
- $table->dropColumn("ldap_client_tls_key");
+ $table->dropColumn('ldap_client_tls_key');
});
}
}
diff --git a/database/migrations/2021_08_11_005206_add_depreciation_minimum_value.php b/database/migrations/2021_08_11_005206_add_depreciation_minimum_value.php
index a6a646e127..171c394d59 100644
--- a/database/migrations/2021_08_11_005206_add_depreciation_minimum_value.php
+++ b/database/migrations/2021_08_11_005206_add_depreciation_minimum_value.php
@@ -14,7 +14,7 @@ class AddDepreciationMinimumValue extends Migration
public function up()
{
Schema::table('depreciations', function (Blueprint $table) {
- $table->decimal('depreciation_min', 8,2)->after('months')->nullable();
+ $table->decimal('depreciation_min', 8, 2)->after('months')->nullable();
});
}
diff --git a/database/migrations/2021_09_20_183216_change_default_label_to_nullable.php b/database/migrations/2021_09_20_183216_change_default_label_to_nullable.php
index 72d9c8c2be..cab3ced0c3 100644
--- a/database/migrations/2021_09_20_183216_change_default_label_to_nullable.php
+++ b/database/migrations/2021_09_20_183216_change_default_label_to_nullable.php
@@ -1,37 +1,34 @@
<?php
+use App\Models\Statuslabel;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-use App\Models\Statuslabel;
class ChangeDefaultLabelToNullable extends Migration
{
/**
* Run the migrations.
- *
- * This is stupid because it has a default valuye of 0 so it *should*
- * default to 0, but it doesn't on some versions of MySQL.
+ *
+ * This is stupid because it has a default valuye of 0 so it *should*
+ * default to 0, but it doesn't on some versions of MySQL.
*
* @return void
*/
public function up()
{
-
Statuslabel::whereNull('default_label')
- ->update(['default_label' => 0]);
+ ->update(['default_label' => 0]);
Statuslabel::whereNull('show_in_nav')
- ->update(['show_in_nav' => 0]);
-
+ ->update(['show_in_nav' => 0]);
Schema::table('status_labels', function (Blueprint $table) {
$table->boolean('default_label')->nullable()->default(0)->change();
$table->boolean('show_in_nav')->nullable()->default(0)->change();
});
-
}
/**
diff --git a/database/migrations/2022_02_03_214958_blank_out_ldap_active_flag.php b/database/migrations/2022_02_03_214958_blank_out_ldap_active_flag.php
index e183788f05..40e5bac8e0 100644
--- a/database/migrations/2022_02_03_214958_blank_out_ldap_active_flag.php
+++ b/database/migrations/2022_02_03_214958_blank_out_ldap_active_flag.php
@@ -1,9 +1,7 @@
<?php
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
use App\Models\Setting;
+use Illuminate\Database\Migrations\Migration;
class BlankOutLdapActiveFlag extends Migration
{
@@ -19,7 +17,7 @@ class BlankOutLdapActiveFlag extends Migration
$s->save();
}
}
-
+
/**
* Reverse the migrations.
*
diff --git a/database/migrations/2022_02_10_110210_add_company_id_to_locations.php b/database/migrations/2022_02_10_110210_add_company_id_to_locations.php
index 8ef5822812..b65ab41746 100644
--- a/database/migrations/2022_02_10_110210_add_company_id_to_locations.php
+++ b/database/migrations/2022_02_10_110210_add_company_id_to_locations.php
@@ -32,4 +32,3 @@ class AddCompanyIdToLocations extends Migration
});
}
}
-
diff --git a/database/migrations/2022_03_03_225655_add_notes_to_accessories.php b/database/migrations/2022_03_03_225655_add_notes_to_accessories.php
index d6f8fac6f3..b217668a4e 100644
--- a/database/migrations/2022_03_03_225655_add_notes_to_accessories.php
+++ b/database/migrations/2022_03_03_225655_add_notes_to_accessories.php
@@ -14,7 +14,7 @@ class AddNotesToAccessories extends Migration
public function up()
{
Schema::table('accessories', function (Blueprint $table) {
- $table->text("notes")->nullable()->default(null);
+ $table->text('notes')->nullable()->default(null);
});
}
diff --git a/database/migrations/2022_03_03_225754_add_notes_to_components.php b/database/migrations/2022_03_03_225754_add_notes_to_components.php
index 2e09930974..d932368d5d 100644
--- a/database/migrations/2022_03_03_225754_add_notes_to_components.php
+++ b/database/migrations/2022_03_03_225754_add_notes_to_components.php
@@ -14,7 +14,7 @@ class AddNotesToComponents extends Migration
public function up()
{
Schema::table('components', function (Blueprint $table) {
- $table->text("notes")->nullable()->default(null);
+ $table->text('notes')->nullable()->default(null);
});
}
diff --git a/database/migrations/2022_03_03_225824_add_notes_to_consumables.php b/database/migrations/2022_03_03_225824_add_notes_to_consumables.php
index e024d65144..7a2d8a4068 100644
--- a/database/migrations/2022_03_03_225824_add_notes_to_consumables.php
+++ b/database/migrations/2022_03_03_225824_add_notes_to_consumables.php
@@ -14,7 +14,7 @@ class AddNotesToConsumables extends Migration
public function up()
{
Schema::table('consumables', function (Blueprint $table) {
- $table->text("notes")->nullable()->default(null);
+ $table->text('notes')->nullable()->default(null);
});
}
diff --git a/database/migrations/2022_03_09_001334_add_eula_to_checkout_acceptance.php b/database/migrations/2022_03_09_001334_add_eula_to_checkout_acceptance.php
index ac4faa19af..bbd0ef262f 100644
--- a/database/migrations/2022_03_09_001334_add_eula_to_checkout_acceptance.php
+++ b/database/migrations/2022_03_09_001334_add_eula_to_checkout_acceptance.php
@@ -13,7 +13,7 @@ class AddEulaToCheckoutAcceptance extends Migration
*/
public function up()
{
- if (!Schema::hasColumn('checkout_acceptances', 'stored_eula')) {
+ if (! Schema::hasColumn('checkout_acceptances', 'stored_eula')) {
Schema::table('checkout_acceptances', function (Blueprint $table) {
$table->text('stored_eula')->nullable()->default(null);
$table->string('stored_eula_file')->nullable()->default(null);
@@ -39,4 +39,4 @@ class AddEulaToCheckoutAcceptance extends Migration
});
}
}
-}
\ No newline at end of file
+}
diff --git a/database/migrations/2022_03_21_162724_adds_ldap_manager.php b/database/migrations/2022_03_21_162724_adds_ldap_manager.php
index 44a8fd7127..60fc610ebc 100644
--- a/database/migrations/2022_03_21_162724_adds_ldap_manager.php
+++ b/database/migrations/2022_03_21_162724_adds_ldap_manager.php
@@ -13,7 +13,7 @@ class AddsLdapManager extends Migration
*/
public function up()
{
- //Updates the Settings Table
+ // Updates the Settings Table
Schema::table('settings', function (Blueprint $table) {
$table->string('ldap_manager')->after('ldap_jobtitle')->nullable();
});
diff --git a/database/migrations/2022_04_05_135340_add_primary_key_to_custom_fields_pivot.php b/database/migrations/2022_04_05_135340_add_primary_key_to_custom_fields_pivot.php
index 35f2f15415..d22eb2b1dc 100644
--- a/database/migrations/2022_04_05_135340_add_primary_key_to_custom_fields_pivot.php
+++ b/database/migrations/2022_04_05_135340_add_primary_key_to_custom_fields_pivot.php
@@ -16,7 +16,7 @@ class AddPrimaryKeyToCustomFieldsPivot extends Migration
// Check if the ID primary key already exists, if not, add it
Schema::table('custom_field_custom_fieldset', function (Blueprint $table) {
- if (!Schema::hasColumn('custom_field_custom_fieldset', 'id')) {
+ if (! Schema::hasColumn('custom_field_custom_fieldset', 'id')) {
$table->bigIncrements('id')->first();
}
});
diff --git a/database/migrations/2022_05_16_235350_remove_stored_eula_field.php b/database/migrations/2022_05_16_235350_remove_stored_eula_field.php
index 48c8a18825..43ec285ce0 100644
--- a/database/migrations/2022_05_16_235350_remove_stored_eula_field.php
+++ b/database/migrations/2022_05_16_235350_remove_stored_eula_field.php
@@ -1,9 +1,9 @@
<?php
+use App\Models\Actionlog;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-use App\Models\Actionlog;
class RemoveStoredEulaField extends Migration
{
diff --git a/database/migrations/2022_06_28_234539_add_username_index_to_users.php b/database/migrations/2022_06_28_234539_add_username_index_to_users.php
index 3303713319..f1483d9525 100644
--- a/database/migrations/2022_06_28_234539_add_username_index_to_users.php
+++ b/database/migrations/2022_06_28_234539_add_username_index_to_users.php
@@ -26,7 +26,7 @@ class AddUsernameIndexToUsers extends Migration
public function down()
{
Schema::table('users', function (Blueprint $table) {
- $table->dropIndex(['username','deleted_at']);
+ $table->dropIndex(['username', 'deleted_at']);
});
}
}
diff --git a/database/migrations/2022_07_07_010406_add_indexes_to_license_seats.php b/database/migrations/2022_07_07_010406_add_indexes_to_license_seats.php
index 1a68a57fa6..b8b7a36f87 100644
--- a/database/migrations/2022_07_07_010406_add_indexes_to_license_seats.php
+++ b/database/migrations/2022_07_07_010406_add_indexes_to_license_seats.php
@@ -14,8 +14,8 @@ class AddIndexesToLicenseSeats extends Migration
public function up()
{
Schema::table('license_seats', function (Blueprint $table) {
- $table->index(['assigned_to','license_id']);
- $table->index(['asset_id','license_id']);
+ $table->index(['assigned_to', 'license_id']);
+ $table->index(['asset_id', 'license_id']);
});
}
@@ -27,8 +27,8 @@ class AddIndexesToLicenseSeats extends Migration
public function down()
{
Schema::table('license_seats', function (Blueprint $table) {
- $table->dropIndex(['assigned_to','license_id']);
- $table->dropIndex(['asset_id','license_id']);
+ $table->dropIndex(['assigned_to', 'license_id']);
+ $table->dropIndex(['asset_id', 'license_id']);
});
}
}
diff --git a/database/migrations/2022_10_25_215520_add_label2_settings.php b/database/migrations/2022_10_25_215520_add_label2_settings.php
index 2b07651e67..722e397e27 100644
--- a/database/migrations/2022_10_25_215520_add_label2_settings.php
+++ b/database/migrations/2022_10_25_215520_add_label2_settings.php
@@ -33,14 +33,30 @@ class AddLabel2Settings extends Migration
public function down()
{
Schema::table('settings', function (Blueprint $table) {
- if (Schema::hasColumn('settings', 'label2_enable')) $table->dropColumn('label2_enable');
- if (Schema::hasColumn('settings', 'label2_template')) $table->dropColumn('label2_template');
- if (Schema::hasColumn('settings', 'label2_title')) $table->dropColumn('label2_title');
- if (Schema::hasColumn('settings', 'label2_asset_logo')) $table->dropColumn('label2_asset_logo');
- if (Schema::hasColumn('settings', 'label2_1d_type')) $table->dropColumn('label2_1d_type');
- if (Schema::hasColumn('settings', 'label2_2d_type')) $table->dropColumn('label2_2d_type');
- if (Schema::hasColumn('settings', 'label2_2d_target')) $table->dropColumn('label2_2d_target');
- if (Schema::hasColumn('settings', 'label2_fields')) $table->dropColumn('label2_fields');
+ if (Schema::hasColumn('settings', 'label2_enable')) {
+ $table->dropColumn('label2_enable');
+ }
+ if (Schema::hasColumn('settings', 'label2_template')) {
+ $table->dropColumn('label2_template');
+ }
+ if (Schema::hasColumn('settings', 'label2_title')) {
+ $table->dropColumn('label2_title');
+ }
+ if (Schema::hasColumn('settings', 'label2_asset_logo')) {
+ $table->dropColumn('label2_asset_logo');
+ }
+ if (Schema::hasColumn('settings', 'label2_1d_type')) {
+ $table->dropColumn('label2_1d_type');
+ }
+ if (Schema::hasColumn('settings', 'label2_2d_type')) {
+ $table->dropColumn('label2_2d_type');
+ }
+ if (Schema::hasColumn('settings', 'label2_2d_target')) {
+ $table->dropColumn('label2_2d_target');
+ }
+ if (Schema::hasColumn('settings', 'label2_fields')) {
+ $table->dropColumn('label2_fields');
+ }
});
}
}
diff --git a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php
index aa9086a7c7..e28bd1af9b 100644
--- a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php
+++ b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php
@@ -1,10 +1,10 @@
<?php
+use App\Models\Asset;
+use App\Models\AssetModel;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-use App\Models\Asset;
-use App\Models\AssetModel;
class AddEolDateOnAssetsTable extends Migration
{
@@ -17,8 +17,8 @@ class AddEolDateOnAssetsTable extends Migration
{
Schema::table('assets', function (Blueprint $table) {
-
- if (!Schema::hasColumn('assets', 'asset_eol_date')) {
+
+ if (! Schema::hasColumn('assets', 'asset_eol_date')) {
$table->date('asset_eol_date')->after('purchase_date')->nullable()->default(null);
}
@@ -26,7 +26,7 @@ class AddEolDateOnAssetsTable extends Migration
// there is a large version difference. (See the AssetObserver notes). This column gets created
// later in 2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php
// but we have to temporarily create it now so the save method below doesn't break
- if (!Schema::hasColumn('assets', 'eol_explicit')) {
+ if (! Schema::hasColumn('assets', 'eol_explicit')) {
$table->boolean('eol_explicit')->default(false)->after('asset_eol_date');
}
});
@@ -38,7 +38,7 @@ class AddEolDateOnAssetsTable extends Migration
foreach ($models as $model) {
foreach ($model->assets as $asset) {
- if ($asset->purchase_date!='') {
+ if ($asset->purchase_date != '') {
$asset->asset_eol_date = $asset->present()->eol_date();
$asset->saveQuietly();
}
diff --git a/database/migrations/2023_02_12_224353_fix_unescaped_customfields_format.php b/database/migrations/2023_02_12_224353_fix_unescaped_customfields_format.php
index f1779e996a..59b50ebd0d 100644
--- a/database/migrations/2023_02_12_224353_fix_unescaped_customfields_format.php
+++ b/database/migrations/2023_02_12_224353_fix_unescaped_customfields_format.php
@@ -1,9 +1,7 @@
<?php
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
use App\Models\CustomField;
+use Illuminate\Database\Migrations\Migration;
class FixUnescapedCustomfieldsFormat extends Migration
{
@@ -16,7 +14,7 @@ class FixUnescapedCustomfieldsFormat extends Migration
{
$customfields = CustomField::where('format', 'LIKE', '%&%')->get();
- foreach($customfields as $customfield){
+ foreach ($customfields as $customfield) {
$customfield->update(['format' => html_entity_decode($customfield->format)]);
}
}
diff --git a/database/migrations/2023_02_27_092130_add_scope_locations_setting.php b/database/migrations/2023_02_27_092130_add_scope_locations_setting.php
index c1e2ff83e9..03771c8b7d 100644
--- a/database/migrations/2023_02_27_092130_add_scope_locations_setting.php
+++ b/database/migrations/2023_02_27_092130_add_scope_locations_setting.php
@@ -29,4 +29,4 @@ class AddScopeLocationsSetting extends Migration
$table->dropColumn('scope_locations_fmcs');
});
}
-}
\ No newline at end of file
+}
diff --git a/database/migrations/2023_03_21_215218_update_slack_setting.php b/database/migrations/2023_03_21_215218_update_slack_setting.php
index e4fdf75600..e7eb982b29 100644
--- a/database/migrations/2023_03_21_215218_update_slack_setting.php
+++ b/database/migrations/2023_03_21_215218_update_slack_setting.php
@@ -1,9 +1,7 @@
<?php
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
use App\Models\Setting;
+use Illuminate\Database\Migrations\Migration;
class UpdateSlackSetting extends Migration
{
@@ -20,7 +18,7 @@ class UpdateSlackSetting extends Migration
*/
$settings = Setting::where('webhook_selected', '=', 'Slack')->get();
- foreach($settings as $setting){
+ foreach ($settings as $setting) {
$setting->webhook_selected = 'slack';
$setting->save();
}
diff --git a/database/migrations/2023_04_12_135822_add_supplier_to_components.php b/database/migrations/2023_04_12_135822_add_supplier_to_components.php
index 447c7850a9..d685c8ee28 100644
--- a/database/migrations/2023_04_12_135822_add_supplier_to_components.php
+++ b/database/migrations/2023_04_12_135822_add_supplier_to_components.php
@@ -14,13 +14,13 @@ class AddSupplierToComponents extends Migration
public function up()
{
Schema::table('components', function (Blueprint $table) {
- if (!Schema::hasColumn('components', 'supplier_id')) {
+ if (! Schema::hasColumn('components', 'supplier_id')) {
$table->integer('supplier_id')->after('user_id')->nullable()->default(null);
}
});
Schema::table('consumables', function (Blueprint $table) {
- if (!Schema::hasColumn('consumables', 'supplier_id')) {
+ if (! Schema::hasColumn('consumables', 'supplier_id')) {
$table->integer('supplier_id')->after('user_id')->nullable()->default(null);
}
});
diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php
index 146e5b2d71..cd93694ae3 100644
--- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php
+++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php
@@ -6,8 +6,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
-use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Facades\Schema;
class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration
{
@@ -19,20 +19,19 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration
public function up()
{
Schema::table('assets', function (Blueprint $table) {
- if (!Schema::hasColumn('assets', 'eol_explicit')) {
+ if (! Schema::hasColumn('assets', 'eol_explicit')) {
$table->boolean('eol_explicit')->default(false)->after('asset_eol_date');
}
});
-
// Update the eol_explicit column with the value from asset_eol_date if it exists and is different from the calculated value
Asset::whereNotNull('asset_eol_date')->with('model')->chunkById(500, function ($assetsWithEolDates) {
foreach ($assetsWithEolDates as $asset) {
if ($asset->asset_eol_date && $asset->purchase_date) {
try {
$months = CarbonImmutable::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date);
- } catch (\Exception $e) {
- Log::info('asset_eol_date invalid for asset ' . $asset->id);
+ } catch (Exception $e) {
+ Log::info('asset_eol_date invalid for asset '.$asset->id);
}
if ($asset->model->eol) {
if ($months != $asset->model->eol) {
@@ -57,7 +56,6 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration
]);
}
-
/**
* Reverse the migrations.
*
@@ -77,14 +75,14 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration
private function eolUpdateExpression(): Expression
{
if (DB::getDriverName() === 'sqlite') {
- return DB::raw("DATE(purchase_date, '+' || (SELECT eol FROM " . DB::getTablePrefix() . "models WHERE models.id = assets.model_id) || ' months')");
+ return DB::raw("DATE(purchase_date, '+' || (SELECT eol FROM ".DB::getTablePrefix()."models WHERE models.id = assets.model_id) || ' months')");
}
if (DB::getDriverName() === 'pgsql') {
- return DB::raw("date(purchase_date + interval '1 month' * (SELECT eol FROM " . DB::getTablePrefix() . "models WHERE models.id = assets.model_id))");
+ return DB::raw("date(purchase_date + interval '1 month' * (SELECT eol FROM ".DB::getTablePrefix().'models WHERE models.id = assets.model_id))');
}
// Default to MySQL's method
- return DB::raw('DATE_ADD(purchase_date, INTERVAL ' . DB::getTablePrefix() . 'models.eol MONTH)');
+ return DB::raw('DATE_ADD(purchase_date, INTERVAL '.DB::getTablePrefix().'models.eol MONTH)');
}
}
diff --git a/database/migrations/2023_08_17_202638_add_last_checkin_to_assets.php b/database/migrations/2023_08_17_202638_add_last_checkin_to_assets.php
index 74048ce941..496b44d8b0 100644
--- a/database/migrations/2023_08_17_202638_add_last_checkin_to_assets.php
+++ b/database/migrations/2023_08_17_202638_add_last_checkin_to_assets.php
@@ -18,7 +18,7 @@ class AddLastCheckinToAssets extends Migration
});
DB::statement(
- "UPDATE " . DB::getTablePrefix() . "assets SET last_checkin=(SELECT MAX(" . DB::getTablePrefix() . "action_logs.action_date) FROM " . DB::getTablePrefix() . "action_logs WHERE item_type='App\\\Models\\\Asset' AND " . DB::getTablePrefix() . "action_logs.item_id=" . DB::getTablePrefix() . "assets.id AND " . DB::getTablePrefix() . "action_logs.action_type='checkin from')"
+ 'UPDATE '.DB::getTablePrefix().'assets SET last_checkin=(SELECT MAX('.DB::getTablePrefix().'action_logs.action_date) FROM '.DB::getTablePrefix()."action_logs WHERE item_type='App\\\Models\\\Asset' AND ".DB::getTablePrefix().'action_logs.item_id='.DB::getTablePrefix().'assets.id AND '.DB::getTablePrefix()."action_logs.action_type='checkin from')"
);
}
diff --git a/database/migrations/2023_08_21_181742_add_min_amt_to_models_table.php b/database/migrations/2023_08_21_181742_add_min_amt_to_models_table.php
index 5f0bb85f9b..c35ec5765d 100644
--- a/database/migrations/2023_08_21_181742_add_min_amt_to_models_table.php
+++ b/database/migrations/2023_08_21_181742_add_min_amt_to_models_table.php
@@ -14,7 +14,7 @@ class AddMinAmtToModelsTable extends Migration
public function up()
{
Schema::table('models', function (Blueprint $table) {
- $table->integer('min_amt')->after('model_number')->default(null);;
+ $table->integer('min_amt')->after('model_number')->default(null);
});
}
diff --git a/database/migrations/2023_12_19_081112_fix_language_dirs.php b/database/migrations/2023_12_19_081112_fix_language_dirs.php
index b3dcf4a0e3..ea4bc6ba44 100644
--- a/database/migrations/2023_12_19_081112_fix_language_dirs.php
+++ b/database/migrations/2023_12_19_081112_fix_language_dirs.php
@@ -1,10 +1,10 @@
<?php
+use App\Helpers\Helper;
+use App\Models\Setting;
+use App\Models\User;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
-use \App\Helpers\Helper;
-use \App\Models\Setting;
-use \App\Models\User;
class FixLanguageDirs extends Migration
{
diff --git a/database/migrations/2024_01_24_145544_create_saml_nonce_table.php b/database/migrations/2024_01_24_145544_create_saml_nonce_table.php
index f6305288ee..a626f1261e 100644
--- a/database/migrations/2024_01_24_145544_create_saml_nonce_table.php
+++ b/database/migrations/2024_01_24_145544_create_saml_nonce_table.php
@@ -13,7 +13,7 @@ class CreateSamlNonceTable extends Migration
*/
public function up()
{
- if (! Schema::hasTable('saml_nonces') ) {
+ if (! Schema::hasTable('saml_nonces')) {
Schema::create('saml_nonces', function (Blueprint $table) {
$table->id();
$table->string('nonce')->index();
diff --git a/database/migrations/2024_03_18_221612_update_legacy_locale.php b/database/migrations/2024_03_18_221612_update_legacy_locale.php
index dc81207b1d..a0a1a5515c 100644
--- a/database/migrations/2024_03_18_221612_update_legacy_locale.php
+++ b/database/migrations/2024_03_18_221612_update_legacy_locale.php
@@ -24,7 +24,6 @@ class UpdateLegacyLocale extends Migration
$table->string('locale', 10)->nullable()->default('en-US')->change();
});
-
}
/**
diff --git a/database/migrations/2024_07_23_172032_change_no__n_o_to_nb__n_o.php b/database/migrations/2024_07_23_172032_change_no__n_o_to_nb__n_o.php
index 6ed7e2b3a1..23a98892ac 100644
--- a/database/migrations/2024_07_23_172032_change_no__n_o_to_nb__n_o.php
+++ b/database/migrations/2024_07_23_172032_change_no__n_o_to_nb__n_o.php
@@ -1,10 +1,8 @@
<?php
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
use App\Models\Setting;
use App\Models\User;
+use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
@@ -21,8 +19,5 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
- public function down(): void
- {
-
- }
+ public function down(): void {}
};
diff --git a/database/migrations/2024_07_26_143301_add_checkout_for_all_types_to_accessories.php b/database/migrations/2024_07_26_143301_add_checkout_for_all_types_to_accessories.php
index bde3bc2c28..a786586891 100644
--- a/database/migrations/2024_07_26_143301_add_checkout_for_all_types_to_accessories.php
+++ b/database/migrations/2024_07_26_143301_add_checkout_for_all_types_to_accessories.php
@@ -2,10 +2,8 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-use App\Models\Setting;
-use App\Models\User;
use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
@@ -18,12 +16,12 @@ return new class extends Migration
Schema::rename('accessories_users', 'accessories_checkout');
Schema::table('accessories_checkout', function (Blueprint $table) {
- if (!Schema::hasColumn('accessories_checkout', 'assigned_type')) {
+ if (! Schema::hasColumn('accessories_checkout', 'assigned_type')) {
$table->string('assigned_type')->nullable();
}
});
}
-
+
DB::update('update '.DB::getTablePrefix().'accessories_checkout set assigned_type = \'App\\\\Models\\\\User\' where assigned_type is null', []);
}
@@ -34,7 +32,7 @@ return new class extends Migration
{
if (Schema::hasTable('accessories_checkout')) {
Schema::table('accessories_checkout', function (Blueprint $table) {
- $table->dropColumn('assigned_type');
+ $table->dropColumn('assigned_type');
});
Schema::rename('accessories_checkout', 'accessories_users');
diff --git a/database/migrations/2024_08_06_175114_add_shortcuts_enabled_to_settings_table.php b/database/migrations/2024_08_06_175114_add_shortcuts_enabled_to_settings_table.php
index 1d38c6b891..8d3177945b 100644
--- a/database/migrations/2024_08_06_175114_add_shortcuts_enabled_to_settings_table.php
+++ b/database/migrations/2024_08_06_175114_add_shortcuts_enabled_to_settings_table.php
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class extends Migration {
+return new class extends Migration
+{
/**
* Run the migrations.
*/
diff --git a/database/migrations/2024_09_17_204302_change_user_id_to_created_by.php b/database/migrations/2024_09_17_204302_change_user_id_to_created_by.php
index 3bef5948b6..724f0501be 100644
--- a/database/migrations/2024_09_17_204302_change_user_id_to_created_by.php
+++ b/database/migrations/2024_09_17_204302_change_user_id_to_created_by.php
@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
foreach ($this->add_to_table_list() as $add_table) {
- if (!Schema::hasColumn($add_table, 'created_by')) {
+ if (! Schema::hasColumn($add_table, 'created_by')) {
Schema::table($add_table, function (Blueprint $add_table) {
$add_table->unsignedBigInteger('created_by')->nullable()->before('created_at');
});
@@ -50,7 +50,8 @@ return new class extends Migration
}
}
- public function existing_table_list() {
+ public function existing_table_list()
+ {
return [
'accessories',
'accessories_checkout',
@@ -78,7 +79,8 @@ return new class extends Migration
];
}
- public function add_to_table_list() {
+ public function add_to_table_list()
+ {
return [
'companies',
'imports',
diff --git a/database/migrations/2024_10_31_212512_update_new_and_drop_old_barcode_settings.php b/database/migrations/2024_10_31_212512_update_new_and_drop_old_barcode_settings.php
index a802f04290..bdb304e1bd 100644
--- a/database/migrations/2024_10_31_212512_update_new_and_drop_old_barcode_settings.php
+++ b/database/migrations/2024_10_31_212512_update_new_and_drop_old_barcode_settings.php
@@ -2,8 +2,8 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
@@ -14,14 +14,13 @@ return new class extends Migration
{
// Copy values if target columns are blank
DB::table('settings')->whereNull('label2_2d_type')->orWhere('label2_2d_type', '')->update([
- 'label2_2d_type' => DB::raw('barcode_type')
+ 'label2_2d_type' => DB::raw('barcode_type'),
]);
DB::table('settings')->whereNull('label2_1d_type')->orWhere('label2_1d_type', '')->update([
- 'label2_1d_type' => DB::raw('alt_barcode')
+ 'label2_1d_type' => DB::raw('alt_barcode'),
]);
-
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn(['barcode_type', 'alt_barcode']);
});
@@ -36,11 +35,11 @@ return new class extends Migration
});
DB::table('settings')->whereNull('barcode_type')->orWhere('barcode_type', '')->update([
- 'barcode_type' => DB::raw('label2_2d_type')
+ 'barcode_type' => DB::raw('label2_2d_type'),
]);
DB::table('settings')->whereNull('alt_barcode')->orWhere('alt_barcode', '')->update([
- 'alt_barcode' => DB::raw('label2_1d_type')
+ 'alt_barcode' => DB::raw('label2_1d_type'),
]);
}
};
diff --git a/database/migrations/2024_11_07_113631_improve_manager_indexes_on_users_and_locations.php b/database/migrations/2024_11_07_113631_improve_manager_indexes_on_users_and_locations.php
index cc2963fecc..1148ec7b6b 100644
--- a/database/migrations/2024_11_07_113631_improve_manager_indexes_on_users_and_locations.php
+++ b/database/migrations/2024_11_07_113631_improve_manager_indexes_on_users_and_locations.php
@@ -13,11 +13,11 @@ return new class extends Migration
{
Schema::table('locations', function (Blueprint $table) {
$table->dropIndex(['manager_id']);
- $table->index(['manager_id','deleted_at']);
+ $table->index(['manager_id', 'deleted_at']);
});
Schema::table('users', function (Blueprint $table) {
$table->dropIndex(['manager_id']);
- $table->index(['manager_id','deleted_at']);
+ $table->index(['manager_id', 'deleted_at']);
});
}
@@ -28,11 +28,11 @@ return new class extends Migration
public function down(): void
{
Schema::table('locations', function (Blueprint $table) {
- $table->dropIndex(['manager_id','deleted_at']);
+ $table->dropIndex(['manager_id', 'deleted_at']);
$table->index(['manager_id']);
});
Schema::table('users', function (Blueprint $table) {
- $table->dropIndex(['manager_id','deleted_at']);
+ $table->dropIndex(['manager_id', 'deleted_at']);
$table->index(['manager_id']);
});
}
diff --git a/database/migrations/2025_01_06_210534_change_report_templates_options_to_column_text_field.php b/database/migrations/2025_01_06_210534_change_report_templates_options_to_column_text_field.php
index 024214ce3a..d5e0f7afb2 100644
--- a/database/migrations/2025_01_06_210534_change_report_templates_options_to_column_text_field.php
+++ b/database/migrations/2025_01_06_210534_change_report_templates_options_to_column_text_field.php
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class extends Migration {
+return new class extends Migration
+{
/**
* Run the migrations.
*/
diff --git a/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php b/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php
index 40c8ad5367..588fe30635 100644
--- a/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php
+++ b/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php
@@ -1,4 +1,5 @@
<?php
+
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -11,9 +12,10 @@ return new class extends Migration
public function up(): void
{
Schema::table('license_seats', function (Blueprint $table) {
- $table->addColumn('boolean', 'unreassignable_seat')->default(false)->after('assigned_to');
+ $table->addColumn('boolean', 'unreassignable_seat')->default(false)->after('assigned_to');
});
}
+
/**
* Reverse the migrations.
*/
diff --git a/database/migrations/2025_03_04_231256_purge_action_logs_of_report_template_activity.php b/database/migrations/2025_03_04_231256_purge_action_logs_of_report_template_activity.php
index 150df41a48..6dfbcaab1b 100644
--- a/database/migrations/2025_03_04_231256_purge_action_logs_of_report_template_activity.php
+++ b/database/migrations/2025_03_04_231256_purge_action_logs_of_report_template_activity.php
@@ -4,15 +4,16 @@ use App\Models\ReportTemplate;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
-return new class extends Migration {
+return new class extends Migration
+{
/**
* Run the migrations.
*/
public function up(): void
{
- DB::table("action_logs")
- ->where("item_type", ReportTemplate::class)
- ->whereIn("action_type", ["create", "update", "delete"])
+ DB::table('action_logs')
+ ->where('item_type', ReportTemplate::class)
+ ->whereIn('action_type', ['create', 'update', 'delete'])
->delete();
}
diff --git a/database/migrations/2025_03_06_152922_copy_created_at_to_action_date_in_action_logs.php b/database/migrations/2025_03_06_152922_copy_created_at_to_action_date_in_action_logs.php
index 8ce7de13bd..8e45539077 100644
--- a/database/migrations/2025_03_06_152922_copy_created_at_to_action_date_in_action_logs.php
+++ b/database/migrations/2025_03_06_152922_copy_created_at_to_action_date_in_action_logs.php
@@ -1,8 +1,8 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Support\Facades\DB;
use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@@ -24,8 +24,5 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
- public function down(): void
- {
-
- }
+ public function down(): void {}
};
diff --git a/database/migrations/2025_04_22_170731_add_empty_row_count_to_settings_table.php b/database/migrations/2025_04_22_170731_add_empty_row_count_to_settings_table.php
index 49b228b42d..8c88999a26 100644
--- a/database/migrations/2025_04_22_170731_add_empty_row_count_to_settings_table.php
+++ b/database/migrations/2025_04_22_170731_add_empty_row_count_to_settings_table.php
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class extends Migration {
+return new class extends Migration
+{
public function up(): void
{
Schema::table('settings', function (Blueprint $table) {
diff --git a/database/migrations/2025_05_12_183803_add_req_serial_bool_to_models_table.php b/database/migrations/2025_05_12_183803_add_req_serial_bool_to_models_table.php
index ee0e37a628..5a6fced710 100644
--- a/database/migrations/2025_05_12_183803_add_req_serial_bool_to_models_table.php
+++ b/database/migrations/2025_05_12_183803_add_req_serial_bool_to_models_table.php
@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('models', function (Blueprint $table) {
- $table->boolean( 'require_serial')->after('category_id')->default(0);
+ $table->boolean('require_serial')->after('category_id')->default(0);
});
}
diff --git a/database/migrations/2025_05_20_190317_repopulate_webhook_selected_setting.php b/database/migrations/2025_05_20_190317_repopulate_webhook_selected_setting.php
index be14ea04ea..d52d4c2e07 100644
--- a/database/migrations/2025_05_20_190317_repopulate_webhook_selected_setting.php
+++ b/database/migrations/2025_05_20_190317_repopulate_webhook_selected_setting.php
@@ -3,7 +3,8 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
-return new class extends Migration {
+return new class extends Migration
+{
/**
* Run the migrations.
*/
diff --git a/database/migrations/2025_06_02_233556_add_admin_cc_always_to_settings_table.php b/database/migrations/2025_06_02_233556_add_admin_cc_always_to_settings_table.php
index d28115a6d2..deababa411 100644
--- a/database/migrations/2025_06_02_233556_add_admin_cc_always_to_settings_table.php
+++ b/database/migrations/2025_06_02_233556_add_admin_cc_always_to_settings_table.php
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class extends Migration {
+return new class extends Migration
+{
/**
* Run the migrations.
*/
diff --git a/database/migrations/2025_06_03_000000_add_manager_view_enabled_to_settings_table.php b/database/migrations/2025_06_03_000000_add_manager_view_enabled_to_settings_table.php
index 345c52a7dd..8d832d77b2 100644
--- a/database/migrations/2025_06_03_000000_add_manager_view_enabled_to_settings_table.php
+++ b/database/migrations/2025_06_03_000000_add_manager_view_enabled_to_settings_table.php
@@ -11,7 +11,7 @@ return new class extends Migration
*/
public function up(): void
{
- if (!Schema::hasColumn('settings', 'manager_view_enabled')) {
+ if (! Schema::hasColumn('settings', 'manager_view_enabled')) {
Schema::table('settings', function (Blueprint $table) {
$table->boolean('manager_view_enabled')
->default(false)
diff --git a/database/migrations/2025_06_03_053438_fix_assigned_type_without_assigned_to.php b/database/migrations/2025_06_03_053438_fix_assigned_type_without_assigned_to.php
index 9d6a1c8046..de12aa17ad 100644
--- a/database/migrations/2025_06_03_053438_fix_assigned_type_without_assigned_to.php
+++ b/database/migrations/2025_06_03_053438_fix_assigned_type_without_assigned_to.php
@@ -16,8 +16,5 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
- public function down(): void
- {
-
- }
+ public function down(): void {}
};
diff --git a/database/migrations/2025_06_05_200518_add_alert_on_response_id_to_checkout_acceptances_table.php b/database/migrations/2025_06_05_200518_add_alert_on_response_id_to_checkout_acceptances_table.php
index ff9ad310f5..8751934d6f 100644
--- a/database/migrations/2025_06_05_200518_add_alert_on_response_id_to_checkout_acceptances_table.php
+++ b/database/migrations/2025_06_05_200518_add_alert_on_response_id_to_checkout_acceptances_table.php
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class extends Migration {
+return new class extends Migration
+{
/**
* Run the migrations.
*/
diff --git a/database/migrations/2025_06_05_204139_add_alert_on_response_to_categories_table.php b/database/migrations/2025_06_05_204139_add_alert_on_response_to_categories_table.php
index dc2bdae1b2..cb59735e1c 100644
--- a/database/migrations/2025_06_05_204139_add_alert_on_response_to_categories_table.php
+++ b/database/migrations/2025_06_05_204139_add_alert_on_response_to_categories_table.php
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class extends Migration {
+return new class extends Migration
+{
/**
* Run the migrations.
*/
diff --git a/database/migrations/2025_07_16_142036_clean_checkout_acceptances.php b/database/migrations/2025_07_16_142036_clean_checkout_acceptances.php
index b44bbc05b6..9aac454c82 100644
--- a/database/migrations/2025_07_16_142036_clean_checkout_acceptances.php
+++ b/database/migrations/2025_07_16_142036_clean_checkout_acceptances.php
@@ -1,9 +1,7 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Artisan;
-use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
@@ -13,7 +11,7 @@ return new class extends Migration
public function up(): void
{
//
- Artisan::call("snipeit:clean-checkout-acceptances");
+ Artisan::call('snipeit:clean-checkout-acceptances');
}
/**
diff --git a/database/migrations/2025_08_06_192954_add_image_to_maintenances.php b/database/migrations/2025_08_06_192954_add_image_to_maintenances.php
index ab1bb424b4..b5aca18720 100644
--- a/database/migrations/2025_08_06_192954_add_image_to_maintenances.php
+++ b/database/migrations/2025_08_06_192954_add_image_to_maintenances.php
@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('asset_maintenances', function (Blueprint $table) {
- if (!Schema::hasColumn('asset_maintenances', 'image')) {
+ if (! Schema::hasColumn('asset_maintenances', 'image')) {
$table->text('image')->after('notes')->nullable()->default(null);
}
});
diff --git a/database/migrations/2025_08_10_113444_rename_asset_maintenances_to_maintenances.php b/database/migrations/2025_08_10_113444_rename_asset_maintenances_to_maintenances.php
index f4cc30e803..fe7fb0465d 100644
--- a/database/migrations/2025_08_10_113444_rename_asset_maintenances_to_maintenances.php
+++ b/database/migrations/2025_08_10_113444_rename_asset_maintenances_to_maintenances.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
diff --git a/database/migrations/2025_08_10_114135_change_asset_maintenance_in_logs_to_maintenance.php b/database/migrations/2025_08_10_114135_change_asset_maintenance_in_logs_to_maintenance.php
index b49f21fd93..0d8b84cffa 100644
--- a/database/migrations/2025_08_10_114135_change_asset_maintenance_in_logs_to_maintenance.php
+++ b/database/migrations/2025_08_10_114135_change_asset_maintenance_in_logs_to_maintenance.php
@@ -1,9 +1,7 @@
<?php
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
use App\Models\Actionlog;
+use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
@@ -18,8 +16,5 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
- public function down(): void
- {
-
- }
+ public function down(): void {}
};
diff --git a/database/migrations/2025_08_11_181519_add_mobile_number_to_users_table.php b/database/migrations/2025_08_11_181519_add_mobile_number_to_users_table.php
index b0e0bbdd31..537fc28931 100644
--- a/database/migrations/2025_08_11_181519_add_mobile_number_to_users_table.php
+++ b/database/migrations/2025_08_11_181519_add_mobile_number_to_users_table.php
@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
- if (!Schema::hasColumn('users', 'mobile')) {
+ if (! Schema::hasColumn('users', 'mobile')) {
$table->text('mobile')->after('phone')->nullable()->default(null);
}
});
diff --git a/database/migrations/2025_08_12_225214_add_qty_to_checkout_acceptances_table.php b/database/migrations/2025_08_12_225214_add_qty_to_checkout_acceptances_table.php
index c5c7726213..ddddf77065 100644
--- a/database/migrations/2025_08_12_225214_add_qty_to_checkout_acceptances_table.php
+++ b/database/migrations/2025_08_12_225214_add_qty_to_checkout_acceptances_table.php
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class extends Migration {
+return new class extends Migration
+{
/**
* Run the migrations.
*/
diff --git a/database/migrations/2025_08_19_114742_add_display_name_to_users.php b/database/migrations/2025_08_19_114742_add_display_name_to_users.php
index d55e755d3a..9d7e0cb041 100644
--- a/database/migrations/2025_08_19_114742_add_display_name_to_users.php
+++ b/database/migrations/2025_08_19_114742_add_display_name_to_users.php
@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
- if (!Schema::hasColumn('users', 'display_name')) {
+ if (! Schema::hasColumn('users', 'display_name')) {
$table->text('display_name')->after('last_name')->nullable()->default(null);
}
});
diff --git a/database/migrations/2025_08_19_122533_add_category_indexes.php b/database/migrations/2025_08_19_122533_add_category_indexes.php
index 530a1f4398..6586e52b0c 100644
--- a/database/migrations/2025_08_19_122533_add_category_indexes.php
+++ b/database/migrations/2025_08_19_122533_add_category_indexes.php
@@ -15,19 +15,19 @@ return new class extends Migration
$table->index(['deleted_at']);
});
Schema::table('accessories', function (Blueprint $table) {
- $table->index(['deleted_at','category_id']);
+ $table->index(['deleted_at', 'category_id']);
});
Schema::table('consumables', function (Blueprint $table) {
- $table->index(['deleted_at','category_id']);
+ $table->index(['deleted_at', 'category_id']);
});
Schema::table('components', function (Blueprint $table) {
- $table->index(['deleted_at','category_id']);
+ $table->index(['deleted_at', 'category_id']);
});
Schema::table('licenses', function (Blueprint $table) {
- $table->index(['deleted_at','category_id']);
+ $table->index(['deleted_at', 'category_id']);
});
Schema::table('models', function (Blueprint $table) {
- $table->index(['deleted_at','category_id']);
+ $table->index(['deleted_at', 'category_id']);
});
}
@@ -41,19 +41,19 @@ return new class extends Migration
$table->dropIndex(['deleted_at']);
});
Schema::table('accessories', function (Blueprint $table) {
- $table->dropIndex(['deleted_at','category_id']);
+ $table->dropIndex(['deleted_at', 'category_id']);
});
Schema::table('consumables', function (Blueprint $table) {
- $table->dropIndex(['deleted_at','category_id']);
+ $table->dropIndex(['deleted_at', 'category_id']);
});
Schema::table('components', function (Blueprint $table) {
- $table->dropIndex(['deleted_at','category_id']);
+ $table->dropIndex(['deleted_at', 'category_id']);
});
Schema::table('licenses', function (Blueprint $table) {
- $table->dropIndex(['deleted_at','category_id']);
+ $table->dropIndex(['deleted_at', 'category_id']);
});
Schema::table('models', function (Blueprint $table) {
- $table->dropIndex(['deleted_at','category_id']);
+ $table->dropIndex(['deleted_at', 'category_id']);
});
}
};
diff --git a/database/migrations/2025_08_19_174823_add_display_name_to_ldap_settings.php b/database/migrations/2025_08_19_174823_add_display_name_to_ldap_settings.php
index fb980af6dd..d6fe98fa0e 100644
--- a/database/migrations/2025_08_19_174823_add_display_name_to_ldap_settings.php
+++ b/database/migrations/2025_08_19_174823_add_display_name_to_ldap_settings.php
@@ -13,27 +13,27 @@ return new class extends Migration
{
Schema::table('settings', function (Blueprint $table) {
- if (!Schema::hasColumn('settings', 'ldap_display_name')) {
+ if (! Schema::hasColumn('settings', 'ldap_display_name')) {
$table->string('ldap_display_name', 191)->after('ldap_fname_field')->nullable()->default(null);
}
- if (!Schema::hasColumn('settings', 'ldap_zip')) {
+ if (! Schema::hasColumn('settings', 'ldap_zip')) {
$table->string('ldap_zip', 191)->after('ldap_manager')->nullable()->default(null);
}
- if (!Schema::hasColumn('settings', 'ldap_state')) {
+ if (! Schema::hasColumn('settings', 'ldap_state')) {
$table->string('ldap_state', 191)->after('ldap_manager')->nullable()->default(null);
}
- if (!Schema::hasColumn('settings', 'ldap_city')) {
+ if (! Schema::hasColumn('settings', 'ldap_city')) {
$table->string('ldap_city', 191)->after('ldap_manager')->nullable()->default(null);
}
- if (!Schema::hasColumn('settings', 'ldap_address')) {
+ if (! Schema::hasColumn('settings', 'ldap_address')) {
$table->string('ldap_address', 191)->after('ldap_manager')->nullable()->default(null);
}
- if (!Schema::hasColumn('settings', 'ldap_mobile')) {
+ if (! Schema::hasColumn('settings', 'ldap_mobile')) {
$table->string('ldap_mobile', 191)->after('ldap_phone_field')->nullable()->default(null);
}
@@ -77,6 +77,5 @@ return new class extends Migration
}
});
-
}
};
diff --git a/database/migrations/2025_09_16_104604_create_users_deleted_at_location_id_index.php b/database/migrations/2025_09_16_104604_create_users_deleted_at_location_id_index.php
index 05b8474a4b..b612b0a3e7 100644
--- a/database/migrations/2025_09_16_104604_create_users_deleted_at_location_id_index.php
+++ b/database/migrations/2025_09_16_104604_create_users_deleted_at_location_id_index.php
@@ -15,7 +15,7 @@ return new class extends Migration
// We are doing 'deleted_at' *first* here because that way this index can do double-duty -
// handling queries for 'all undeleted users' as well as 'users who are deleted in this location'
// and 'users who are not-deleted in this location'
- $table->index(['deleted_at','location_id']);
+ $table->index(['deleted_at', 'location_id']);
});
}
@@ -25,7 +25,7 @@ return new class extends Migration
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
- $table->dropIndex(['deleted_at','location_id']);
+ $table->dropIndex(['deleted_at', 'location_id']);
});
}
};
diff --git a/database/migrations/2025_10_07_113331_add_url_to_maintenances.php b/database/migrations/2025_10_07_113331_add_url_to_maintenances.php
index 53b0e30dd4..570ef07ab1 100644
--- a/database/migrations/2025_10_07_113331_add_url_to_maintenances.php
+++ b/database/migrations/2025_10_07_113331_add_url_to_maintenances.php
@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('maintenances', function (Blueprint $table) {
- if (!Schema::hasColumn('maintenances', 'url')) {
+ if (! Schema::hasColumn('maintenances', 'url')) {
$table->text('url')->after('name')->nullable()->default(null);
}
});
diff --git a/database/migrations/2025_10_13_102956_move_assetmodels_files.php b/database/migrations/2025_10_13_102956_move_assetmodels_files.php
index 699a761b1f..a16ddc0dc7 100644
--- a/database/migrations/2025_10_13_102956_move_assetmodels_files.php
+++ b/database/migrations/2025_10_13_102956_move_assetmodels_files.php
@@ -14,7 +14,7 @@ return new class extends Migration
$assetmodelfiles = Storage::allFiles('private_uploads/assetmodels');
foreach ($assetmodelfiles as $file) {
- Storage::writeStream('private_uploads/models/' . basename($file),
+ Storage::writeStream('private_uploads/models/'.basename($file),
Storage::readStream($file)
);
}
diff --git a/database/migrations/2025_10_22_144927_migrate_incorrect_action_types.php b/database/migrations/2025_10_22_144927_migrate_incorrect_action_types.php
index b27ed56ef3..817fbbc1db 100644
--- a/database/migrations/2025_10_22_144927_migrate_incorrect_action_types.php
+++ b/database/migrations/2025_10_22_144927_migrate_incorrect_action_types.php
@@ -1,8 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
@@ -17,7 +15,6 @@ return new class extends Migration
* that we have a ton of people canceling requests (and only certain types of request-cancellation use this
* erroneous action_type), so I feel pretty comfortable with this fixup. Fingers crossed!
* */
-
DB::table('action_logs')->where('action_type', 'request_canceled')->update(['action_type' => 'request canceled']);
}
diff --git a/database/migrations/2025_11_04_173713_add_2d_label_prefix.php b/database/migrations/2025_11_04_173713_add_2d_label_prefix.php
index 3a8c737633..5dfd2aeace 100644
--- a/database/migrations/2025_11_04_173713_add_2d_label_prefix.php
+++ b/database/migrations/2025_11_04_173713_add_2d_label_prefix.php
@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('settings', function (Blueprint $table) {
- if (!Schema::hasColumn('settings', 'label2_2d_prefix')) {
+ if (! Schema::hasColumn('settings', 'label2_2d_prefix')) {
$table->char('label2_2d_prefix', 191)->after('label2_2d_type')->nullable()->default(null);
}
});
diff --git a/database/migrations/2025_11_10_205136_change_suppliers_notes_to_text.php b/database/migrations/2025_11_10_205136_change_suppliers_notes_to_text.php
index c50dd87445..e7a5df5c97 100644
--- a/database/migrations/2025_11_10_205136_change_suppliers_notes_to_text.php
+++ b/database/migrations/2025_11_10_205136_change_suppliers_notes_to_text.php
@@ -19,8 +19,5 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
- public function down(): void
- {
-
- }
+ public function down(): void {}
};
diff --git a/database/migrations/2025_11_10_211219_change_suppliers_notes_to_nullable.php b/database/migrations/2025_11_10_211219_change_suppliers_notes_to_nullable.php
index 23d93fbc70..fa5076b455 100644
--- a/database/migrations/2025_11_10_211219_change_suppliers_notes_to_nullable.php
+++ b/database/migrations/2025_11_10_211219_change_suppliers_notes_to_nullable.php
@@ -19,8 +19,5 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
- public function down(): void
- {
-
- }
+ public function down(): void {}
};
diff --git a/database/migrations/2025_11_14_150613_add_color_to_companies.php b/database/migrations/2025_11_14_150613_add_color_to_companies.php
index 4c730c6853..27fff7b6d1 100644
--- a/database/migrations/2025_11_14_150613_add_color_to_companies.php
+++ b/database/migrations/2025_11_14_150613_add_color_to_companies.php
@@ -12,27 +12,27 @@ return new class extends Migration
public function up(): void
{
Schema::table('companies', function (Blueprint $table) {
- $table->string('tag_color', )->after('name')->nullable()->default(null);
+ $table->string('tag_color')->after('name')->nullable()->default(null);
});
Schema::table('categories', function (Blueprint $table) {
- $table->string('tag_color', )->after('name')->nullable()->default(null);
+ $table->string('tag_color')->after('name')->nullable()->default(null);
});
Schema::table('manufacturers', function (Blueprint $table) {
- $table->string('tag_color', )->after('name')->nullable()->default(null);
+ $table->string('tag_color')->after('name')->nullable()->default(null);
});
Schema::table('suppliers', function (Blueprint $table) {
- $table->string('tag_color', )->after('name')->nullable()->default(null);
+ $table->string('tag_color')->after('name')->nullable()->default(null);
});
Schema::table('locations', function (Blueprint $table) {
- $table->string('tag_color', )->after('name')->nullable()->default(null);
+ $table->string('tag_color')->after('name')->nullable()->default(null);
});
Schema::table('departments', function (Blueprint $table) {
- $table->string('tag_color', )->after('name')->nullable()->default(null);
+ $table->string('tag_color')->after('name')->nullable()->default(null);
});
}
diff --git a/database/migrations/2025_11_18_193933_add_share_report_template_option.php b/database/migrations/2025_11_18_193933_add_share_report_template_option.php
index caa43e8699..8aa61fa0b4 100644
--- a/database/migrations/2025_11_18_193933_add_share_report_template_option.php
+++ b/database/migrations/2025_11_18_193933_add_share_report_template_option.php
@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('report_templates', function (Blueprint $table) {
- $table->boolean('is_shared', )->nullable()->default(null);
+ $table->boolean('is_shared')->nullable()->default(null);
});
}
diff --git a/database/migrations/2025_11_28_175733_add_link_colors_to_settings.php b/database/migrations/2025_11_28_175733_add_link_colors_to_settings.php
index 52fed67a5a..5c0f918be9 100644
--- a/database/migrations/2025_11_28_175733_add_link_colors_to_settings.php
+++ b/database/migrations/2025_11_28_175733_add_link_colors_to_settings.php
@@ -2,8 +2,8 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
@@ -26,7 +26,6 @@ return new class extends Migration
$table->string('nav_link_color')->after('skin')->nullable()->default('#ffffff');
});
-
// Set Snipe-IT defaults
$link_dark_color = '#89c9ed';
$link_light_color = '#296282';
@@ -36,42 +35,42 @@ return new class extends Migration
if ($setting) {
switch ($setting->skin) {
- case ('green' || 'green-dark'):
+ case 'green' || 'green-dark':
$header_color = '#00a65a';
$link_dark_color = '#9ACD32';
$link_light_color = '#00a65a';
$nav_color = '#ffffff';
break;
- case ('red' || 'red-dark'):
+ case 'red' || 'red-dark':
$header_color = '#dd4b39';
$link_dark_color = '#ed9a9a';
$link_light_color = '#dd4b39';
$nav_color = '#ffffff';
break;
- case ('orange' || 'orange-dark'):
+ case 'orange' || 'orange-dark':
$header_color = '#FF851B';
$link_dark_color = '#FFA500';
$link_light_color = '#FF8C00';
$nav_color = '#ffffff';
break;
- case ('black' || 'black-dark'):
+ case 'black' || 'black-dark':
$header_color = '#000000';
$link_dark_color = '#d4d2d2';
$link_light_color = '#454759';
$nav_color = '#ffffff';
break;
- case ('purple' || 'purple-dark'):
+ case 'purple' || 'purple-dark':
$header_color = '#605ca8';
$link_dark_color = '#AC83FF';
$link_light_color = '#605ca8';
$nav_color = '#ffffff';
break;
- case ('yellow' || 'yellow-dark') :
+ case 'yellow' || 'yellow-dark':
$header_color = '#FBCC34';
$link_dark_color = '#F0E68C';
$link_light_color = '#a69f08';
@@ -91,13 +90,12 @@ return new class extends Migration
$header_color = $setting->header_color;
}
-
DB::table('settings')->update([
'link_light_color' => $link_light_color,
'link_dark_color' => $link_dark_color,
'nav_link_color' => $nav_color,
'header_color' => $header_color]);
-
+
}
}
diff --git a/database/seeders/AccessorySeeder.php b/database/seeders/AccessorySeeder.php
index 5f4cca8cf6..ddd839d124 100644
--- a/database/seeders/AccessorySeeder.php
+++ b/database/seeders/AccessorySeeder.php
@@ -56,7 +56,6 @@ class AccessorySeeder extends Seeder
'created_by' => $admin->id,
]);
-
$src = public_path('/img/demo/accessories/');
$dst = 'accessories'.'/';
$del_files = Storage::files($dst);
diff --git a/database/seeders/AssetSeeder.php b/database/seeders/AssetSeeder.php
index 9d21e7f9fa..d6d167d4f4 100644
--- a/database/seeders/AssetSeeder.php
+++ b/database/seeders/AssetSeeder.php
@@ -15,7 +15,9 @@ use Illuminate\Support\Facades\Storage;
class AssetSeeder extends Seeder
{
private $admin;
+
private $locationIds;
+
private $supplierIds;
public function run()
@@ -52,9 +54,9 @@ class AssetSeeder extends Seeder
$del_files = Storage::files('assets');
foreach ($del_files as $del_file) { // iterate files
- Log::debug('Deleting: ' . $del_files);
+ Log::debug('Deleting: '.$del_files);
try {
- Storage::disk('public')->delete('assets' . '/' . $del_files);
+ Storage::disk('public')->delete('assets'.'/'.$del_files);
} catch (\Exception $e) {
Log::debug($e);
}
@@ -79,7 +81,7 @@ class AssetSeeder extends Seeder
private function getState()
{
- return fn($sequence) => [
+ return fn ($sequence) => [
'rtd_location_id' => $this->locationIds->random(),
'supplier_id' => $this->supplierIds->random(),
'created_by' => $this->adminuser->id,
diff --git a/database/seeders/CustomFieldSeeder.php b/database/seeders/CustomFieldSeeder.php
index 1c50ac806d..f86da6b735 100644
--- a/database/seeders/CustomFieldSeeder.php
+++ b/database/seeders/CustomFieldSeeder.php
@@ -37,7 +37,6 @@ class CustomFieldSeeder extends Seeder
CustomField::factory()->count(1)->testCheckbox()->create();
CustomField::factory()->count(1)->testRadio()->create();
-
DB::table('custom_field_custom_fieldset')->insert([
[
'custom_field_id' => '1',
diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php
index 331f105ac6..0fa1b715c4 100644
--- a/database/seeders/DatabaseSeeder.php
+++ b/database/seeders/DatabaseSeeder.php
@@ -46,7 +46,6 @@ class DatabaseSeeder extends Seeder
$this->call(ActionlogSeeder::class);
$this->call(MaintenanceSeeder::class);
-
Artisan::call('snipeit:sync-asset-locations', ['--output' => 'all']);
$output = Artisan::output();
Log::info($output);
diff --git a/database/seeders/LicenseSeeder.php b/database/seeders/LicenseSeeder.php
index 94e1e05cc1..38a59459cf 100644
--- a/database/seeders/LicenseSeeder.php
+++ b/database/seeders/LicenseSeeder.php
@@ -23,15 +23,15 @@ class LicenseSeeder extends Seeder
$categories = Category::where('category_type', 'license')->get();
- $graphicsSoftwareCategory = $categories->first(fn($category) => $category->name === 'Graphics Software');
- $officeSoftwareCategory = $categories->first(fn($category) => $category->name === 'Office Software');
+ $graphicsSoftwareCategory = $categories->first(fn ($category) => $category->name === 'Graphics Software');
+ $officeSoftwareCategory = $categories->first(fn ($category) => $category->name === 'Office Software');
- if (!$graphicsSoftwareCategory) {
+ if (! $graphicsSoftwareCategory) {
Log::info('Graphics Software category not created. Using random category for seeding.');
$graphicsSoftwareCategory = Category::inRandomOrder()->first();
}
- if (!$officeSoftwareCategory) {
+ if (! $officeSoftwareCategory) {
Log::info('Office Software category not created. Using random category for seeding.');
$officeSoftwareCategory = Category::inRandomOrder()->first();
}
diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php
index 23364836fe..975108207b 100644
--- a/database/seeders/UserSeeder.php
+++ b/database/seeders/UserSeeder.php
@@ -7,8 +7,8 @@ use App\Models\Department;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Sequence;
use Illuminate\Database\Seeder;
-use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Facades\Storage;
class UserSeeder extends Seeder
{
@@ -34,42 +34,42 @@ class UserSeeder extends Seeder
$departmentIds = Department::all()->pluck('id');
User::factory()->count(1)->firstAdmin()
- ->state(new Sequence(fn($sequence) => [
+ ->state(new Sequence(fn ($sequence) => [
'company_id' => $companyIds->random(),
'department_id' => $departmentIds->random(),
]))
->create();
User::factory()->count(1)->snipeAdmin()
- ->state(new Sequence(fn($sequence) => [
+ ->state(new Sequence(fn ($sequence) => [
'company_id' => $companyIds->random(),
'department_id' => $departmentIds->random(),
]))
->create();
User::factory()->count(1)->testAdmin()
- ->state(new Sequence(fn($sequence) => [
+ ->state(new Sequence(fn ($sequence) => [
'company_id' => $companyIds->random(),
'department_id' => $departmentIds->random(),
]))
->create();
User::factory()->count(3)->superuser()
- ->state(new Sequence(fn($sequence) => [
+ ->state(new Sequence(fn ($sequence) => [
'company_id' => $companyIds->random(),
'department_id' => $departmentIds->random(),
]))
->create();
User::factory()->count(3)->admin()
- ->state(new Sequence(fn($sequence) => [
+ ->state(new Sequence(fn ($sequence) => [
'company_id' => $companyIds->random(),
'department_id' => $departmentIds->random(),
]))
->create();
User::factory()->count(2000)->viewAssets()
- ->state(new Sequence(fn($sequence) => [
+ ->state(new Sequence(fn ($sequence) => [
'company_id' => $companyIds->random(),
'department_id' => $departmentIds->random(),
]))
@@ -109,8 +109,6 @@ class UserSeeder extends Seeder
$user->save();
$file_number++;
}
-
-
}
}