Skip to content

Commit

Permalink
Add bindings for eloquent collection and nav trees (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell authored Sep 7, 2023
1 parent ef1fd2b commit b4bad3f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"require": {
"php": "^8.0",
"statamic/cms": "^4.16"
"statamic/cms": "^4.21"
},
"require-dev": {
"doctrine/dbal": "^3.3",
Expand Down
8 changes: 8 additions & 0 deletions src/Structures/CollectionTreeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Statamic\Eloquent\Structures;

use Statamic\Contracts\Structures\CollectionTree as CollectionTreeContract;
use Statamic\Contracts\Structures\Tree as TreeContract;
use Statamic\Facades\Blink;
use Statamic\Stache\Repositories\CollectionTreeRepository as StacheRepository;
Expand Down Expand Up @@ -29,4 +30,11 @@ public function save($entry)

$entry->model($model->fresh());
}

public static function bindings()
{
return [
CollectionTreeContract::class => CollectionTree::class,
];
}
}
8 changes: 8 additions & 0 deletions src/Structures/NavTreeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Statamic\Eloquent\Structures;

use Statamic\Contracts\Structures\NavTree as NavTreeContract;
use Statamic\Contracts\Structures\Tree as TreeContract;
use Statamic\Facades\Blink;
use Statamic\Stache\Repositories\NavTreeRepository as StacheRepository;
Expand Down Expand Up @@ -44,4 +45,11 @@ public function delete($entry)

$entry->model()->delete();
}

public static function bindings()
{
return [
NavTreeContract::class => NavTree::class,
];
}
}

0 comments on commit b4bad3f

Please sign in to comment.