Skip to content

Commit

Permalink
Merge pull request #16 from envor/main
Browse files Browse the repository at this point in the history
dont take over volt cli
  • Loading branch information
inmanturbo committed Mar 26, 2024
2 parents 5ad55df + 229898a commit 014d7d6
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
uses: dependabot/fetch-metadata@v2.0.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to `laravel-datastore` will be documented in this file.

## v1.2.10 - 2024-03-11

### What's Changed

* migrate path by @inmanturbo in https://github.com/envor/laravel-datastore/pull/14

**Full Changelog**: https://github.com/envor/laravel-datastore/compare/v1.2.9...v1.2.10

## v1.2.9 - 2024-03-11

### What's Changed
Expand Down
5 changes: 0 additions & 5 deletions src/Concerns/HasDatastoreDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ trait HasDatastoreDriver
{
public const DEFAULT_DRIVER = Driver::SQLite;

public function owner()
{
return $this->morphTo();
}

protected static function bootHasDatastoreDriver()
{
static::creating(function (self $model) {
Expand Down
8 changes: 0 additions & 8 deletions src/Datastore.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,19 +323,11 @@ abstract protected static function makeAdminConfig(Datastore $datastore): array;

protected static function makeAdminConnection(string $name): string
{
if (static::faking()) {
config('database.connections.'.config('database.default'));
}

return 'datastore_admin_'.$name;
}

protected static function makeConnection(string $name): string
{
if (static::faking()) {
config('database.connections.'.config('database.default'));
}

return $name;
}

Expand Down
12 changes: 3 additions & 9 deletions src/DatastoreServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,11 @@ public function packageBooted()
$router->pushMiddlewareToGroup('web', DatastoreContextMiddleware::class);
$router->aliasMiddleware('datastore.context', DatastoreContextMiddleware::class);

if (class_exists('\Livewire\Volt\Volt')) {

$voltPaths = collect(\Livewire\Volt\Volt::paths())->map(function ($path) {
return $path->path;
})->toArray();

$paths = array_merge($voltPaths, [
if (class_exists('\Livewire\Volt\Volt') && (! $this->app->runningInConsole() || $this->app->runningUnitTests())) {
$paths = [
__DIR__.'/../resources/views/livewire',
__DIR__.'/../resources/views/pages',
]);

];
\Livewire\Volt\Volt::mount($paths);
}
});
Expand Down
5 changes: 5 additions & 0 deletions src/Models/Datastore.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ class Datastore extends Model implements ConfiguresDatastore
protected $casts = [
'driver' => Driver::class,
];

public function owner()
{
return $this->morphTo();
}
}

0 comments on commit 014d7d6

Please sign in to comment.