Shift cleanup

This commit is contained in:
Laravel Shift 2021-06-10 20:19:27 +00:00
parent 9838c0c2ef
commit b62d1f49e4
64 changed files with 128 additions and 194 deletions

View file

@ -74,7 +74,6 @@ class ObjectImportCommand extends Command
$this->comment('All Items imported successfully!');
}
$this->comment('');
}
public function errorCallback($item, $field, $errorString)

View file

@ -80,7 +80,6 @@ class ItemImportRequest extends FormRequest
public function progress($count)
{
// Open for future
}
public function errorCallback($item, $field, $errorString)

View file

@ -53,6 +53,5 @@ class ConsumableImporter extends ItemImporter
return;
}
$this->logError($consumable, 'Consumable');
}
}

View file

@ -106,7 +106,6 @@ class UserImporter extends ItemImporter
}
$this->logError($user, 'User');
}
/**

View file

@ -2,10 +2,10 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Acceptable;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Storage;
use Watson\Validating\ValidatingTrait;
@ -120,7 +120,6 @@ class Accessory extends SnipeModel
$value = null;
}
$this->attributes['requestable'] = filter_var($value, FILTER_VALIDATE_BOOLEAN);
}
/**

View file

@ -2,10 +2,10 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Carbon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Auth;
@ -23,7 +23,6 @@ class Actionlog extends SnipeModel
use SoftDeletes;
use Presentable;
protected $table = 'action_logs';
public $timestamps = true;
protected $fillable = ['created_at', 'item_type', 'user_id', 'item_id', 'action_type', 'note', 'target_id', 'target_type'];

View file

@ -2,7 +2,6 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Events\AssetCheckedOut;
use App\Events\CheckoutableCheckedOut;
use App\Exceptions\CheckoutNotAllowed;
@ -16,6 +15,7 @@ use Auth;
use Carbon\Carbon;
use DB;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Storage;
use Watson\Validating\ValidatingTrait;
@ -70,7 +70,6 @@ class Asset extends Depreciable
// We set these as protected dates so that they will be easily accessible via Carbon
protected $casts = [
'purchase_date' => 'datetime',
'last_checkout' => 'datetime',
@ -442,7 +441,7 @@ class Asset extends Depreciable
*/
public function assignedAssets()
{
return $this->morphMany(\App\Models\Asset::class, 'assigned', 'assigned_type', 'assigned_to')->withTrashed();
return $this->morphMany(self::class, 'assigned', 'assigned_type', 'assigned_to')->withTrashed();
}
/**

View file

@ -2,9 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Helpers\Helper;
use App\Models\Traits\Searchable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
@ -17,7 +17,6 @@ use Watson\Validating\ValidatingTrait;
class AssetMaintenance extends Model implements ICompanyableChild
{
use HasFactory;
use SoftDeletes;
use CompanyableChildTrait;
use ValidatingTrait;

View file

@ -2,9 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Storage;
use Watson\Validating\ValidatingTrait;
@ -18,7 +18,6 @@ use Watson\Validating\ValidatingTrait;
class AssetModel extends SnipeModel
{
use HasFactory;
use SoftDeletes;
protected $presenter = \App\Presenters\AssetModelPresenter::class;
use Requestable, Presentable;

View file

@ -2,10 +2,10 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Gate;
use Watson\Validating\ValidatingTrait;

View file

@ -2,11 +2,11 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Auth;
use DB;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Support\Facades\Gate;
use Watson\Validating\ValidatingTrait;

View file

@ -2,9 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;

View file

@ -2,10 +2,10 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Acceptable;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Storage;
use Watson\Validating\ValidatingTrait;
@ -111,7 +111,6 @@ class Consumable extends SnipeModel
$value = null;
}
$this->attributes['requestable'] = filter_var($value, FILTER_VALIDATE_BOOLEAN);
}
/**

View file

@ -2,9 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Http\Traits\UniqueUndeletedTrait;
use EasySlugger\Utf8Slugger;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Validation\Rule;
use Schema;
@ -13,7 +13,6 @@ use Watson\Validating\ValidatingTrait;
class CustomField extends Model
{
use HasFactory;
use ValidatingTrait,
UniqueUndeletedTrait;

View file

@ -2,15 +2,14 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Gate;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait;
class CustomFieldset extends Model
{
use HasFactory;
use ValidatingTrait;
protected $guarded = ['id'];

View file

@ -2,9 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\Traits\Searchable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Watson\Validating\ValidatingTrait;
class Department extends SnipeModel

View file

@ -2,9 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Watson\Validating\ValidatingTrait;
class Depreciation extends SnipeModel

View file

@ -2,8 +2,8 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Searchable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Watson\Validating\ValidatingTrait;
class Group extends SnipeModel

View file

@ -2,11 +2,11 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Carbon\Carbon;
use DB;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
@ -26,7 +26,6 @@ class License extends Depreciable
// We set these as protected dates so that they will be easily accessible via Carbon
public $timestamps = true;
protected $guarded = 'id';

View file

@ -2,7 +2,6 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\Asset;
use App\Models\SnipeModel;
@ -10,6 +9,7 @@ use App\Models\Traits\Searchable;
use App\Models\User;
use App\Presenters\Presentable;
use DB;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Gate;
@ -131,7 +131,7 @@ class Location extends SnipeModel
public function parent()
{
return $this->belongsTo(\App\Models\Location::class, 'parent_id', 'id')
return $this->belongsTo(self::class, 'parent_id', 'id')
->with('parent');
}
@ -142,7 +142,7 @@ class Location extends SnipeModel
public function children()
{
return $this->hasMany(\App\Models\Location::class, 'parent_id')
return $this->hasMany(self::class, 'parent_id')
->with('children');
}

View file

@ -2,9 +2,9 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Gate;
use Watson\Validating\ValidatingTrait;

View file

@ -17,7 +17,6 @@ use Watson\Validating\ValidatingTrait;
class Setting extends Model
{
use HasFactory;
use Notifiable, ValidatingTrait;
/**

View file

@ -14,7 +14,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['purchase_date'] = $value;
}
/**
@ -28,7 +27,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['purchase_cost'] = $value;
}
public function setLocationIdAttribute($value)
@ -37,7 +35,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['location_id'] = $value;
}
public function setCategoryIdAttribute($value)
@ -47,7 +44,6 @@ class SnipeModel extends Model
}
$this->attributes['category_id'] = $value;
// dd($this->attributes);
}
public function setSupplierIdAttribute($value)
@ -56,7 +52,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['supplier_id'] = $value;
}
public function setDepreciationIdAttribute($value)
@ -65,7 +60,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['depreciation_id'] = $value;
}
public function setManufacturerIdAttribute($value)
@ -74,7 +68,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['manufacturer_id'] = $value;
}
public function setMinAmtAttribute($value)
@ -83,7 +76,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['min_amt'] = $value;
}
public function setParentIdAttribute($value)
@ -92,7 +84,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['parent_id'] = $value;
}
public function setFieldSetIdAttribute($value)
@ -101,7 +92,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['fieldset_id'] = $value;
}
public function setCompanyIdAttribute($value)
@ -110,7 +100,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['company_id'] = $value;
}
public function setWarrantyMonthsAttribute($value)
@ -119,7 +108,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['warranty_months'] = $value;
}
public function setRtdLocationIdAttribute($value)
@ -128,7 +116,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['rtd_location_id'] = $value;
}
public function setDepartmentIdAttribute($value)
@ -137,7 +124,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['department_id'] = $value;
}
public function setManagerIdAttribute($value)
@ -146,7 +132,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['manager_id'] = $value;
}
public function setModelIdAttribute($value)
@ -155,7 +140,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['model_id'] = $value;
}
public function setStatusIdAttribute($value)
@ -164,7 +148,6 @@ class SnipeModel extends Model
$value = null;
}
$this->attributes['status_id'] = $value;
}
//

View file

@ -2,16 +2,15 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\Traits\Searchable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
class Statuslabel extends SnipeModel
{
use HasFactory;
use SoftDeletes;
use ValidatingTrait;
use UniqueUndeletedTrait;

View file

@ -2,16 +2,15 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\Traits\Searchable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
class Supplier extends SnipeModel
{
use HasFactory;
use SoftDeletes;
protected $table = 'suppliers';

View file

@ -2,7 +2,6 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
@ -14,6 +13,7 @@ use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Contracts\Translation\HasLocalePreference;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Notifications\Notifiable;
@ -330,7 +330,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
*/
public function userlog()
{
return $this->hasMany(\App\Models\Actionlog::class, 'target_id')->where('target_type', '=', \App\Models\User::class)->orderBy('created_at', 'DESC')->withTrashed();
return $this->hasMany(\App\Models\Actionlog::class, 'target_id')->where('target_type', '=', self::class)->orderBy('created_at', 'DESC')->withTrashed();
}
/**
@ -370,7 +370,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
*/
public function manager()
{
return $this->belongsTo(\App\Models\User::class, 'manager_id')->withTrashed();
return $this->belongsTo(self::class, 'manager_id')->withTrashed();
}
/**

View file

@ -2,10 +2,10 @@
namespace App\Providers;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Http\Request;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
@ -28,8 +28,6 @@ class RouteServiceProvider extends ServiceProvider
});
}
/**
* Define the "web" routes for the application.
*

View file

@ -1,7 +1,8 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------

View file

@ -2,13 +2,12 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\Company;
use App\Models\Location;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
$factory->defineAs(App\Models\Actionlog::class, 'asset-upload', function ($faker) {
$asset = \App\Models\Asset::factory()->create();

View file

@ -2,10 +2,10 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\Category;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------
@ -16,27 +16,6 @@ use App\Models\Category;
|
*/
// These are just for unit tests, not to generate data
class AssetFactory extends Factory

