Skip to content

Commit

Permalink
Fixing pivot for users
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Nov 29, 2013
1 parent e23f1f1 commit f0f07b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function assets()

public function licenses()
{
return $this->belongsToMany('License', 'license_seats', 'assigned_to', 'license_id')->withTrashed();
return $this->belongsToMany('License', 'license_seats', 'assigned_to', 'license_id')->withTrashed()->withPivot('id');
}


Expand Down
2 changes: 1 addition & 1 deletion app/validators.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

Validator::extend('alpha_space', function($attribute,$value,$parameters)
{
return preg_match("/^[-+:?()_,!. a-zA-Z0-9]+$/",$value);
return preg_match("/^[-+:?'()_,!. a-zA-Z0-9]+$/",$value);
});
4 changes: 2 additions & 2 deletions app/views/backend/users/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
</td>
<td><a href="{{ route('view/license', $license->id) }}">{{ $license->serial }}</a></td>
<td><a href="{{ route('view/license', $license->id) }}">{{ $license->name }}</a></td>

<td> <a href="{{ route('checkin/license', $license->id) }}" class="btn-flat info">Checkin</a></td>
<td> <a href="{{ route('checkin/license', $license->pivot->id) }}" class="btn-flat info">Checkin</a>
</td>
</tr>
@endforeach
</tbody>
Expand Down

0 comments on commit f0f07b5

Please sign in to comment.