moved folders to common directory
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace App\Listeners\Updates;
|
||||
|
||||
use App\Events\UpdateFinished;
|
||||
use App\Models\Company\Company;
|
||||
use App\Models\Common\Company;
|
||||
use App\Models\Expense\Bill;
|
||||
use App\Models\Expense\BillStatus;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Listeners\Updates;
|
||||
|
||||
use App\Events\UpdateFinished;
|
||||
use App\Models\Company\Company;
|
||||
use App\Models\Common\Company;
|
||||
use Artisan;
|
||||
|
||||
class Version109 extends Listener
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Listeners\Updates;
|
||||
|
||||
use App\Events\UpdateFinished;
|
||||
use App\Models\Company\Company;
|
||||
use App\Models\Common\Company;
|
||||
use DotenvEditor;
|
||||
|
||||
class Version112 extends Listener
|
||||
|
||||
@@ -63,7 +63,7 @@ class Version119 extends Listener
|
||||
|
||||
$migrations = [
|
||||
'\App\Models\Auth\User' => 'picture',
|
||||
'\App\Models\Item\Item' => 'picture',
|
||||
'\App\Models\Common\Item' => 'picture',
|
||||
'\App\Models\Expense\Bill' => 'attachment',
|
||||
'\App\Models\Expense\BillPayment' => 'attachment',
|
||||
'\App\Models\Expense\Payment' => 'attachment',
|
||||
@@ -138,7 +138,7 @@ class Version119 extends Listener
|
||||
}
|
||||
|
||||
if (!empty($path) && Storage::exists($path)) {
|
||||
$company = \App\Models\Company\Company::find($item->company_id);
|
||||
$company = \App\Models\Common\Company::find($item->company_id);
|
||||
|
||||
$media = \App\Models\Common\Media::where('filename', '=', pathinfo(basename($path), PATHINFO_FILENAME))->first();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace App\Listeners\Updates;
|
||||
use App\Events\UpdateFinished;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
use App\Models\Company\Company;
|
||||
use App\Models\Common\Company;
|
||||
use App\Models\Expense\Bill;
|
||||
use App\Models\Income\Invoice;
|
||||
use App\Models\Setting\Category;
|
||||
|
||||
52
app/Listeners/Updates/Version127.php
Normal file
52
app/Listeners/Updates/Version127.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Updates;
|
||||
|
||||
use App\Events\UpdateFinished;
|
||||
use App\Models\Auth\Permission;
|
||||
use File;
|
||||
|
||||
class Version127 extends Listener
|
||||
{
|
||||
const ALIAS = 'core';
|
||||
|
||||
const VERSION = '1.2.7';
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handle(UpdateFinished $event)
|
||||
{
|
||||
// Check if should listen
|
||||
if (!$this->check($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update permissions
|
||||
$permissions = Permission::all();
|
||||
foreach ($permissions as $permission) {
|
||||
if (strstr($permission->name, '-companies-companies')) {
|
||||
$permission->name = str_replace('-companies-companies', '-common-companies', $permission->name);
|
||||
$permission->save();
|
||||
}
|
||||
|
||||
if (strstr($permission->name, '-items-items')) {
|
||||
$permission->name = str_replace('-items-items', '-common-items', $permission->name);
|
||||
$permission->save();
|
||||
}
|
||||
}
|
||||
|
||||
// Delete folders
|
||||
$dirs = ['dashboard', 'search', 'companies', 'items'];
|
||||
foreach ($dirs as $dir) {
|
||||
File::deleteDirectory(app_path('Filters/' . ucfirst($dir)));
|
||||
File::deleteDirectory(app_path('Http/Controllers/' . ucfirst($dir)));
|
||||
File::deleteDirectory(app_path('Http/Requests/' . ucfirst(str_singular($dir))));
|
||||
File::deleteDirectory(app_path('Transformers/' . ucfirst(str_singular($dir))));
|
||||
File::deleteDirectory(resource_path('views/' . $dir));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user