1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Working on Client Uploads

This commit is contained in:
David Bomba 2019-08-08 18:13:32 +10:00
parent 5ea1ac6fd2
commit 37e8f41bff
3 changed files with 11 additions and 8 deletions

View File

@ -61,9 +61,11 @@ class DocumentController extends Controller
Log::error($path); Log::error($path);
Log::error($url); Log::error($url);
tap((auth()->user())->update([ $contact = auth()->user();
tap($contact)->update([
'avatar' => $url, 'avatar' => $url,
])); ]);
/* /*
[2019-08-07 05:50:23] local.ERROR: array ( [2019-08-07 05:50:23] local.ERROR: array (

View File

@ -22,6 +22,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Laracasts\Presenter\PresentableTrait; use Laracasts\Presenter\PresentableTrait;
use Illuminate\Support\Facades\Log;
class ClientContact extends Authenticatable class ClientContact extends Authenticatable
@ -80,12 +81,14 @@ class ClientContact extends Authenticatable
return $this->encodePrimaryKey($this->id); return $this->encodePrimaryKey($this->id);
} }
public function setAvatarAttribute() public function setAvatarAttribute($value)
{ {
if(!filter_var($this->attributes['avatar'], FILTER_VALIDATE_URL))
return url('/') . $this->attributes['avatar']; if(!filter_var($value, FILTER_VALIDATE_URL))
$this->attributes['avatar'] = url('/') . $value;
else else
return $this->attributes['avatar']; $this->attributes['avatar'] = $value;
} }
public function client() public function client()

View File

@ -1,2 +0,0 @@
*
!.gitignore