-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from crynobone/nova5
Nova 5 Integration
- Loading branch information
Showing
25 changed files
with
566 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
* text=auto | ||
|
||
# Ignore following folder/file. | ||
/.github export-ignore | ||
/tests export-ignore | ||
/workbench export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/testbench.yaml export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
laravel: '@testbench' | ||
|
||
providers: | ||
- Laravel\Nova\NovaServiceProvider | ||
- Laravel\Nova\NovaCoreServiceProvider | ||
- Workbench\App\Providers\NovaServiceProvider | ||
- Spatie\Permission\PermissionServiceProvider | ||
- Sereny\NovaPermissions\ToolServiceProvider | ||
# - Workbench\App\Providers\WorkbenchServiceProvider | ||
|
||
migrations: true | ||
|
||
seeders: | ||
- Workbench\Database\Seeders\DatabaseSeeder | ||
- Workbench\Database\Seeders\RolesAndPermissionsSeeder | ||
|
||
workbench: | ||
start: /nova | ||
build: | ||
- package:discover | ||
- asset-publish | ||
- create-sqlite-db | ||
- db:wipe | ||
- migrate:refresh | ||
assets: | ||
- migrations | ||
- nova-assets | ||
sync: [] | ||
|
||
purge: | ||
directories: | ||
- lang/* | ||
- public/vendor/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace Workbench\App\Models; | ||
|
||
// use Illuminate\Contracts\Auth\MustVerifyEmail; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Foundation\Auth\User as Authenticatable; | ||
use Illuminate\Notifications\Notifiable; | ||
use Laravel\Sanctum\HasApiTokens; | ||
use Spatie\Permission\Traits\HasRoles; | ||
|
||
class User extends Authenticatable | ||
{ | ||
use HasFactory, HasRoles, Notifiable; | ||
|
||
/** | ||
* The attributes that are mass assignable. | ||
* | ||
* @var array<int, string> | ||
*/ | ||
protected $fillable = [ | ||
'name', | ||
'email', | ||
'password', | ||
]; | ||
|
||
/** | ||
* The attributes that should be hidden for serialization. | ||
* | ||
* @var array<int, string> | ||
*/ | ||
protected $hidden = [ | ||
'password', | ||
'remember_token', | ||
]; | ||
|
||
/** | ||
* The attributes that should be cast. | ||
* | ||
* @var array<string, string> | ||
*/ | ||
protected $casts = [ | ||
'email_verified_at' => 'datetime', | ||
'password' => 'hashed', | ||
]; | ||
|
||
/** | ||
* Determine if user is super admin. | ||
*/ | ||
public function isSuperAdmin(): bool | ||
{ | ||
return in_array($this->email, ['nova@laravel.com']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Workbench\App\Nova; | ||
|
||
use Illuminate\Contracts\Database\Eloquent\Builder; | ||
use Laravel\Nova\Http\Requests\NovaRequest; | ||
use Laravel\Nova\Resource as NovaResource; | ||
use Laravel\Scout\Builder as ScoutBuilder; | ||
|
||
abstract class Resource extends NovaResource | ||
{ | ||
/** | ||
* Build an "index" query for the given resource. | ||
*/ | ||
public static function indexQuery(NovaRequest $request, Builder $query): Builder | ||
{ | ||
return $query; | ||
} | ||
|
||
/** | ||
* Build a Scout search query for the given resource. | ||
*/ | ||
public static function scoutQuery(NovaRequest $request, ScoutBuilder $query): ScoutBuilder | ||
{ | ||
return $query; | ||
} | ||
|
||
/** | ||
* Build a "detail" query for the given resource. | ||
*/ | ||
public static function detailQuery(NovaRequest $request, Builder $query): Builder | ||
{ | ||
return parent::detailQuery($request, $query); | ||
} | ||
|
||
/** | ||
* Build a "relatable" query for the given resource. | ||
* | ||
* This query determines which instances of the model may be attached to other resources. | ||
*/ | ||
public static function relatableQuery(NovaRequest $request, Builder $query): Builder | ||
{ | ||
return parent::relatableQuery($request, $query); | ||
} | ||
} |
Oops, something went wrong.