Skip to content

Commit

Permalink
Merge pull request #78 from tipoff/huntermontell/feature/update-data-…
Browse files Browse the repository at this point in the history
…fields-nova-resources

Data fields on nova resources #42
  • Loading branch information
drewroberts authored Mar 18, 2021
2 parents 345d986 + 4d713e4 commit f3f134c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Models/GmbDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GmbDetail extends BaseModel
use HasCreator;
use HasUpdater;

public $timestamps = false;
const UPDATED_AT = null;

public function location()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Models/GmbHour.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GmbHour extends BaseModel
use HasCreator;
use HasUpdater;

public $timestamps = false;
const UPDATED_AT = null;

public function location()
{
Expand Down
10 changes: 4 additions & 6 deletions src/Nova/GmbDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Illuminate\Http\Request;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
Expand Down Expand Up @@ -64,10 +63,9 @@ public function fields(Request $request)

protected function dataFields(): array
{
return [
ID::make(),
DateTime::make('Created At')->exceptOnForms(),
nova('user') ? BelongsTo::make('Creator', 'creator', nova('user'))->exceptOnForms() : null,
];
return array_merge(
parent::dataFields(),
$this->creatorDataFields(),
);
}
}
10 changes: 4 additions & 6 deletions src/Nova/GmbHour.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Illuminate\Http\Request;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
Expand Down Expand Up @@ -69,10 +68,9 @@ public function fields(Request $request)

protected function dataFields(): array
{
return [
ID::make(),
DateTime::make('Created At')->exceptOnForms(),
nova('user') ? BelongsTo::make('Creator', 'creator', nova('user'))->exceptOnForms() : null,
];
return array_merge(
parent::dataFields(),
$this->creatorDataFields(),
);
}
}

0 comments on commit f3f134c

Please sign in to comment.