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

[5.2] Allow the detach method to accept a collection #14412

Merged
merged 1 commit into from
Jul 21, 2016
Merged

[5.2] Allow the detach method to accept a collection #14412

merged 1 commit into from
Jul 21, 2016

Conversation

arjasco
Copy link
Contributor

@arjasco arjasco commented Jul 21, 2016

As the title says!

@GrahamCampbell GrahamCampbell changed the title Allow the detach method to accept a collection [5.2] Allow the detach method to accept a collection Jul 21, 2016
@GrahamCampbell
Copy link
Member

The fact you changed the method signature (event just the phpdoc) means this is probably better targeted at L5.3.

* @param bool $touch
* @return int
*/
public function detach($ids = [], $touch = true)
{
if ($ids instanceof Model) {
$ids = (array) $ids->getKey();
$ids = $ids->getKey();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this no longer an array?

@arjasco
Copy link
Contributor Author

arjasco commented Jul 21, 2016

This behaviour already exists for attach. The id var isn't been casted 3 times either haha. Can go for 5.3 if you really think so. Cherry pick this commit and submit pull request again?

@taylorotwell taylorotwell merged commit 9d853b9 into laravel:5.2 Jul 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants