Skip to content
This repository was archived by the owner on Feb 4, 2024. It is now read-only.

Commit 7b9c3df

Browse files
Fix
2 parents 223e967 + 02409ff commit 7b9c3df

File tree

10 files changed

+16
-19
lines changed

10 files changed

+16
-19
lines changed

app/Http/Controllers/Company/Store.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
namespace App\Http\Controllers\Company;
44

5-
use App\Jobs\Tenant\CreateDBs;
5+
use App\Jobs\Tenant\CreateDB;
6+
use App\Jobs\Tenant\Migration;
67
use App\Jobs\Tenant\Migrations;
78
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
89
use Illuminate\Routing\Controller;
@@ -42,9 +43,9 @@ public function __invoke(ValidateCompany $request, Company $company)
4243
$c->save();
4344

4445
}
45-
CreateDBs::dispatch($company, $user_id);
46+
CreateDB::dispatch($company, $user_id);
4647
// $company = Company::find($company->id);
47-
Migrations::dispatch($company, $user_id, $person_name, $user_email);
48+
Migration::dispatch($company, $user_id, $person_name, $user_email);
4849
return [
4950
'message' => __('The company was successfully created'),
5051
'redirect' => 'administration.companies.edit',
@@ -53,5 +54,6 @@ public function __invoke(ValidateCompany $request, Company $company)
5354
}else{
5455
return ['error' => __('Unauthorized')];
5556
}
57+
5658
}
5759
}

app/Jobs/Tenant/Migrations.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function handle()
7373
$em = $this->email;
7474
$na = $this->name;
7575
$person = $tenants->run(function () use ($em, $na) {
76-
return Person::create([
76+
return Person::create([
7777
'email'=>$em,
7878
'name' => $na,
7979

@@ -82,7 +82,7 @@ public function handle()
8282
\Log::debug($person);
8383
\Log::debug('person created');
8484
$user_group = 1;
85-
$user_group = $tenants->run(function () use ($em, $na) {
85+
$user_group = $tenants->run(function () {
8686
return UserGroup::create([
8787
'name'=>'Administrators',
8888
'description' => 'Administrator users group',
@@ -91,7 +91,7 @@ public function handle()
9191
});
9292
// get role_id
9393
// $role = 1;
94-
$role = $tenants->run(function () use ($em, $na) {
94+
$role = $tenants->run(function () {
9595
return Role::create([
9696
'name'=>'Admin',
9797
'menu_id '=>null,

app/Models/Company.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
class Company extends CoreCompany
1111
{
1212
use CreatedBy;
13-
1413
}

app/Models/Person.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ public static function bootUpdatedBy()
147147

148148
public function setUpdatedBy()
149149
{
150-
if (!is_dir(storage_path('app/public'))) {
150+
if (! is_dir(storage_path('app/public'))) {
151151
// dir doesn't exist, make it
152-
\File::makeDirectory(storage_path().'/'.'app/public',0777,true);
152+
\File::makeDirectory(storage_path().'/'.'app/public', 0777, true);
153153

154154
// mkdir(storage_path('app/public/'), 0700);
155155
}

app/Traits/CreatedBy.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function createdBy(): Relation
2121
return $this->belongsTo($userModel, 'created_by');
2222
}
2323

24-
private function setCreatedBy($value=1)
24+
private function setCreatedBy($value = 1)
2525
{
2626
// if($value==''){
2727
// if (Auth::check()) {
@@ -30,8 +30,8 @@ private function setCreatedBy($value=1)
3030
// }else{
3131
$this->created_by = 1;
3232
// }
33-
3433
}
34+
3535
public static function bootUpdatedBy()
3636
{
3737
self::creating(fn ($model) => $model->setUpdatedBy());
@@ -51,8 +51,7 @@ private function setUpdatedBy($value=null)
5151
// $this->updated_by = Auth::id();
5252
// }
5353
// }else{
54-
$this->updated_by = $value;
54+
$this->updated_by = $value;
5555
// }
56-
5756
}
5857
}

app/Traits/TenantConnectionResolver.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public function getConnectionName()
2222
}
2323
}
2424

25-
2625
return $this->connection;
2726
}
2827
}

config/cors.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
'allowed_methods' => ['*'],
2121

2222
'allowed_origins' => [
23-
'http://pusher.com',
23+
'http://pusher.com',
2424
'https://pusher.com',
2525
'http://localhost:8080',
2626
'http://localhost:3000',
2727
'http://localhost:8000',
2828
'https://familytree365.com',
2929
'https://api.familytree365.com',
30-
'https://www.familytree365.com',],
30+
'https://www.familytree365.com', ],
3131

3232
'allowed_origins_patterns' => [],
3333

database/migrations/tenant/2017_01_01_113000_create_avatars_table.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
class CreateAvatarsTable extends Migration
88
{
99
public function up()
10-
1110
{
1211
Schema::create('avatars', function (Blueprint $table) {
1312
$table->increments('id');

database/migrations/tenant/2018_08_25_100000_create_files_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function up()
1616
$table->integer('type_id')->default(0);
1717
$table->string('original_name')->index();
1818
$table->string('saved_name')->index();
19-
// $table->string('path');
19+
// $table->string('path');
2020

2121
$table->integer('size');
2222
$table->string('mime_type')->nullable();

routes/api.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,6 @@
14551455
Route::get('trees/options', [TreesManage::class, 'getOptions']);
14561456
});
14571457

1458-
14591458
//Route::get('test/{cid}', function($cid){
14601459
// session('current_company_id', $cid);
14611460
// retrun success;

0 commit comments

Comments
 (0)