Some code cleanup and fixes.

This commit is contained in:
James Cole
2014-08-10 11:30:14 +02:00
parent c50a9b4b04
commit fbd056104a
27 changed files with 145 additions and 91 deletions

View File

@@ -96,7 +96,9 @@ class EloquentAccountRepository implements AccountRepositoryInterface
public function findByName($name, \AccountType $type = null)
{
$type = is_null($type) ? \AccountType::where('description', 'Default account')->first() : $type;
return \Auth::user()->accounts()->where('account_type_id',$type->id)->where('name', 'like', '%' . $name . '%')->first();
return \Auth::user()->accounts()->where('account_type_id', $type->id)->where('name', 'like', '%' . $name . '%')
->first();
}
/**