Skip to content

Commit

Permalink
nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed May 23, 2017
1 parent 9a9305e commit a8c08e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,10 @@
# Changelog

All Notable changes to `laravel-tags` will be documented in this file
All notable changes to `laravel-tags` will be documented in this file

## 1.4.0 - 2017-05-25

- add `syncWithType`

## 1.3.5 - 2017-02-13

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -74,11 +74,11 @@ Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview

## Postcardware

You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using.
You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.
All postcards are published [on our website](https://spatie.be/en/opensource/postcards).

## Requirements

Expand Down
4 changes: 3 additions & 1 deletion src/HasTags.php
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use InvalidArgumentException;

trait HasTags
{
Expand Down Expand Up @@ -181,7 +182,7 @@ protected static function convertToTags($values, $type = null, $locale = null)
return collect($values)->map(function ($value) use ($type, $locale) {
if ($value instanceof Tag) {
if (isset($type) && $value->type != $type) {
throw new \InvalidArgumentException("Type was set to {$type} but tag is of type {$value->type}");
throw new InvalidArgumentException("Type was set to {$type} but tag is of type {$value->type}");
}

return $value;
Expand All @@ -195,6 +196,7 @@ protected static function convertToTags($values, $type = null, $locale = null)

/**
* Use in place of eloquent's sync() method so that the tag type may be optionally specified.
*
* @param $ids
* @param string|null $type
* @param bool $detaching
Expand Down

0 comments on commit a8c08e1

Please sign in to comment.