Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated namespace references and method adjustments for better compatibility #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,304 changes: 2,111 additions & 1,193 deletions composer.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions config/laracombee.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
|
*/

'timeout' => 2000,
'timeout' => 5000,

/*
|--------------------------------------------------------------------------
Expand All @@ -46,6 +46,6 @@
|
*/

'user' => app(\App\User::class),
'user' => app(\App\Models\User::class),
'item' => '',
];
];
6 changes: 3 additions & 3 deletions src/Console/Commands/AddColumnsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Amranidev\Laracombee\Console\Commands;

use Laracombee;
use Amranidev\Laracombee\Facades\LaracombeeFacade;
use Amranidev\Laracombee\Console\LaracombeeCommand;

class AddColumnsCommand extends LaracombeeCommand
Expand Down Expand Up @@ -45,7 +45,7 @@ public function handle()
exit;
}

Laracombee::batch($this->loadColumns($this->argument('columns'))->all())
LaracombeeFacade::batch($this->loadColumns($this->argument('columns'))->all())
->then(function ($response) {
$this->info('Done!');
})
Expand All @@ -70,4 +70,4 @@ public function loadColumns(array $columns)
return $this->{'add'.ucfirst($this->option('to')).'Property'}($property, $type);
});
}
}
}
6 changes: 3 additions & 3 deletions src/Console/Commands/DropColumnsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Amranidev\Laracombee\Console\Commands;

use Laracombee;
use Amranidev\Laracombee\Facades\LaracombeeFacade;
use Amranidev\Laracombee\Console\LaracombeeCommand;

class DropColumnsCommand extends LaracombeeCommand
Expand Down Expand Up @@ -45,7 +45,7 @@ public function handle()
exit;
}

Laracombee::batch($this->loadColumns($this->argument('columns'))->all())
LaracombeeFacade::batch($this->loadColumns($this->argument('columns'))->all())
->then(function ($response) {
$this->info('Done!');
})
Expand All @@ -68,4 +68,4 @@ public function loadColumns(array $columns)
return $this->{'delete'.ucfirst($this->option('from')).'Property'}($column);
});
}
}
}
6 changes: 3 additions & 3 deletions src/Console/Commands/MigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Amranidev\Laracombee\Console\Commands;

use Laracombee;
use Amranidev\Laracombee\Facades\LaracombeeFacade;
use Amranidev\Laracombee\Console\LaracombeeCommand;

class MigrateCommand extends LaracombeeCommand
Expand Down Expand Up @@ -41,7 +41,7 @@ public function handle()
{
$scope = $this->prepareScope()->all();

Laracombee::batch($scope)
LaracombeeFacade::batch($scope)
->then(function ($response) {
$this->info('Done!');
})
Expand All @@ -66,4 +66,4 @@ public function prepareScope()
return $this->{'add'.ucfirst($this->argument('type')).'Property'}($property, $type);
});
}
}
}
8 changes: 4 additions & 4 deletions src/Console/Commands/ResetDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Amranidev\Laracombee\Console\Commands;

use Laracombee;
use Amranidev\Laracombee\Facades\LaracombeeFacade;
use Amranidev\Laracombee\Console\LaracombeeCommand;

class ResetDatabaseCommand extends LaracombeeCommand
Expand Down Expand Up @@ -39,12 +39,12 @@ public function __construct()
public function handle()
{
if ($this->confirm('All your recombee data will be erased, including items, item properties, series, user database, purchases, ratings, detail views, and bookmarks. Make sure the request to be never executed in production environment! Resetting your database is irreversible. Are you sure?')) {
$request = Laracombee::resetDatabase();
Laracombee::send($request)->then(function ($response) {
$request = LaracombeeFacade::resetDatabase();
LaracombeeFacade::send($request)->then(function ($response) {
$this->info('Recombee data has been erased!');
})->otherwise(function ($error) {
$this->error($error);
})->wait();
}
}
}
}
6 changes: 3 additions & 3 deletions src/Console/Commands/RollbackCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Amranidev\Laracombee\Console\Commands;

