Skip to content

Commit

Permalink
updates date parsing for latest enso-ui filters
Browse files Browse the repository at this point in the history
  • Loading branch information
aocneanu committed Nov 8, 2019
1 parent bfbe974 commit 15ea161
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/Http/Requests/ValidatePersonRequest.php
Expand Up @@ -23,7 +23,7 @@ public function rules()
'uid' => ['string', 'nullable', $this->uidUnique()],
'email' => ['email', 'nullable', $this->emailUnique()],
'phone' => 'max:30|nullable',
'birthday' => 'nullable',
'birthday' => 'nullable|date',
'bank' => 'string|nullable',
'bank_account' => 'string|nullable',
'position' => 'integer|nullable',
Expand Down
11 changes: 2 additions & 9 deletions src/app/Models/Person.php
Expand Up @@ -2,7 +2,6 @@

namespace LaravelEnso\People\app\Models;

use Carbon\Carbon;
use LaravelEnso\Core\app\Models\User;
use Illuminate\Database\Eloquent\Model;
use LaravelEnso\People\app\Enums\Titles;
Expand All @@ -12,15 +11,14 @@
use LaravelEnso\TrackWho\app\Traits\CreatedBy;
use LaravelEnso\TrackWho\app\Traits\UpdatedBy;
use LaravelEnso\Addresses\app\Traits\Addressable;
use LaravelEnso\Helpers\app\Traits\DateAttributes;
use LaravelEnso\DynamicMethods\app\Traits\Relations;
use LaravelEnso\Rememberable\app\Traits\Rememberable;
use LaravelEnso\Helpers\app\Traits\AvoidsDeletionConflicts;

class Person extends Model
{
use Addressable, AvoidsDeletionConflicts, CreatedBy, DateAttributes,
Relations, Rememberable, TableCache, UpdatedBy;
use Addressable, AvoidsDeletionConflicts, CreatedBy, Relations,
Rememberable, TableCache, UpdatedBy;

protected $fillable = [
'title', 'name', 'appellative', 'uid', 'email', 'phone', 'birthday',
Expand Down Expand Up @@ -70,11 +68,6 @@ public function position(Company $company)
->first()->pivot->position;
}

public function setBirthdayAttribute($value)
{
$this->fillDateAttribute('birthday', $value);
}

public function syncCompanies($companyIds, $mainCompanyId)
{
$pivotIds = collect($companyIds)
Expand Down

0 comments on commit 15ea161

Please sign in to comment.