Skip to content

Commit

Permalink
Basic functionality for 4.0 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kussie authored Apr 7, 2022
1 parent be4b902 commit 0c620cb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"license": "MIT",
"require": {
"laravel/nova": "^2.0|^3.0|^4.0",
"laravel/nova": "^4.0",
"spatie/laravel-activitylog": "^3.9|^4.0"
},
"autoload": {
Expand Down
10 changes: 6 additions & 4 deletions src/NovaActivitylog.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Bolechen\NovaActivitylog;

use Illuminate\Http\Request;
use Laravel\Nova\Tool;

class NovaActivitylog extends Tool
Expand All @@ -23,12 +24,13 @@ public function boot()
}

/**
* Build the view that renders the navigation links for the tool.
* Build the menu that renders the navigation links for the tool.
*
* @return \Illuminate\View\View
* @param \Illuminate\Http\Request $request
*
* @return mixed
*/
public function renderNavigation()
public function menu(Request $request)
{
return view('nova-activitylog::navigation');
}
}
29 changes: 17 additions & 12 deletions src/Resources/Activitylog.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Bolechen\NovaActivitylog\Resources;

use Illuminate\Http\Request;
use Laravel\Nova\Fields\Code;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\MorphTo;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Resource as NovaResource;

class Activitylog extends NovaResource
Expand Down Expand Up @@ -46,7 +46,12 @@ class Activitylog extends NovaResource
*
* @var bool
*/
public static $displayInNavigation = false;
public static $displayInNavigation = true;

public static function group()
{
return __('Activity Logs');
}

/**
* Label for display.
Expand Down Expand Up @@ -83,11 +88,11 @@ public static function newModel()
/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
*
* @return array
*/
public function fields(Request $request)
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
Expand All @@ -106,47 +111,47 @@ public function fields(Request $request)
/**
* Get the cards available for the request.
*
* @param \Illuminate\Http\Request $request
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
*
* @return array
*/
public function cards(Request $request)
public function cards(NovaRequest $request)
{
return [];
}

/**
* Get the filters available for the resource.
*
* @param \Illuminate\Http\Request $request
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
*
* @return array
*/
public function filters(Request $request)
public function filters(NovaRequest $request)
{
return [];
}

/**
* Get the lenses available for the resource.
*
* @param \Illuminate\Http\Request $request
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
*
* @return array
*/
public function lenses(Request $request)
public function lenses(NovaRequest $request)
{
return [];
}

/**
* Get the actions available for the resource.
*
* @param \Illuminate\Http\Request $request
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
*
* @return array
*/
public function actions(Request $request)
public function actions(NovaRequest $request)
{
return [];
}
Expand Down

0 comments on commit 0c620cb

Please sign in to comment.