View file

@ -2,10 +2,10 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\Asset;
use App\Models\AssetModel;
use App\Models\Category;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------

View file

@ -1,7 +1,8 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------
@ -38,33 +39,24 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| Conference Phones
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| Tablets
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| Mobile Phones
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| Displays

View file

@ -1,7 +1,8 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------

View file

@ -13,7 +13,6 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\Company;
@ -21,6 +20,7 @@ use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Statuslabel;
use App\Models\Supplier;
use Illuminate\Database\Eloquent\Factories\Factory;
class CompanyFactory extends Factory
{

View file

@ -1,7 +1,8 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------

View file

@ -1,7 +1,8 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------

View file

@ -1,5 +1,7 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class CustomFieldFactory extends Factory

View file

@ -1,5 +1,7 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class CustomFieldsetFactory extends Factory

View file

@ -1,7 +1,8 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------

View file

@ -1,7 +1,8 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------

View file

@ -13,7 +13,6 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\Company;
@ -21,6 +20,7 @@ use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Statuslabel;
use App\Models\Supplier;
use Illuminate\Database\Eloquent\Factories\Factory;
class GroupFactory extends Factory
{

View file

@ -1,7 +1,8 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------
@ -12,7 +13,6 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
*/
// 1
// 2

View file

@ -13,7 +13,6 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\Company;
@ -21,6 +20,7 @@ use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Statuslabel;
use App\Models\Supplier;
use Illuminate\Database\Eloquent\Factories\Factory;
class LocationFactory extends Factory
{

View file

@ -1,7 +1,8 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------
@ -12,7 +13,6 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
*/
// 1
// 2

View file

@ -13,7 +13,6 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\Company;
@ -21,6 +20,7 @@ use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Statuslabel;
use App\Models\Supplier;
use Illuminate\Database\Eloquent\Factories\Factory;
class SettingFactory extends Factory
{

View file

@ -2,8 +2,8 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\Statuslabel;
use Illuminate\Database\Eloquent\Factories\Factory;
class StatuslabelFactory extends Factory
{

View file

@ -13,7 +13,6 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\Company;
@ -21,6 +20,7 @@ use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\Statuslabel;
use App\Models\Supplier;
use Illuminate\Database\Eloquent\Factories\Factory;
class SupplierFactory extends Factory
{

View file

@ -2,52 +2,23 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\Company;
use Illuminate\Database\Eloquent\Factories\Factory;
$password = bcrypt('password');
// USER GLOBAL PERMISSION STATES
// USER ASSET PERMISSION STATES
// USER ACCESSORY PERMISSION STATES
// USER CONSUMABLE PERMISSION STATES
// USER LICENSE PERMISSION STATES
// USER COMPONENTS PERMISSION STATES
// USER USER PERMISSION STATES
class UserFactory extends Factory

View file

@ -4,6 +4,9 @@ namespace Database\Seeders;
use App\Models\Accessory;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class AccessorySeeder extends Seeder
{
@ -22,22 +25,22 @@ class AccessorySeeder extends Seeder
foreach ($del_files as $del_file) { // iterate files
$file_to_delete = str_replace($src, '', $del_file);
\Log::debug('Deleting: '.$file_to_delete);
Log::debug('Deleting: '.$file_to_delete);
try {
Storage::disk('public')->delete($dst.$del_file);
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
$add_files = glob($src.'/*.*');
foreach ($add_files as $add_file) {
$file_to_copy = str_replace($src, '', $add_file);
\Log::debug('Copying: '.$file_to_copy);
Log::debug('Copying: '.$file_to_copy);
try {
Storage::disk('public')->put($dst.$file_to_copy, file_get_contents($src.$file_to_copy));
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
}

View file

@ -4,6 +4,7 @@ namespace Database\Seeders;
use App\Models\AssetModel;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class AssetModelSeeder extends Seeder
@ -48,22 +49,22 @@ class AssetModelSeeder extends Seeder
foreach ($del_files as $del_file) { // iterate files
$file_to_delete = str_replace($src, '', $del_file);
\Log::debug('Deleting: '.$file_to_delete);
Log::debug('Deleting: '.$file_to_delete);
try {
Storage::disk('public')->delete($dst.$del_file);
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
$add_files = glob($src.'/*.*');
foreach ($add_files as $add_file) {
$file_to_copy = str_replace($src, '', $add_file);
\Log::debug('Copying: '.$file_to_copy);
Log::debug('Copying: '.$file_to_copy);
try {
Storage::disk('public')->put($dst.$file_to_copy, file_get_contents($src.$file_to_copy));
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
}

View file

@ -4,6 +4,8 @@ namespace Database\Seeders;
use App\Models\Asset;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class AssetSeeder extends Seeder
@ -39,11 +41,11 @@ 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);
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}

View file

@ -4,6 +4,8 @@ namespace Database\Seeders;
use App\Models\Company;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class CompanySeeder extends Seeder
{
@ -14,7 +16,7 @@ class CompanySeeder extends Seeder
*/
public function run()
{
\Log::debug('Seed companies');
Log::debug('Seed companies');
Company::truncate();
Company::factory()->count(4)->create();
@ -24,22 +26,22 @@ class CompanySeeder extends Seeder
foreach ($del_files as $del_file) { // iterate files
$file_to_delete = str_replace($src, '', $del_file);
\Log::debug('Deleting: '.$file_to_delete);
Log::debug('Deleting: '.$file_to_delete);
try {
Storage::disk('public')->delete($dst.$del_file);
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
$add_files = glob($src.'/*.*');
foreach ($add_files as $add_file) {
$file_to_copy = str_replace($src, '', $add_file);
\Log::debug('Copying: '.$file_to_copy);
Log::debug('Copying: '.$file_to_copy);
try {
Storage::disk('public')->put($dst.$file_to_copy, file_get_contents($src.$file_to_copy));
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
}

View file

@ -4,6 +4,7 @@ namespace Database\Seeders;
use App\Models\Component;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class ComponentSeeder extends Seeder
{

View file

@ -4,6 +4,7 @@ namespace Database\Seeders;
use App\Models\Consumable;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class ConsumableSeeder extends Seeder
{

View file

@ -6,6 +6,7 @@ use App\Models\CustomField;
use App\Models\CustomFieldset;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class CustomFieldSeeder extends Seeder

View file

@ -2,18 +2,21 @@
namespace Database\Seeders;
use Database\Seeders\CustomFieldSeeder;
use Database\Seeders\ConsumableSeeder;
use Database\Seeders\ComponentSeeder;
use Database\Seeders\CompanySeeder;
use Database\Seeders\CategorySeeder;
use Database\Seeders\AssetSeeder;
use Database\Seeders\AssetModelSeeder;
use Database\Seeders\ActionlogSeeder;
use Database\Seeders\AccessorySeeder;
use App\Models\Setting;
use Database\Seeders\AccessorySeeder;
use Database\Seeders\ActionlogSeeder;
use Database\Seeders\AssetModelSeeder;
use Database\Seeders\AssetSeeder;
use Database\Seeders\CategorySeeder;
use Database\Seeders\CompanySeeder;
use Database\Seeders\ComponentSeeder;
use Database\Seeders\ConsumableSeeder;
use Database\Seeders\CustomFieldSeeder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class DatabaseSeeder extends Seeder
{
@ -53,7 +56,7 @@ class DatabaseSeeder extends Seeder
Artisan::call('snipeit:sync-asset-locations', ['--output' => 'all']);
$output = Artisan::output();
\Log::info($output);
Log::info($output);
Model::reguard();

View file

@ -4,6 +4,7 @@ namespace Database\Seeders;
use App\Models\Location;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class LocationSeeder extends Seeder
@ -19,22 +20,22 @@ class LocationSeeder extends Seeder
foreach ($del_files as $del_file) { // iterate files
$file_to_delete = str_replace($src, '', $del_file);
\Log::debug('Deleting: '.$file_to_delete);
Log::debug('Deleting: '.$file_to_delete);
try {
Storage::disk('public')->delete($dst.$del_file);
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
$add_files = glob($src.'/*.*');
foreach ($add_files as $add_file) {
$file_to_copy = str_replace($src, '', $add_file);
\Log::debug('Copying: '.$file_to_copy);
Log::debug('Copying: '.$file_to_copy);
try {
Storage::disk('public')->put($dst.$file_to_copy, file_get_contents($src.$file_to_copy));
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
}

View file

@ -4,6 +4,7 @@ namespace Database\Seeders;
use App\Models\Manufacturer;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class ManufacturerSeeder extends Seeder
@ -29,22 +30,22 @@ class ManufacturerSeeder extends Seeder
foreach ($del_files as $del_file) { // iterate files
$file_to_delete = str_replace($src, '', $del_file);
\Log::debug('Deleting: '.$file_to_delete);
Log::debug('Deleting: '.$file_to_delete);
try {
Storage::disk('public')->delete($dst.$del_file);
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
$add_files = glob($src.'/*.*');
foreach ($add_files as $add_file) {
$file_to_copy = str_replace($src, '', $add_file);
\Log::debug('Copying: '.$file_to_copy);
Log::debug('Copying: '.$file_to_copy);
try {
Storage::disk('public')->put($dst.$file_to_copy, file_get_contents($src.$file_to_copy));
} catch (\Exception $e) {
\Log::debug($e);
Log::debug($e);
}
}
}

View file

@ -5,6 +5,7 @@ namespace Database\Seeders;
use App\Models\Setting;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Storage;
class SettingsSeeder extends Seeder
{

View file

@ -1,9 +1,8 @@
<?php
use App\Http\Controllers\Api;
use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------

View file

@ -1,15 +1,13 @@
<?php
use App\Http\Controllers\SuppliersController;
use App\Http\Controllers\StatuslabelsController;
use App\Http\Controllers\DepreciationsController;
use App\Http\Controllers\DepartmentsController;
use App\Http\Controllers\CompaniesController;
use App\Http\Controllers\CategoriesController;
use App\Http\Controllers\Account;
use App\Http\Controllers\ActionlogController;
use App\Http\Controllers\Auth;
use App\Http\Controllers\CategoriesController;
use App\Http\Controllers\CompaniesController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\DepartmentsController;
use App\Http\Controllers\DepreciationsController;
use App\Http\Controllers\GroupsController;
use App\Http\Controllers\HealthController;
use App\Http\Controllers\ImportsController;
@ -19,6 +17,8 @@ use App\Http\Controllers\ModalController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\ReportsController;
use App\Http\Controllers\SettingsController;
use App\Http\Controllers\StatuslabelsController;
use App\Http\Controllers\SuppliersController;
use App\Http\Controllers\ViewAssetsController;
use Illuminate\Support\Facades\Route;

View file

@ -3,6 +3,7 @@
use App\Http\Controllers\CustomFieldsController;
use App\Http\Controllers\CustomFieldsetsController;
use Illuminate\Support\Facades\Route;
/*
* Custom Fields Routes
*/

View file

@ -3,6 +3,7 @@
use App\Http\Controllers\AssetMaintenancesController;
use App\Http\Controllers\Assets;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Asset Routes

View file

@ -14,7 +14,7 @@ use App\Models\Manufacturer;
use App\Models\Supplier;
use App\Models\User;
/**
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)