use Laracombee;
use Amranidev\Laracombee\Facades\LaracombeeFacade;
use Amranidev\Laracombee\Console\LaracombeeCommand;

class RollbackCommand extends LaracombeeCommand
Expand Down Expand Up @@ -41,7 +41,7 @@ public function handle()
{
$scope = $this->prepareScope()->all();

Laracombee::batch($scope)
LaracombeeFacade::batch($scope)
->then(function ($response) {
$this->info('Done!');
})
Expand All @@ -66,4 +66,4 @@ public function prepareScope()
return $this->{'delete'.ucfirst($this->argument('type')).'Property'}($property, $type);
});
}
}
}
6 changes: 3 additions & 3 deletions src/Console/Commands/SeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Amranidev\Laracombee\Console\Commands;

use Laracombee;
use Amranidev\Laracombee\Facades\LaracombeeFacade;
use Illuminate\Console\Command;
use Amranidev\Laracombee\Console\LaracombeeCommand;

Expand Down Expand Up @@ -67,7 +67,7 @@ public function handle()

$records->chunk($chunk)->each(function ($users) use ($bar) {
$batch = $this->{'add'.ucfirst($this->argument('type')).'s'}($users->all());
Laracombee::batch($batch)->then(function ($response) {
LaracombeeFacade::batch($batch)->then(function ($response) {
})->otherwise(function ($error) {
$this->info('');
$this->error($error);
Expand All @@ -82,4 +82,4 @@ public function handle()
$this->info('');
$this->info('Done!');
}
}
}
20 changes: 10 additions & 10 deletions src/Console/LaracombeeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Amranidev\Laracombee\Console;

use Laracombee;
use Amranidev\Laracombee\Facades\LaracombeeFacade;
use Illuminate\Console\Command;
use Illuminate\Foundation\Auth\User;
use Illuminate\Database\Eloquent\Model;
Expand All @@ -29,7 +29,7 @@ public function __construct()
*/
public function addUserProperty(string $property, string $type)
{
return Laracombee::addUserProperty($property, $type);
return LaracombeeFacade::addUserProperty($property, $type);
}

/**
Expand All @@ -42,7 +42,7 @@ public function addUserProperty(string $property, string $type)
*/
public function addItemProperty(string $property, string $type)
{
return Laracombee::addItemProperty($property, $type);
return LaracombeeFacade::addItemProperty($property, $type);
}

/**
Expand All @@ -54,7 +54,7 @@ public function addItemProperty(string $property, string $type)
*/
public function deleteUserProperty(string $property)
{
return Laracombee::deleteUserProperty($property);
return LaracombeeFacade::deleteUserProperty($property);
}

/**
Expand All @@ -66,7 +66,7 @@ public function deleteUserProperty(string $property)
*/
public function deleteItemProperty(string $property)
{
return Laracombee::deleteItemProperty($property);
return LaracombeeFacade::deleteItemProperty($property);
}

/**
Expand All @@ -78,7 +78,7 @@ public function deleteItemProperty(string $property)
*/
public function addUser(User $user)
{
return Laracombee::addUser($user);
return LaracombeeFacade::addUser($user);
}

/**
Expand All @@ -90,7 +90,7 @@ public function addUser(User $user)
*/
public function addItem(Model $item)
{
return Laracombee::addItem($item);
return LaracombeeFacade::addItem($item);
}

/**
Expand All @@ -102,7 +102,7 @@ public function addItem(Model $item)
*/
public function addUsers(array $batch)
{
return Laracombee::addUsers($batch);
return LaracombeeFacade::addUsers($batch);
}

/**
Expand All @@ -114,6 +114,6 @@ public function addUsers(array $batch)
*/
public function addItems(array $batch)
{
return Laracombee::addItems($batch);
return LaracombeeFacade::addItems($batch);
}
}
}
Loading
Loading