Skip to content

Commit 44d126e

Browse files
committed
Merge branch 'develop'
2 parents 63eb577 + 16018bf commit 44d126e

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

src/Console/stubs/repository.model.stub

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,14 @@ class DummyClass extends Repository {
8585
public function delete($id) {
8686
// return $this->repository->findOrFail($id)->delete();
8787
}
88+
89+
/**
90+
* Destroy the models for the given IDs.
91+
*
92+
* @param \Illuminate\Support\Collection|array|int $ids
93+
* @return int
94+
*/
95+
public static function destroy($ids) {
96+
//
97+
}
8898
}

src/Contracts/Model.php

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,12 @@ public function update(array $attributes = []);
5757
public function delete($id);
5858

5959
/**
60-
* Get the value of the model's route key.
60+
* Destroy the models for the given IDs.
6161
*
62-
* @return mixed
62+
* @param \Illuminate\Support\Collection|array|int $ids
63+
* @return int
6364
*/
64-
public function getRouteKey();
65-
66-
/**
67-
* Get the route key for the model.
68-
*
69-
* @return string
70-
*/
71-
public function getRouteKeyName();
72-
73-
/**
74-
* Retrieve the model for a bound value.
75-
*
76-
* @param mixed $value
77-
* @return \Illuminate\Database\Eloquent\Model|null
78-
*/
79-
public function resolveRouteBinding($value);
80-
81-
/**
82-
* Convert the object into something JSON serializable.
83-
*
84-
* @return array
85-
*/
86-
public function jsonSerialize();
65+
public static function destroy($ids);
8766

8867
/**
8968
* Convert the model to its string representation.

src/Repositories/Model.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
namespace PPSpaces\Repositories;
44

5+
use JsonSerializable;
6+
use Illuminate\Support\Traits\ForwardsCalls;
7+
use Illuminate\Contracts\Routing\UrlRoutable;
58
use PPSpaces\Contracts\Model as RepositoryContract;
69

7-
abstract class Model implements RepositoryContract {
10+
abstract class Model implements RepositoryContract, JsonSerializable, UrlRoutable {
11+
12+
use ForwardsCalls;
813

914
/**
1015
* The repository instance.
@@ -85,6 +90,16 @@ public function delete($id) {
8590
return $this->repository->findOrFail($id)->delete();
8691
}
8792

93+
/**
94+
* Destroy the models for the given IDs.
95+
*
96+
* @param \Illuminate\Support\Collection|array|int $ids
97+
* @return int
98+
*/
99+
public static function destroy($ids) {
100+
//
101+
}
102+
88103
/**
89104
* Get the value of the model's route key.
90105
*

0 commit comments

Comments
 (0)