Skip to content

Commit

Permalink
Update DatabaseSettingStore.php
Browse files Browse the repository at this point in the history
Remove `throwAnyException` in `DatabaseSettingStore`
  • Loading branch information
michaelnabil230 authored May 9, 2022
1 parent 2ced598 commit e0c16df
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/Stores/DatabaseSettingStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Cache\CacheManager;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Schema;

/**
*
Expand Down Expand Up @@ -70,26 +69,12 @@ class DatabaseSettingStore extends AbstractStore
*/
public function postOptions($options = [])
{
$this->throwAnyException($options['model']);
$this->model = $options['model'];
$this->cache = $this->app['cache'];
$this->enableCache = $options['cache']['enableCache'] ?: true;
$this->cacheTtl = $options['cache']['cacheTtl'] ?: 15;
}

/**
* Throw any Exception first.
*
* @return void
*/
private function throwAnyException($model)
{
$table = app($model)->getTable();
if (! Schema::hasTable($table)) {
throw new Exception('You have to migrate first to be able to use the package');
}
}

/**
* Write the data into the store.
*
Expand Down

0 comments on commit e0c16df

Please sign in to comment.