diff --git a/resources/views/partials/update-assets.blade.php b/resources/views/partials/update-assets.blade.php
index bcac63b92..c2236d2af 100644
--- a/resources/views/partials/update-assets.blade.php
+++ b/resources/views/partials/update-assets.blade.php
@@ -1,4 +1,4 @@
-@if(!\Orchid\Platform\Dashboard::assetsAreCurrent())
+@if(!\Orchid\Platform\Orchid::assetsAreCurrent())
diff --git a/resources/views/workspace/compact.blade.php b/resources/views/workspace/compact.blade.php
index 76e75e8dc..81cd7706e 100644
--- a/resources/views/workspace/compact.blade.php
+++ b/resources/views/workspace/compact.blade.php
@@ -1,4 +1,4 @@
-@extends('platform::app')
+@extends('orchid::app')
@section('body')
@@ -6,7 +6,7 @@
@yield('workspace')
- @includeFirst([config('platform.template.footer'), 'platform::footer'])
+ @includeFirst([config('orchid.template.footer'), 'orchid::footer'])
diff --git a/resources/views/workspace/full.blade.php b/resources/views/workspace/full.blade.php
index 5e32553c5..5dc76b2fc 100644
--- a/resources/views/workspace/full.blade.php
+++ b/resources/views/workspace/full.blade.php
@@ -1,4 +1,4 @@
-@extends('platform::app')
+@extends('orchid::app')
@section('body')
@@ -6,7 +6,7 @@
@yield('workspace')
- @includeFirst([config('platform.template.footer'), 'platform::footer'])
+ @includeFirst([config('orchid.template.footer'), 'orchid::footer'])
diff --git a/routes/auth.php b/routes/auth.php
index c8dcdbd1b..79dbe33f8 100644
--- a/routes/auth.php
+++ b/routes/auth.php
@@ -6,7 +6,7 @@
use Orchid\Platform\Http\Controllers\LoginController;
// Auth web routes
-if (config('platform.auth', true)) {
+if (config('orchid.auth', true)) {
// Authentication Routes...
Route::get('login', [LoginController::class, 'showLoginForm'])->name('login');
Route::middleware('throttle:60,1')
diff --git a/routes/dashboard.php b/routes/orchid.php
similarity index 94%
rename from routes/dashboard.php
rename to routes/orchid.php
index 79d06144e..a4eb32a0a 100644
--- a/routes/dashboard.php
+++ b/routes/orchid.php
@@ -15,11 +15,11 @@
// Index and default...
Route::get('/', [IndexController::class, 'index'])
->name('index')
- ->breadcrumbs(fn (Trail $trail) => $trail->push(__('Home'), route('platform.index')));
+ ->breadcrumbs(fn (Trail $trail) => $trail->push(__('Home'), route('orchid.index')));
Route::screen('search/{query}', SearchScreen::class)
->name('search')
- ->breadcrumbs(fn (Trail $trail, string $query) => $trail->parent('platform.index')
+ ->breadcrumbs(fn (Trail $trail, string $query) => $trail->parent('orchid.index')
->push(__('Search'))
->push($query));
@@ -56,7 +56,7 @@
if (config('platform.notifications.enabled', true)) {
Route::screen('notifications/{id?}', NotificationScreen::class)
->name('notifications')
- ->breadcrumbs(fn (Trail $trail) => $trail->parent('platform.index')
+ ->breadcrumbs(fn (Trail $trail) => $trail->parent('orchid.index')
->push(__('Notifications')));
Route::post('api/notifications', [NotificationScreen::class, 'unreadNotification'])
diff --git a/src/Access/Impersonation.php b/src/Access/Impersonation.php
index de68f3f58..2628a7c74 100644
--- a/src/Access/Impersonation.php
+++ b/src/Access/Impersonation.php
@@ -78,7 +78,7 @@ public static function isImpersonating(): bool
protected static function getAuth()
{
// Get the authentication guard specified in the config file
- return Auth::guard(config('platform.guard'));
+ return Auth::guard(config('orchid.guard'));
}
/**
diff --git a/src/Access/RoleAccess.php b/src/Access/RoleAccess.php
index e15520339..54aea4fde 100644
--- a/src/Access/RoleAccess.php
+++ b/src/Access/RoleAccess.php
@@ -8,7 +8,7 @@
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\Models\User;
trait RoleAccess
@@ -52,7 +52,7 @@ public function getUsers(): Collection
*/
public function users(): BelongsToMany
{
- return $this->belongsToMany(Dashboard::model(User::class), 'role_users', 'role_id', 'user_id');
+ return $this->belongsToMany(Orchid::model(User::class), 'role_users', 'role_id', 'user_id');
}
/**
diff --git a/src/Access/StatusAccess.php b/src/Access/StatusAccess.php
index fc3fa20cc..efdbb8ded 100644
--- a/src/Access/StatusAccess.php
+++ b/src/Access/StatusAccess.php
@@ -5,7 +5,7 @@
namespace Orchid\Access;
use Illuminate\Support\Collection;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
trait StatusAccess
{
@@ -13,7 +13,7 @@ public function getStatusPermission(): Collection
{
$permissions = $this->permissions ?? [];
- return Dashboard::getPermission()
+ return Orchid::getPermission()
->transform(static fn ($group) => collect($group)->sortBy('description')
->map(static function ($value) use ($permissions) {
$slug = $value['slug'];
diff --git a/src/Access/UserAccess.php b/src/Access/UserAccess.php
index 25e3e664c..4b640cbf0 100644
--- a/src/Access/UserAccess.php
+++ b/src/Access/UserAccess.php
@@ -12,7 +12,7 @@
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\Events\AddRoleEvent;
use Orchid\Platform\Events\RemoveRoleEvent;
use Orchid\Platform\Models\Role;
@@ -36,7 +36,7 @@ public function getRoles()
public function roles(): BelongsToMany
{
- return $this->belongsToMany(Dashboard::model(Role::class), 'role_users', 'user_id', 'role_id');
+ return $this->belongsToMany(Orchid::model(Role::class), 'role_users', 'user_id', 'role_id');
}
/**
diff --git a/src/Attachment/Attachable.php b/src/Attachment/Attachable.php
index 74980f278..7f5713f3d 100644
--- a/src/Attachment/Attachable.php
+++ b/src/Attachment/Attachable.php
@@ -6,7 +6,7 @@
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Orchid\Attachment\Models\Attachment;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
/**
* This trait is used to relate or attach multiple files with Eloquent models.
@@ -23,7 +23,7 @@ trait Attachable
public function attachment(?string $group = null): MorphToMany
{
$query = $this->morphToMany(
- Dashboard::model(Attachment::class),
+ Orchid::model(Attachment::class),
'attachmentable',
'attachmentable',
'attachmentable_id',
diff --git a/src/Attachment/File.php b/src/Attachment/File.php
index f4604d09f..e55aae129 100644
--- a/src/Attachment/File.php
+++ b/src/Attachment/File.php
@@ -13,7 +13,7 @@
use Orchid\Attachment\Contracts\Engine;
use Orchid\Attachment\Engines\Generator;
use Orchid\Attachment\Models\Attachment;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\Events\ReplicateFileEvent;
use Orchid\Platform\Events\UploadFileEvent;
@@ -65,11 +65,11 @@ public function __construct(UploadedFile $file, ?string $disk = null, ?string $g
abort_if($file->getSize() === false, 415, 'File failed to load.');
$this->file = $file;
- $this->disk = $disk ?? config('platform.attachment.disk', 'public'); // get the disk to use from the config or use the default 'public' disk
+ $this->disk = $disk ?? config('orchid.attachment.disk', 'public'); // get the disk to use from the config or use the default 'public' disk
$this->storage = Storage::disk($this->disk);
/** @var string $generator */
- $generator = config('platform.attachment.generator', Generator::class);
+ $generator = config('orchid.attachment.generator', Generator::class);
// Create a new engine class instance to manage the file's associations
$this->engine = new $generator($file);
@@ -131,7 +131,7 @@ private function getMatchesHash()
return null;
}
- return Dashboard::model(Attachment::class)::where('hash', $this->engine->hash())
+ return Orchid::model(Attachment::class)::where('hash', $this->engine->hash())
->where('disk', $this->disk)
->first();
}
@@ -147,7 +147,7 @@ private function save(): Model
'mime_type' => $this->engine->mime(),
]);
- $attachment = Dashboard::model(Attachment::class)::create([
+ $attachment = Orchid::model(Attachment::class)::create([
'name' => $this->engine->name(),
'mime' => $this->engine->mime(),
'hash' => $this->engine->hash(),
diff --git a/src/Attachment/Models/Attachment.php b/src/Attachment/Models/Attachment.php
index 0f3beda5d..12b0623ec 100644
--- a/src/Attachment/Models/Attachment.php
+++ b/src/Attachment/Models/Attachment.php
@@ -17,7 +17,7 @@
use Orchid\Filters\Filterable;
use Orchid\Filters\Types\Like;
use Orchid\Platform\Concerns\Sortable;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\Models\User;
use Orchid\Screen\AsSource;
@@ -98,7 +98,7 @@ public function getSortColumnName(): string
public function user(): BelongsTo
{
- return $this->belongsTo(Dashboard::model(User::class));
+ return $this->belongsTo(Orchid::model(User::class));
}
/**
@@ -172,7 +172,7 @@ public function delete()
*/
public function relationships()
{
- return $this->hasMany(Dashboard::model(Attachmentable::class), 'attachment_id');
+ return $this->hasMany(Orchid::model(Attachmentable::class), 'attachment_id');
}
/**
diff --git a/src/Platform/Commands/AdminCommand.php b/src/Platform/Commands/AdminCommand.php
index cbd5ee6ef..ce494cae7 100644
--- a/src/Platform/Commands/AdminCommand.php
+++ b/src/Platform/Commands/AdminCommand.php
@@ -8,7 +8,7 @@
use Illuminate\Console\Command;
use Illuminate\Database\QueryException;
use Orchid\Platform\Models\User;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
class AdminCommand extends Command
{
@@ -54,7 +54,7 @@ public function handle(): void
*/
protected function createNewUser(): void
{
- Dashboard::modelClass(User::class)
+ Orchid::modelClass(User::class)
->createAdmin(
$this->argument('name') ?? $this->ask('What is your name?', 'admin'),
$this->argument('email') ?? $this->ask('What is your email?', 'admin@admin.com'),
@@ -73,10 +73,10 @@ protected function createNewUser(): void
*/
protected function updateUserPermissions(string $id): void
{
- Dashboard::modelClass(User::class)
+ Orchid::modelClass(User::class)
->findOrFail($id)
->forceFill([
- 'permissions' => Dashboard::getAllowAllPermission(),
+ 'permissions' => Orchid::getAllowAllPermission(),
])
->save();
diff --git a/src/Platform/Commands/ChartCommand.php b/src/Platform/Commands/ChartCommand.php
index 6269cb992..8fb6ea71e 100644
--- a/src/Platform/Commands/ChartCommand.php
+++ b/src/Platform/Commands/ChartCommand.php
@@ -5,7 +5,7 @@
namespace Orchid\Platform\Commands;
use Illuminate\Console\GeneratorCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class ChartCommand extends GeneratorCommand
{
@@ -35,7 +35,7 @@ class ChartCommand extends GeneratorCommand
*/
protected function getStub(): string
{
- return Dashboard::path('stubs/chart.stub');
+ return Orchid::path('stubs/chart.stub');
}
/**
diff --git a/src/Platform/Commands/FilterCommand.php b/src/Platform/Commands/FilterCommand.php
index d115c4bee..3b77704d5 100644
--- a/src/Platform/Commands/FilterCommand.php
+++ b/src/Platform/Commands/FilterCommand.php
@@ -5,7 +5,7 @@
namespace Orchid\Platform\Commands;
use Illuminate\Console\GeneratorCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class FilterCommand extends GeneratorCommand
{
@@ -35,7 +35,7 @@ class FilterCommand extends GeneratorCommand
*/
protected function getStub(): string
{
- return Dashboard::path('stubs/filters.stub');
+ return Orchid::path('stubs/filters.stub');
}
/**
diff --git a/src/Platform/Commands/InstallCommand.php b/src/Platform/Commands/InstallCommand.php
index fb0160b83..061c51738 100644
--- a/src/Platform/Commands/InstallCommand.php
+++ b/src/Platform/Commands/InstallCommand.php
@@ -6,7 +6,7 @@
use Illuminate\Console\Command;
use Illuminate\Support\Facades\App;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\Events\InstallEvent;
use Orchid\Platform\Providers\ConsoleServiceProvider;
@@ -34,7 +34,7 @@ class InstallCommand extends Command
public function handle()
{
$this->comment('Installation started. Please wait...');
- $this->info('Version: '.Dashboard::VERSION);
+ $this->info('Version: '.Orchid::VERSION);
$this
->executeCommand('vendor:publish', [
@@ -96,7 +96,7 @@ private function changeUserModel(string $path = 'Models/User.php'): self
return $this;
}
- $user = file_get_contents(Dashboard::path('stubs/app/User.stub'));
+ $user = file_get_contents(Orchid::path('stubs/app/User.stub'));
file_put_contents(app_path($path), $user);
return $this;
diff --git a/src/Platform/Commands/ListenerCommand.php b/src/Platform/Commands/ListenerCommand.php
index dc8db27aa..3ef46a133 100644
--- a/src/Platform/Commands/ListenerCommand.php
+++ b/src/Platform/Commands/ListenerCommand.php
@@ -5,7 +5,7 @@
namespace Orchid\Platform\Commands;
use Illuminate\Console\GeneratorCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class ListenerCommand extends GeneratorCommand
{
@@ -35,7 +35,7 @@ class ListenerCommand extends GeneratorCommand
*/
protected function getStub(): string
{
- return Dashboard::path('stubs/listener.stub');
+ return Orchid::path('stubs/listener.stub');
}
/**
diff --git a/src/Platform/Commands/PresenterCommand.php b/src/Platform/Commands/PresenterCommand.php
index 78ddfa918..8445c3dd6 100644
--- a/src/Platform/Commands/PresenterCommand.php
+++ b/src/Platform/Commands/PresenterCommand.php
@@ -5,7 +5,7 @@
namespace Orchid\Platform\Commands;
use Illuminate\Console\GeneratorCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class PresenterCommand extends GeneratorCommand
{
@@ -35,7 +35,7 @@ class PresenterCommand extends GeneratorCommand
*/
protected function getStub(): string
{
- return Dashboard::path('stubs/presenter.stub');
+ return Orchid::path('stubs/presenter.stub');
}
/**
diff --git a/src/Platform/Commands/RowsCommand.php b/src/Platform/Commands/RowsCommand.php
index 3d29a5246..dfff45bd7 100644
--- a/src/Platform/Commands/RowsCommand.php
+++ b/src/Platform/Commands/RowsCommand.php
@@ -5,7 +5,7 @@
namespace Orchid\Platform\Commands;
use Illuminate\Console\GeneratorCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class RowsCommand extends GeneratorCommand
{
@@ -35,7 +35,7 @@ class RowsCommand extends GeneratorCommand
*/
protected function getStub(): string
{
- return Dashboard::path('stubs/rows.stub');
+ return Orchid::path('stubs/rows.stub');
}
/**
diff --git a/src/Platform/Commands/ScreenCommand.php b/src/Platform/Commands/ScreenCommand.php
index a9f98cb40..1fe116cd2 100644
--- a/src/Platform/Commands/ScreenCommand.php
+++ b/src/Platform/Commands/ScreenCommand.php
@@ -5,7 +5,7 @@
namespace Orchid\Platform\Commands;
use Illuminate\Console\GeneratorCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class ScreenCommand extends GeneratorCommand
{
@@ -35,7 +35,7 @@ class ScreenCommand extends GeneratorCommand
*/
protected function getStub(): string
{
- return Dashboard::path('stubs/screen.stub');
+ return Orchid::path('stubs/screen.stub');
}
/**
diff --git a/src/Platform/Commands/SelectionCommand.php b/src/Platform/Commands/SelectionCommand.php
index 6e032c0b4..823fcb81c 100644
--- a/src/Platform/Commands/SelectionCommand.php
+++ b/src/Platform/Commands/SelectionCommand.php
@@ -5,7 +5,7 @@
namespace Orchid\Platform\Commands;
use Illuminate\Console\GeneratorCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class SelectionCommand extends GeneratorCommand
{
@@ -35,7 +35,7 @@ class SelectionCommand extends GeneratorCommand
*/
protected function getStub(): string
{
- return Dashboard::path('stubs/selection.stub');
+ return Orchid::path('stubs/selection.stub');
}
/**
diff --git a/src/Platform/Commands/TabMenuCommand.php b/src/Platform/Commands/TabMenuCommand.php
index 3af4d9d99..fa7b95465 100644
--- a/src/Platform/Commands/TabMenuCommand.php
+++ b/src/Platform/Commands/TabMenuCommand.php
@@ -5,7 +5,7 @@
namespace Orchid\Platform\Commands;
use Illuminate\Console\GeneratorCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class TabMenuCommand extends GeneratorCommand
{
@@ -35,7 +35,7 @@ class TabMenuCommand extends GeneratorCommand
*/
protected function getStub(): string
{
- return Dashboard::path('stubs/tabMenu.stub');
+ return Orchid::path('stubs/tabMenu.stub');
}
/**
diff --git a/src/Platform/Commands/TableCommand.php b/src/Platform/Commands/TableCommand.php
index 3dc45bee5..569a216ad 100644
--- a/src/Platform/Commands/TableCommand.php
+++ b/src/Platform/Commands/TableCommand.php
@@ -5,7 +5,7 @@
namespace Orchid\Platform\Commands;
use Illuminate\Console\GeneratorCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class TableCommand extends GeneratorCommand
{
@@ -35,7 +35,7 @@ class TableCommand extends GeneratorCommand
*/
protected function getStub(): string
{
- return Dashboard::path('stubs/table.stub');
+ return Orchid::path('stubs/table.stub');
}
/**
diff --git a/src/Platform/Components/Notification.php b/src/Platform/Components/Notification.php
index 773a949e4..fa81bb305 100644
--- a/src/Platform/Components/Notification.php
+++ b/src/Platform/Components/Notification.php
@@ -37,7 +37,7 @@ public function render()
->limit(15)
->get();
- return view('platform::components.notification', [
+ return view('orchid::components.notification', [
'notifications' => $notifications,
]);
}
@@ -49,6 +49,6 @@ public function render()
*/
public function shouldRender(): bool
{
- return config('platform.notifications.enabled', true);
+ return config('orchid.notifications.enabled', true);
}
}
diff --git a/src/Platform/Components/Stream.php b/src/Platform/Components/Stream.php
index 0d8ed566c..81b654f0b 100644
--- a/src/Platform/Components/Stream.php
+++ b/src/Platform/Components/Stream.php
@@ -16,6 +16,6 @@ class Stream extends Component
*/
public function render()
{
- return view('platform::components.stream');
+ return view('orchid::components.stream');
}
}
diff --git a/src/Platform/Http/Controllers/AttachmentController.php b/src/Platform/Http/Controllers/AttachmentController.php
index 3b8eaa3ec..fe8d54af2 100644
--- a/src/Platform/Http/Controllers/AttachmentController.php
+++ b/src/Platform/Http/Controllers/AttachmentController.php
@@ -11,7 +11,7 @@
use Illuminate\Http\UploadedFile;
use Orchid\Attachment\File;
use Orchid\Attachment\Models\Attachment;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\Events\UploadedFileEvent;
use Symfony\Component\HttpFoundation\Response;
@@ -30,8 +30,8 @@ class AttachmentController extends Controller
*/
public function __construct()
{
- $this->checkPermission('platform.systems.attachment');
- $this->attachment = Dashboard::modelClass(Attachment::class);
+ $this->checkPermission('orchid.systems.attachment');
+ $this->attachment = Orchid::modelClass(Attachment::class);
}
public function upload(Request $request): JsonResponse
diff --git a/src/Platform/Http/Controllers/IndexController.php b/src/Platform/Http/Controllers/IndexController.php
index 70b74fd6b..fd89c3269 100644
--- a/src/Platform/Http/Controllers/IndexController.php
+++ b/src/Platform/Http/Controllers/IndexController.php
@@ -15,7 +15,7 @@ class IndexController extends Controller
{
public function index(): RedirectResponse
{
- return redirect()->route(config('platform.index'));
+ return redirect()->route(config('orchid.index'));
}
/**
@@ -23,6 +23,6 @@ public function index(): RedirectResponse
*/
public function fallback()
{
- return view('platform::errors.404');
+ return view('orchid::errors.404');
}
}
diff --git a/src/Platform/Http/Controllers/LoginController.php b/src/Platform/Http/Controllers/LoginController.php
index 4c4c7ad52..9984d5903 100644
--- a/src/Platform/Http/Controllers/LoginController.php
+++ b/src/Platform/Http/Controllers/LoginController.php
@@ -39,7 +39,7 @@ class LoginController extends Controller
*/
public function __construct(Auth $auth)
{
- $this->guard = $auth->guard(config('platform.guard'));
+ $this->guard = $auth->guard(config('orchid.guard'));
$this->middleware('guest', [
'except' => [
@@ -90,7 +90,7 @@ protected function sendLoginResponse(Request $request)
return $request->wantsJson()
? new JsonResponse([], 204)
- : redirect()->intended(route(config('platform.index')));
+ : redirect()->intended(route(config('orchid.index')));
}
/**
@@ -107,7 +107,7 @@ public function showLoginForm(Request $request)
$model = $provider->createModel()->find($user);
- return view('platform::auth.login', [
+ return view('orchid::auth.login', [
'isLockUser' => optional($model)->exists ?? false,
'lockUser' => $model,
]);
@@ -120,7 +120,7 @@ public function resetCookieLockMe(CookieJar $cookieJar)
{
$lockUser = $cookieJar->forget('lockUser');
- return redirect()->route('platform.login')->withCookie($lockUser);
+ return redirect()->route('orchid.login')->withCookie($lockUser);
}
/**
@@ -130,7 +130,7 @@ public function switchLogout()
{
Impersonation::logout();
- return redirect()->route(config('platform.index'));
+ return redirect()->route(config('orchid.index'));
}
/**
diff --git a/src/Platform/Http/Layouts/NotificationTable.php b/src/Platform/Http/Layouts/NotificationTable.php
index 27fc9a472..4a027a807 100644
--- a/src/Platform/Http/Layouts/NotificationTable.php
+++ b/src/Platform/Http/Layouts/NotificationTable.php
@@ -24,7 +24,7 @@ public function columns(): array
return [
TD::make('Message', __('Messages'))
->cantHide()
- ->render(static fn ($notification) => view('platform::partials.notification', [
+ ->render(static fn ($notification) => view('orchid::partials.notification', [
'notification' => $notification,
])),
];
diff --git a/src/Platform/Http/Layouts/SearchLayout.php b/src/Platform/Http/Layouts/SearchLayout.php
index b93c32a89..49d98fec9 100644
--- a/src/Platform/Http/Layouts/SearchLayout.php
+++ b/src/Platform/Http/Layouts/SearchLayout.php
@@ -9,14 +9,14 @@
use Orchid\Screen\Fields\Label;
use Orchid\Screen\Fields\Radio;
use Orchid\Screen\Layouts\Rows;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
use Throwable;
class SearchLayout extends Rows
{
public function isSee(): bool
{
- return Dashboard::getSearch()->isNotEmpty();
+ return Orchid::getSearch()->isNotEmpty();
}
/**
@@ -26,7 +26,7 @@ public function fields(): array
{
$searchModel = $this->query->get('model');
- $layouts = Dashboard::getSearch()
+ $layouts = Orchid::getSearch()
->map(static function (Model $model) use ($searchModel) {
$radio = Radio::make('type')
->value(get_class($model))
diff --git a/src/Platform/Http/Middleware/Access.php b/src/Platform/Http/Middleware/Access.php
index ec9d61d5f..93914a9da 100644
--- a/src/Platform/Http/Middleware/Access.php
+++ b/src/Platform/Http/Middleware/Access.php
@@ -31,14 +31,14 @@ class Access
*/
public function __construct(Auth $auth)
{
- $auth->shouldUse(config('platform.guard'));
+ $auth->shouldUse(config('orchid.guard'));
$this->guard = $auth->guard();
}
/**
* @return ResponseFactory|RedirectResponse|Response|mixed
*/
- public function handle(Request $request, Closure $next, string $permission = 'platform.index')
+ public function handle(Request $request, Closure $next, string $permission = 'orchid.index')
{
Carbon::setLocale(config('app.locale'));
@@ -51,7 +51,7 @@ public function handle(Request $request, Closure $next, string $permission = 'pl
}
if (Impersonation::isSwitch()) {
- return response()->view('platform::auth.impersonation');
+ return response()->view('orchid::auth.impersonation');
}
// The current user is already signed in.
@@ -71,8 +71,8 @@ protected function redirectToLogin(Request $request)
return response('Unauthorized.', 401);
}
- if (Route::has('platform.login')) {
- return redirect()->guest(route('platform.login'));
+ if (Route::has('orchid.login')) {
+ return redirect()->guest(route('orchid.login'));
}
if (Route::has('login')) {
diff --git a/src/Platform/Http/Screens/NotificationScreen.php b/src/Platform/Http/Screens/NotificationScreen.php
index 8e11cd927..9ef36e36c 100644
--- a/src/Platform/Http/Screens/NotificationScreen.php
+++ b/src/Platform/Http/Screens/NotificationScreen.php
@@ -33,7 +33,7 @@ class NotificationScreen extends Screen
/**
* @var string
*/
- public $permission = 'platform.index';
+ public $permission = 'orchid.index';
/**
* @var bool
@@ -90,7 +90,7 @@ public function commandBar(): iterable
public function layout(): iterable
{
return [
- Layout::wrapper('platform::partials.notification-wrap', [
+ Layout::wrapper('orchid::partials.notification-wrap', [
'table' => NotificationTable::class,
]),
];
diff --git a/src/Platform/Http/Screens/SearchScreen.php b/src/Platform/Http/Screens/SearchScreen.php
index 4d5dbf3f3..6833d43cf 100644
--- a/src/Platform/Http/Screens/SearchScreen.php
+++ b/src/Platform/Http/Screens/SearchScreen.php
@@ -14,7 +14,7 @@
use Orchid\Screen\Actions\Button;
use Orchid\Screen\Contracts\Searchable;
use Orchid\Screen\Screen;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
use Orchid\Support\Facades\Layout;
class SearchScreen extends Screen
@@ -41,7 +41,7 @@ public function query(string $query): iterable
'query' => $query,
]);
- $searchModels = Dashboard::getSearch();
+ $searchModels = Orchid::getSearch();
$model = $this->getSearchModel($searchModels);
@@ -67,7 +67,7 @@ public function commandBar(): iterable
return [
Button::make(__('Apply'))
->icon('bs.funnel')
- ->canSee(Dashboard::getSearch()->count() > 1)
+ ->canSee(Orchid::getSearch()->count() > 1)
->method('changeSearchType'),
];
}
@@ -80,7 +80,7 @@ public function commandBar(): iterable
public function layout(): iterable
{
return [
- Layout::wrapper('platform::partials.result', [
+ Layout::wrapper('orchid::partials.result', [
'radios' => SearchLayout::class,
]),
];
@@ -101,7 +101,7 @@ public function compact(?string $query = null)
$total = 0;
/** @var Searchable[] $results */
- $results = Dashboard::getSearch()
+ $results = Orchid::getSearch()
->transform(function (Model $model) use ($query, &$total) {
/** @var Searchable $presenter */
$presenter = optional($model)->presenter();
@@ -129,7 +129,7 @@ public function compact(?string $query = null)
})
->filter();
- return view('platform::partials.result-compact', [
+ return view('orchid::partials.result-compact', [
'results' => $results,
'total' => $total,
'query' => $query,
diff --git a/src/Platform/ItemPermission.php b/src/Platform/ItemPermission.php
index 565bc0528..bdad4faf1 100644
--- a/src/Platform/ItemPermission.php
+++ b/src/Platform/ItemPermission.php
@@ -30,15 +30,31 @@ class ItemPermission
*
* @return self The new permission group instance.
*/
- public static function group(string $group): self
+ public static function make(string $group, array $items = []): self
{
$item = new self();
$item->group = $group;
+ foreach ($items as $slug => $name){
+ $item->add($slug, $name);
+ }
+
return $item;
}
+ /**
+ * Create a new permission group instance with the given group name.
+ *
+ * @param string $group The name of the permission group.
+ *
+ * @return self The new permission group instance.
+ */
+ public static function group(string $group, array $items = []): self
+ {
+ return self::make($group, $items);
+ }
+
/**
* Add a permission to the permission group.
*
@@ -47,7 +63,7 @@ public static function group(string $group): self
*
* @return $this The current permission group instance.
*/
- public function addPermission(string $slug, string $name): self
+ public function add(string $slug, string $name): self
{
$this->items[] = [
'slug' => $slug,
@@ -56,4 +72,19 @@ public function addPermission(string $slug, string $name): self
return $this;
}
+
+ /**
+ * @alias
+ *
+ * Alice for `add` method
+ *
+ * @param string $slug The slug of the permission.
+ * @param string $name The description of the permission.
+ *
+ * @return $this The current permission group instance.
+ */
+ public function addPermission(string $slug, string $name): self
+ {
+ return $this->add($slug, $name);
+ }
}
diff --git a/src/Platform/Models/User.php b/src/Platform/Models/User.php
index 69670ead7..f4e65a926 100644
--- a/src/Platform/Models/User.php
+++ b/src/Platform/Models/User.php
@@ -17,7 +17,7 @@
use Orchid\Filters\Types\WhereDateStartEnd;
use Orchid\Metrics\Chartable;
use Orchid\Screen\AsSource;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
class User extends Authenticatable implements UserInterface
{
@@ -102,7 +102,7 @@ public static function createAdmin(string $name, string $email, string $password
'name' => $name,
'email' => $email,
'password' => Hash::make($password),
- 'permissions' => Dashboard::getAllowAllPermission(),
+ 'permissions' => Orchid::getAllowAllPermission(),
]);
}
diff --git a/src/Platform/Dashboard.php b/src/Platform/Orchid.php
similarity index 93%
rename from src/Platform/Dashboard.php
rename to src/Platform/Orchid.php
index 4d4c677db..56b2a469b 100644
--- a/src/Platform/Dashboard.php
+++ b/src/Platform/Orchid.php
@@ -14,7 +14,7 @@
use Orchid\Screen\Screen;
use RuntimeException;
-class Dashboard
+class Orchid
{
use Macroable;
@@ -23,13 +23,6 @@ class Dashboard
*/
public const VERSION = '14.21.1';
- /**
- * @deprecated
- *
- * Slug for main menu.
- */
- public const MENU_MAIN = 'Main';
-
/**
* The Dashboard configuration options.
*
@@ -117,7 +110,7 @@ public static function assetsAreCurrent()
*/
public static function prefix(string $path = ''): string
{
- $prefix = config('platform.prefix');
+ $prefix = config('orchid.prefix');
return Str::start($prefix.$path, '/');
}
@@ -175,6 +168,10 @@ public static function path(string $path = ''): string
{
$current = dirname(__DIR__, 2);
+ if(is_bool(realpath($current.($path ? DIRECTORY_SEPARATOR.$path : $path)))){
+ dd($path, $current);
+ }
+
return realpath($current.($path ? DIRECTORY_SEPARATOR.$path : $path));
}
@@ -332,13 +329,13 @@ public function isPartialRequest(): bool
*
* @return $this
*/
- public function registerMenuElement(Menu $menu): Dashboard
+ public function registerMenuElement(Menu $menu): Orchid
{
if ($menu->get('sort', 0) === 0) {
- $menu->sort($this->menu->get(self::MENU_MAIN)->count() + 1);
+ $menu->sort($this->menu->count() + 1);
}
- $this->menu->get(self::MENU_MAIN)->add($menu);
+ $this->menu->add($menu);
return $this;
}
@@ -351,7 +348,7 @@ public function registerMenuElement(Menu $menu): Dashboard
*/
public function renderMenu(): string
{
- return $this->menu->get(self::MENU_MAIN)
+ return $this->menu
->sort(fn (Menu $current, Menu $next) => $current->get('sort', 0) <=> $next->get('sort', 0))
->map(fn (Menu $menu) => (string) $menu->render())
->implode('');
@@ -359,20 +356,20 @@ public function renderMenu(): string
public function isEmptyMenu(): bool
{
- return $this->menu->get(self::MENU_MAIN)->isEmpty();
+ return $this->menu->isEmpty();
}
/**
* @param Menu[] $list
*/
- public function addMenuSubElements(string $slug, array $list): Dashboard
+ public function addMenuSubElements(string $slug, array $list): Orchid
{
- $menu = $this->menu->get(self::MENU_MAIN)
+ $menu = $this->menu
->map(fn (Menu $menu) => $slug === $menu->get('slug')
? $menu->list($list)
: $menu);
- $this->menu->put(self::MENU_MAIN, $menu);
+ $this->menu->push($menu);
return $this;
}
@@ -382,9 +379,7 @@ public function addMenuSubElements(string $slug, array $list): Dashboard
*/
public function flushState(): void
{
- $this->menu = collect([
- self::MENU_MAIN => collect(),
- ]);
+ $this->menu = collect();
$this->currentScreen = null;
$this->partialRequest = false;
diff --git a/src/Platform/OrchidServiceProvider.php b/src/Platform/OrchidServiceProvider.php
index 412d8d8f8..2ac4e8640 100644
--- a/src/Platform/OrchidServiceProvider.php
+++ b/src/Platform/OrchidServiceProvider.php
@@ -4,6 +4,7 @@
namespace Orchid\Platform;
+use Closure;
use Illuminate\Contracts\Foundation\CachesRoutes;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
@@ -20,35 +21,37 @@ abstract class OrchidServiceProvider extends ServiceProvider
/**
* The Orchid Dashboard instance.
*
- * @var \Orchid\Platform\Dashboard|null
+ * @var \Orchid\Platform\Orchid|null
*/
- protected ?Dashboard $orchid;
+ protected ?Orchid $orchid = null;
/**
- * Boot the application events.
+ * Register any application services.
*/
- public function boot(Dashboard $dashboard): void
+ public function register()
{
- // Need for backward compatibility
- $this->orchid = $dashboard;
+ $this->booting(function (){
+ // Need for backward compatibility
+ $this->orchid = $this->orchidSingleton();
- $this
- ->definePermissions()
- ->defineRoutes()
- ->defineSearch()
- ->defineIcons()
- ->defineMenu();
+ $this
+ ->definePermissions()
+ ->defineRoutes()
+ ->defineSearch()
+ ->defineIcons()
+ ->defineMenu();
+ });
}
/**
* Get the Orchid Dashboard instance.
*
- * @return \Orchid\Platform\Dashboard
+ * @return \Orchid\Platform\Orchid
*/
- private function orchidSingleton(): Dashboard
+ private function orchidSingleton(): Orchid
{
if ($this->orchid === null) {
- $this->orchid = $this->app->make(Dashboard::class);
+ $this->orchid = $this->app->make(Orchid::class);
}
return $this->orchid;
@@ -74,7 +77,7 @@ private function defineSearch(): static
private function defineMenu(): static
{
// Register the menu items
- View::composer('platform::dashboard', function () {
+ View::composer('orchid::dashboard', function () {
$elements = [...$this->menu(), ...$this->registerMenu(), ...$this->registerMainMenu(), ...$this->registerProfileMenu()];
foreach ($elements as $element) {
@@ -113,9 +116,9 @@ private function defineRoutes(): static
return $this;
}
- Route::domain((string) config('platform.domain'))
- ->prefix(Dashboard::prefix('/'))
- ->middleware(config('platform.middleware.private'))
+ Route::domain((string) config('orchid.domain'))
+ ->prefix(Orchid::prefix('/'))
+ ->middleware(config('orchid.middleware.private'))
->group(function (Router $route) {
$this->routes($route);
});
diff --git a/src/Platform/Providers/ConsoleServiceProvider.php b/src/Platform/Providers/ConsoleServiceProvider.php
index 8f53884f8..702e7583f 100644
--- a/src/Platform/Providers/ConsoleServiceProvider.php
+++ b/src/Platform/Providers/ConsoleServiceProvider.php
@@ -18,7 +18,7 @@
use Orchid\Platform\Commands\SelectionCommand;
use Orchid\Platform\Commands\TableCommand;
use Orchid\Platform\Commands\TabMenuCommand;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
class ConsoleServiceProvider extends ServiceProvider
{
@@ -44,11 +44,11 @@ class ConsoleServiceProvider extends ServiceProvider
public function boot(): void
{
- AboutCommand::add('Orchid Platform', fn () => [
- 'Version' => Dashboard::version(),
- 'Domain' => config('platform.domain'),
- 'Prefix' => config('platform.prefix'),
- 'Assets Status' => Dashboard::assetsAreCurrent() ? '
CURRENT>' : 'OUTDATED>',
+ AboutCommand::add('Orchid', fn () => [
+ 'Version' => Orchid::version(),
+ 'Domain' => config('orchid.domain'),
+ 'Prefix' => config('orchid.prefix'),
+ 'Assets Status' => Orchid::assetsAreCurrent() ? 'CURRENT>' : 'OUTDATED>',
]);
$this
@@ -69,7 +69,7 @@ public function boot(): void
protected function registerMigrationsPublisher(): self
{
$this->publishes([
- Dashboard::path('database/migrations') => database_path('migrations'),
+ Orchid::path('database/migrations') => database_path('migrations'),
], 'orchid-migrations');
return $this;
@@ -83,7 +83,7 @@ protected function registerMigrationsPublisher(): self
public function registerTranslationsPublisher(): self
{
$this->publishes([
- Dashboard::path('resources/lang') => lang_path('vendor/platform'),
+ Orchid::path('resources/lang') => lang_path('vendor/orchid'),
], 'orchid-lang');
return $this;
@@ -97,7 +97,7 @@ public function registerTranslationsPublisher(): self
public function registerViewsPublisher(): self
{
$this->publishes([
- Dashboard::path('resources/views') => resource_path('views/vendor/platform'),
+ Orchid::path('resources/views') => resource_path('views/vendor/orchid'),
], 'orchid-views');
return $this;
@@ -111,7 +111,7 @@ public function registerViewsPublisher(): self
protected function registerConfigPublisher(): self
{
$this->publishes([
- Dashboard::path('config/platform.php') => config_path('platform.php'),
+ Orchid::path('config/orchid.php') => config_path('orchid.php'),
], 'orchid-config');
return $this;
@@ -125,8 +125,8 @@ protected function registerConfigPublisher(): self
protected function registerOrchidPublisher(): self
{
$this->publishes([
- Dashboard::path('stubs/app/routes/') => base_path('routes'),
- Dashboard::path('stubs/app/Orchid/') => app_path('Orchid'),
+ Orchid::path('stubs/app/routes/') => base_path('routes'),
+ Orchid::path('stubs/app/Orchid/') => app_path('Orchid'),
], 'orchid-app-stubs');
return $this;
@@ -140,7 +140,7 @@ protected function registerOrchidPublisher(): self
protected function registerAssetsPublisher(): self
{
$this->publishes([
- Dashboard::path('public') => public_path('vendor/orchid'),
+ Orchid::path('public') => public_path('vendor/orchid'),
], ['orchid-assets', 'laravel-assets']);
return $this;
diff --git a/src/Platform/Providers/FoundationServiceProvider.php b/src/Platform/Providers/FoundationServiceProvider.php
index 98b79197f..fb337d2b5 100644
--- a/src/Platform/Providers/FoundationServiceProvider.php
+++ b/src/Platform/Providers/FoundationServiceProvider.php
@@ -13,7 +13,7 @@
use Orchid\Icons\IconServiceProvider;
use Orchid\Platform\Components\Notification;
use Orchid\Platform\Components\Stream;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Screen\Components\Popover;
use Tabuna\Breadcrumbs\BreadcrumbsServiceProvider;
use Watson\Active\ActiveServiceProvider;
@@ -41,7 +41,7 @@ public function boot(): void
*/
public function registerTranslations(): self
{
- $this->loadJsonTranslationsFrom(Dashboard::path('resources/lang/'));
+ $this->loadJsonTranslationsFrom(Orchid::path('resources/lang/'));
return $this;
}
@@ -53,7 +53,7 @@ public function registerTranslations(): self
*/
public function registerViews(): self
{
- $this->loadViewsFrom(Dashboard::path('resources/views'), 'platform');
+ $this->loadViewsFrom(Orchid::path('resources/views'), 'orchid');
return $this;
}
@@ -84,7 +84,7 @@ public function registerProviders(): self
*/
public function registerOctaneEventsListen(): self
{
- Event::listen(fn (\Laravel\Octane\Events\RequestReceived $request) => \Orchid\Support\Facades\Dashboard::flushState());
+ Event::listen(fn (\Laravel\Octane\Events\RequestReceived $request) => \Orchid\Support\Facades\Orchid::flushState());
return $this;
}
@@ -114,7 +114,8 @@ public function register(): void
->registerTranslations()
->registerProviders();
- $this->app->singleton(Dashboard::class, static fn () => new Dashboard());
+ $this->app->singleton(Orchid::class, static fn () => new Orchid());
+
if (! Route::hasMacro('screen')) {
Route::macro('screen', function ($url, $screen) {
@@ -128,7 +129,7 @@ public function register(): void
}
$this->mergeConfigFrom(
- Dashboard::path('config/platform.php'), 'platform'
+ Orchid::path('config/orchid.php'), 'orchid'
);
Blade::component('orchid-popover', Popover::class);
diff --git a/src/Platform/Providers/PlatformServiceProvider.php b/src/Platform/Providers/PlatformServiceProvider.php
index e712310d7..4602ef62c 100644
--- a/src/Platform/Providers/PlatformServiceProvider.php
+++ b/src/Platform/Providers/PlatformServiceProvider.php
@@ -6,32 +6,32 @@
use Illuminate\Support\ServiceProvider;
use Orchid\Icons\IconFinder;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\ItemPermission;
class PlatformServiceProvider extends ServiceProvider
{
/**
- * @var Dashboard
+ * @var Orchid
*/
protected $dashboard;
/**
* Boot the application events.
*/
- public function boot(Dashboard $dashboard, IconFinder $iconFinder): void
+ public function boot(Orchid $dashboard, IconFinder $iconFinder): void
{
$this->dashboard = $dashboard;
- foreach (config('platform.icons', []) as $key => $path) {
+ foreach (config('orchid.icons', []) as $key => $path) {
$iconFinder->registerIconDirectory($key, $path);
}
$this->app->booted(function () {
$this->dashboard
- ->registerResource('stylesheets', config('platform.resource.stylesheets'))
- ->registerResource('scripts', config('platform.resource.scripts'))
- ->registerSearch(config('platform.search', []))
+ ->registerResource('stylesheets', config('orchid.resource.stylesheets'))
+ ->registerResource('scripts', config('orchid.resource.scripts'))
+ ->registerSearch(config('orchid.search', []))
->registerPermissions($this->registerPermissionsMain())
->registerPermissions($this->registerPermissionsSystems());
});
@@ -40,13 +40,13 @@ public function boot(Dashboard $dashboard, IconFinder $iconFinder): void
protected function registerPermissionsMain(): ItemPermission
{
return ItemPermission::group(__('Main'))
- ->addPermission('platform.index', __('Main'));
+ ->addPermission('orchid.index', __('Main'));
}
protected function registerPermissionsSystems(): ItemPermission
{
return ItemPermission::group(__('System'))
- ->addPermission('platform.systems.attachment', __('Attachment'));
+ ->addPermission('orchid.systems.attachment', __('Attachment'));
}
/**
@@ -54,7 +54,7 @@ protected function registerPermissionsSystems(): ItemPermission
*/
public function register()
{
- $provider = config('platform.provider', \App\Orchid\PlatformProvider::class);
+ $provider = config('orchid.provider', \App\Orchid\PlatformProvider::class);
if ($provider !== null && class_exists($provider)) {
$this->app->register($provider);
diff --git a/src/Platform/Providers/RouteServiceProvider.php b/src/Platform/Providers/RouteServiceProvider.php
index 69aaf61fa..d6c1696be 100644
--- a/src/Platform/Providers/RouteServiceProvider.php
+++ b/src/Platform/Providers/RouteServiceProvider.php
@@ -6,7 +6,7 @@
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\Http\Middleware\Access;
use Orchid\Platform\Http\Middleware\Turbo;
@@ -19,7 +19,7 @@ class RouteServiceProvider extends ServiceProvider
*/
public function boot()
{
- Route::middlewareGroup('platform', [
+ Route::middlewareGroup('orchid', [
Turbo::class,
Access::class,
]);
@@ -40,13 +40,13 @@ public function map()
* The dashboard routes have a subdomain of the platform.domain config value,
* a prefix consisting of the Dashboard::prefix() method return value,
* an alias of 'platform.', middleware from the platform.middleware.private config value,
- * and are defined in the Dashboard::path('routes/dashboard.php') file.
+ * and are defined in the Dashboard::path('routes/orchid.php') file.
*/
- Route::domain((string) config('platform.domain'))
- ->prefix(Dashboard::prefix('/'))
- ->as('platform.')
- ->middleware(config('platform.middleware.private'))
- ->group(Dashboard::path('routes/dashboard.php'));
+ Route::domain((string) config('orchid.domain'))
+ ->prefix(Orchid::prefix('/'))
+ ->as('orchid.')
+ ->middleware(config('orchid.middleware.private'))
+ ->group(Orchid::path('routes/orchid.php'));
/*
* Auth routes.
@@ -56,11 +56,11 @@ public function map()
* an alias of 'platform.', middleware from the platform.middleware.public config value,
* and are defined in the Dashboard::path('routes/auth.php') file.
*/
- Route::domain((string) config('platform.domain'))
- ->prefix(Dashboard::prefix('/'))
- ->as('platform.')
- ->middleware(config('platform.middleware.public'))
- ->group(Dashboard::path('routes/auth.php'));
+ Route::domain((string) config('orchid.domain'))
+ ->prefix(Orchid::prefix('/'))
+ ->as('orchid.')
+ ->middleware(config('orchid.middleware.public'))
+ ->group(Orchid::path('routes/auth.php'));
/*
* Application routes.
@@ -69,11 +69,12 @@ public function map()
* a prefix consisting of the Dashboard::prefix() method return value,
* and middleware from the platform.middleware.private config value.
*/
- if (file_exists(base_path('routes/platform.php'))) {
- Route::domain((string) config('platform.domain'))
- ->prefix(Dashboard::prefix('/'))
- ->middleware(config('platform.middleware.private'))
- ->group(base_path('routes/platform.php'));
+ if (file_exists(base_path('routes/orchid.php'))) {
+ Route::domain((string) config('orchid.domain'))
+ ->prefix(Orchid::prefix('/'))
+ //->as(config('orchid.routes.name'))
+ ->middleware(config('orchid.middleware.private'))
+ ->group(base_path('routes/orchid.php'));
}
}
}
diff --git a/src/Screen/Action.php b/src/Screen/Action.php
index 320253b2f..6b3d661ef 100644
--- a/src/Screen/Action.php
+++ b/src/Screen/Action.php
@@ -14,7 +14,7 @@ class Action extends Field implements Actionable
*
* @var string
*/
- protected $typeForm = 'platform::partials.fields.clear';
+ protected $typeForm = 'orchid::partials.fields.clear';
/**
* Attributes available for a particular tag.
diff --git a/src/Screen/Actions/Button.php b/src/Screen/Actions/Button.php
index 4341e4ae2..835d99759 100644
--- a/src/Screen/Actions/Button.php
+++ b/src/Screen/Actions/Button.php
@@ -5,7 +5,7 @@
namespace Orchid\Screen\Actions;
use Orchid\Screen\Action;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
/**
* Class Button.
@@ -23,7 +23,7 @@ class Button extends Action
/**
* @var string
*/
- protected $view = 'platform::actions.button';
+ protected $view = 'orchid::actions.button';
/**
* Default attributes value.
@@ -72,7 +72,7 @@ public function __construct()
}
// correct URL for async request
- $url = Dashboard::isPartialRequest()
+ $url = Orchid::isPartialRequest()
? url()->previous()
: url()->current();
diff --git a/src/Screen/Actions/DropDown.php b/src/Screen/Actions/DropDown.php
index afbfdae15..f3177cebe 100644
--- a/src/Screen/Actions/DropDown.php
+++ b/src/Screen/Actions/DropDown.php
@@ -21,7 +21,7 @@ class DropDown extends Action
/**
* @var string
*/
- protected $view = 'platform::actions.dropdown';
+ protected $view = 'orchid::actions.dropdown';
/**
* Default attributes value.
diff --git a/src/Screen/Actions/Link.php b/src/Screen/Actions/Link.php
index acd839b4b..2bcbac3df 100644
--- a/src/Screen/Actions/Link.php
+++ b/src/Screen/Actions/Link.php
@@ -21,7 +21,7 @@ class Link extends Action
/**
* @var string
*/
- protected $view = 'platform::actions.link';
+ protected $view = 'orchid::actions.link';
/**
* Default attributes value.
diff --git a/src/Screen/Actions/Menu.php b/src/Screen/Actions/Menu.php
index 778e73c82..c9d698f24 100644
--- a/src/Screen/Actions/Menu.php
+++ b/src/Screen/Actions/Menu.php
@@ -28,7 +28,7 @@ class Menu extends Link
/**
* @var string
*/
- protected $view = 'platform::actions.menu';
+ protected $view = 'orchid::actions.menu';
/**
* @var bool
diff --git a/src/Screen/Actions/ModalToggle.php b/src/Screen/Actions/ModalToggle.php
index ab451e357..5b9417e46 100644
--- a/src/Screen/Actions/ModalToggle.php
+++ b/src/Screen/Actions/ModalToggle.php
@@ -22,7 +22,7 @@ class ModalToggle extends Button
/**
* @var string
*/
- protected $view = 'platform::actions.modal';
+ protected $view = 'orchid::actions.modal';
/**
* Default attributes value.
diff --git a/src/Screen/Components/Popover.php b/src/Screen/Components/Popover.php
index 396a7e93d..5d7d4a7a1 100644
--- a/src/Screen/Components/Popover.php
+++ b/src/Screen/Components/Popover.php
@@ -39,7 +39,7 @@ public function __construct(?string $content = null, string $placement = 'auto')
*/
public function render()
{
- return view('platform::components.popover');
+ return view('orchid::components.popover');
}
/**
diff --git a/src/Screen/Field.php b/src/Screen/Field.php
index b6ac13490..760b19ed1 100644
--- a/src/Screen/Field.php
+++ b/src/Screen/Field.php
@@ -372,7 +372,7 @@ protected function modifyValue(): self
*/
public function vertical(): self
{
- $this->typeForm = 'platform::partials.fields.vertical';
+ $this->typeForm = 'orchid::partials.fields.vertical';
return $this;
}
@@ -384,7 +384,7 @@ public function vertical(): self
*/
public function clear(): self
{
- $this->typeForm = 'platform::partials.fields.clear';
+ $this->typeForm = 'orchid::partials.fields.clear';
return $this;
}
@@ -396,7 +396,7 @@ public function clear(): self
*/
public function horizontal(): self
{
- $this->typeForm = 'platform::partials.fields.horizontal';
+ $this->typeForm = 'orchid::partials.fields.horizontal';
return $this;
}
diff --git a/src/Screen/Fields/Attach.php b/src/Screen/Fields/Attach.php
index f608ac4df..52acbfe8f 100644
--- a/src/Screen/Fields/Attach.php
+++ b/src/Screen/Fields/Attach.php
@@ -27,7 +27,7 @@ class Attach extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.attach';
+ protected $view = 'orchid::fields.attach';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/CheckBox.php b/src/Screen/Fields/CheckBox.php
index 0a4218c75..9498c1a29 100644
--- a/src/Screen/Fields/CheckBox.php
+++ b/src/Screen/Fields/CheckBox.php
@@ -35,7 +35,7 @@ class CheckBox extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.checkbox';
+ protected $view = 'orchid::fields.checkbox';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Code.php b/src/Screen/Fields/Code.php
index 5cdecbab8..0ac0e9672 100644
--- a/src/Screen/Fields/Code.php
+++ b/src/Screen/Fields/Code.php
@@ -48,7 +48,7 @@ class Code extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.code';
+ protected $view = 'orchid::fields.code';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Cropper.php b/src/Screen/Fields/Cropper.php
index 168f1cb71..8cc107aa8 100644
--- a/src/Screen/Fields/Cropper.php
+++ b/src/Screen/Fields/Cropper.php
@@ -39,7 +39,7 @@ class Cropper extends Picture
/**
* @var string
*/
- protected $view = 'platform::fields.cropper';
+ protected $view = 'orchid::fields.cropper';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/DateRange.php b/src/Screen/Fields/DateRange.php
index 8d4ab7816..e8c3a4c13 100644
--- a/src/Screen/Fields/DateRange.php
+++ b/src/Screen/Fields/DateRange.php
@@ -22,7 +22,7 @@ class DateRange extends Field implements ComplexFieldConcern
/**
* @var string
*/
- protected $view = 'platform::fields.dataRange';
+ protected $view = 'orchid::fields.dataRange';
/**
* Attributes available for a particular tag.
diff --git a/src/Screen/Fields/DateTimer.php b/src/Screen/Fields/DateTimer.php
index 2606bd71b..f2c3876c5 100644
--- a/src/Screen/Fields/DateTimer.php
+++ b/src/Screen/Fields/DateTimer.php
@@ -35,7 +35,7 @@ class DateTimer extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.datetime';
+ protected $view = 'orchid::fields.datetime';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Group.php b/src/Screen/Fields/Group.php
index 7222d1f64..5cd10c60e 100644
--- a/src/Screen/Fields/Group.php
+++ b/src/Screen/Fields/Group.php
@@ -32,7 +32,7 @@ class Group implements Fieldable, Groupable
/**
* @var string
*/
- protected $view = 'platform::fields.group';
+ protected $view = 'orchid::fields.group';
/**
* @return static
diff --git a/src/Screen/Fields/Input.php b/src/Screen/Fields/Input.php
index dac680bd6..52094e838 100644
--- a/src/Screen/Fields/Input.php
+++ b/src/Screen/Fields/Input.php
@@ -50,7 +50,7 @@ class Input extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.input';
+ protected $view = 'orchid::fields.input';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Label.php b/src/Screen/Fields/Label.php
index e1b6d9950..fb9735e78 100644
--- a/src/Screen/Fields/Label.php
+++ b/src/Screen/Fields/Label.php
@@ -18,7 +18,7 @@ class Label extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.label';
+ protected $view = 'orchid::fields.label';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Map.php b/src/Screen/Fields/Map.php
index 33d207f33..60df2ba3f 100644
--- a/src/Screen/Fields/Map.php
+++ b/src/Screen/Fields/Map.php
@@ -23,7 +23,7 @@ class Map extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.map';
+ protected $view = 'orchid::fields.map';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Matrix.php b/src/Screen/Fields/Matrix.php
index fe92c5672..0c3536eb0 100644
--- a/src/Screen/Fields/Matrix.php
+++ b/src/Screen/Fields/Matrix.php
@@ -19,7 +19,7 @@ class Matrix extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.matrix';
+ protected $view = 'orchid::fields.matrix';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/NumberRange.php b/src/Screen/Fields/NumberRange.php
index 63a49fa17..7ee47768e 100644
--- a/src/Screen/Fields/NumberRange.php
+++ b/src/Screen/Fields/NumberRange.php
@@ -21,7 +21,7 @@ class NumberRange extends Field implements ComplexFieldConcern
/**
* @var string
*/
- protected $view = 'platform::fields.numberRange';
+ protected $view = 'orchid::fields.numberRange';
protected $attributes = [
'class' => 'form-control',
diff --git a/src/Screen/Fields/Password.php b/src/Screen/Fields/Password.php
index 3fe11de45..d5449bcff 100644
--- a/src/Screen/Fields/Password.php
+++ b/src/Screen/Fields/Password.php
@@ -40,7 +40,7 @@ class Password extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.password';
+ protected $view = 'orchid::fields.password';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Picture.php b/src/Screen/Fields/Picture.php
index e4aa1937c..5a5ef378c 100644
--- a/src/Screen/Fields/Picture.php
+++ b/src/Screen/Fields/Picture.php
@@ -5,7 +5,7 @@
namespace Orchid\Screen\Fields;
use Orchid\Attachment\Models\Attachment;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Screen\Field;
use Orchid\Support\Init;
@@ -30,7 +30,7 @@ class Picture extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.picture';
+ protected $view = 'orchid::fields.picture';
/**
* Default attributes value.
@@ -108,7 +108,7 @@ public function targetId(): self
}
/** @var Attachment $attach */
- $attach = Dashboard::model(Attachment::class);
+ $attach = Orchid::model(Attachment::class);
$url = optional($attach::find($value))->url();
diff --git a/src/Screen/Fields/Quill.php b/src/Screen/Fields/Quill.php
index 3554dd017..97f2059a0 100644
--- a/src/Screen/Fields/Quill.php
+++ b/src/Screen/Fields/Quill.php
@@ -36,7 +36,7 @@ class Quill extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.quill';
+ protected $view = 'orchid::fields.quill';
/**
* All attributes that are available to the field.
diff --git a/src/Screen/Fields/Radio.php b/src/Screen/Fields/Radio.php
index 5f73dff60..c5938ad68 100644
--- a/src/Screen/Fields/Radio.php
+++ b/src/Screen/Fields/Radio.php
@@ -33,7 +33,7 @@ class Radio extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.radio';
+ protected $view = 'orchid::fields.radio';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/RadioButtons.php b/src/Screen/Fields/RadioButtons.php
index 40f1c5b52..6207fc580 100644
--- a/src/Screen/Fields/RadioButtons.php
+++ b/src/Screen/Fields/RadioButtons.php
@@ -27,7 +27,7 @@ class RadioButtons extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.radiobutton';
+ protected $view = 'orchid::fields.radiobutton';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Range.php b/src/Screen/Fields/Range.php
index 887307a51..f51c25716 100644
--- a/src/Screen/Fields/Range.php
+++ b/src/Screen/Fields/Range.php
@@ -28,7 +28,7 @@ class Range extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.range';
+ protected $view = 'orchid::fields.range';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Relation.php b/src/Screen/Fields/Relation.php
index 94036e54c..9484cfa96 100644
--- a/src/Screen/Fields/Relation.php
+++ b/src/Screen/Fields/Relation.php
@@ -35,7 +35,7 @@ class Relation extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.relation';
+ protected $view = 'orchid::fields.relation';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Select.php b/src/Screen/Fields/Select.php
index dc9f46105..5e0d0ebf5 100644
--- a/src/Screen/Fields/Select.php
+++ b/src/Screen/Fields/Select.php
@@ -35,7 +35,7 @@ class Select extends Field implements ComplexFieldConcern
/**
* @var string
*/
- protected $view = 'platform::fields.select';
+ protected $view = 'orchid::fields.select';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/SimpleMDE.php b/src/Screen/Fields/SimpleMDE.php
index 46fab1c14..e272e3703 100644
--- a/src/Screen/Fields/SimpleMDE.php
+++ b/src/Screen/Fields/SimpleMDE.php
@@ -34,7 +34,7 @@ class SimpleMDE extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.simplemde';
+ protected $view = 'orchid::fields.simplemde';
/**
* Attributes available for a particular tag.
diff --git a/src/Screen/Fields/Switcher.php b/src/Screen/Fields/Switcher.php
index f6f1e1c50..a085775b7 100644
--- a/src/Screen/Fields/Switcher.php
+++ b/src/Screen/Fields/Switcher.php
@@ -35,7 +35,7 @@ class Switcher extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.switch';
+ protected $view = 'orchid::fields.switch';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/TextArea.php b/src/Screen/Fields/TextArea.php
index 3f4409d47..2ea9957f2 100644
--- a/src/Screen/Fields/TextArea.php
+++ b/src/Screen/Fields/TextArea.php
@@ -32,7 +32,7 @@ class TextArea extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.textarea';
+ protected $view = 'orchid::fields.textarea';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/TimeZone.php b/src/Screen/Fields/TimeZone.php
index 5c8bf81a7..27dfaa209 100644
--- a/src/Screen/Fields/TimeZone.php
+++ b/src/Screen/Fields/TimeZone.php
@@ -28,7 +28,7 @@ class TimeZone extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.select';
+ protected $view = 'orchid::fields.select';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/UTM.php b/src/Screen/Fields/UTM.php
index f7aa869a8..d2df05099 100644
--- a/src/Screen/Fields/UTM.php
+++ b/src/Screen/Fields/UTM.php
@@ -30,7 +30,7 @@ class UTM extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.utm';
+ protected $view = 'orchid::fields.utm';
/**
* Default attributes value.
diff --git a/src/Screen/Fields/Upload.php b/src/Screen/Fields/Upload.php
index 91fb61763..070e762d1 100644
--- a/src/Screen/Fields/Upload.php
+++ b/src/Screen/Fields/Upload.php
@@ -6,7 +6,7 @@
use Illuminate\Support\Arr;
use Orchid\Attachment\Models\Attachment;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Screen\Field;
use Orchid\Support\Assert;
use Orchid\Support\Init;
@@ -43,7 +43,7 @@ class Upload extends Field
/**
* @var string
*/
- protected $view = 'platform::fields.upload';
+ protected $view = 'orchid::fields.upload';
/**
* All attributes that are available to the field.
@@ -122,7 +122,7 @@ public function __construct()
}
/** @var Attachment $attach */
- $attach = Dashboard::model(Attachment::class);
+ $attach = Orchid::model(Attachment::class);
$value = $attach::whereIn('id', $value)->orderBy('sort')->get()->toArray();
diff --git a/src/Screen/Layouts/Accordion.php b/src/Screen/Layouts/Accordion.php
index 2263924c1..7f1f0b263 100644
--- a/src/Screen/Layouts/Accordion.php
+++ b/src/Screen/Layouts/Accordion.php
@@ -15,7 +15,7 @@ abstract class Accordion extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.accordion';
+ protected $template = 'orchid::layouts.accordion';
/**
* @var array
diff --git a/src/Screen/Layouts/Blank.php b/src/Screen/Layouts/Blank.php
index 4870331c9..592bcd142 100644
--- a/src/Screen/Layouts/Blank.php
+++ b/src/Screen/Layouts/Blank.php
@@ -15,7 +15,7 @@ abstract class Blank extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.blank';
+ protected $template = 'orchid::layouts.blank';
/**
* Layout constructor.
diff --git a/src/Screen/Layouts/Block.php b/src/Screen/Layouts/Block.php
index 3ff454cd6..45fa1fe49 100644
--- a/src/Screen/Layouts/Block.php
+++ b/src/Screen/Layouts/Block.php
@@ -20,7 +20,7 @@ abstract class Block extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.block';
+ protected $template = 'orchid::layouts.block';
/**
* @var false[]
diff --git a/src/Screen/Layouts/Browsing.php b/src/Screen/Layouts/Browsing.php
index 3e34b4d03..3519f5cc3 100644
--- a/src/Screen/Layouts/Browsing.php
+++ b/src/Screen/Layouts/Browsing.php
@@ -12,7 +12,7 @@ class Browsing extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.browsing';
+ protected $template = 'orchid::layouts.browsing';
/**
* @var array
diff --git a/src/Screen/Layouts/Card.php b/src/Screen/Layouts/Card.php
index e896ec073..adb57482e 100644
--- a/src/Screen/Layouts/Card.php
+++ b/src/Screen/Layouts/Card.php
@@ -14,7 +14,7 @@ class Card extends Content
/**
* @var string
*/
- protected $template = 'platform::layouts.card';
+ protected $template = 'orchid::layouts.card';
/**
* @var array|Action[]
diff --git a/src/Screen/Layouts/Chart.php b/src/Screen/Layouts/Chart.php
index 0f9488b07..794c2ceaf 100644
--- a/src/Screen/Layouts/Chart.php
+++ b/src/Screen/Layouts/Chart.php
@@ -26,7 +26,7 @@ abstract class Chart extends Layout
*
* @var string
*/
- protected $template = 'platform::layouts.chart';
+ protected $template = 'orchid::layouts.chart';
/**
* @var string|null
diff --git a/src/Screen/Layouts/Columns.php b/src/Screen/Layouts/Columns.php
index 2fc9127fb..9bd40b81a 100644
--- a/src/Screen/Layouts/Columns.php
+++ b/src/Screen/Layouts/Columns.php
@@ -15,7 +15,7 @@ abstract class Columns extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.columns';
+ protected $template = 'orchid::layouts.columns';
/**
* Layout constructor.
diff --git a/src/Screen/Layouts/Facepile.php b/src/Screen/Layouts/Facepile.php
index b49e5b653..4a480245b 100644
--- a/src/Screen/Layouts/Facepile.php
+++ b/src/Screen/Layouts/Facepile.php
@@ -13,7 +13,7 @@ class Facepile extends Content
/**
* @var string
*/
- protected $template = 'platform::layouts.facepile';
+ protected $template = 'orchid::layouts.facepile';
/**
* @param Personable[] $users
diff --git a/src/Screen/Layouts/Legend.php b/src/Screen/Layouts/Legend.php
index 7f23df85f..2b9d63565 100644
--- a/src/Screen/Layouts/Legend.php
+++ b/src/Screen/Layouts/Legend.php
@@ -17,7 +17,7 @@ abstract class Legend extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.legend';
+ protected $template = 'orchid::layouts.legend';
/**
* Used to create the title of a group of form elements.
diff --git a/src/Screen/Layouts/Listener.php b/src/Screen/Layouts/Listener.php
index d2e659a8b..beebcae73 100644
--- a/src/Screen/Layouts/Listener.php
+++ b/src/Screen/Layouts/Listener.php
@@ -7,14 +7,14 @@
use Orchid\Screen\Builder;
use Orchid\Screen\Layout;
use Orchid\Screen\Repository;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
abstract class Listener extends Layout
{
/**
* @var string
*/
- protected $template = 'platform::layouts.listener';
+ protected $template = 'orchid::layouts.listener';
/**
* List of field names for which values will be listened.
@@ -70,13 +70,13 @@ public function getSlug(): string
*/
protected function asyncRoute(): ?string
{
- $screen = Dashboard::getCurrentScreen();
+ $screen = Orchid::getCurrentScreen();
if (! $screen) {
return null;
}
- return route('platform.async.listener', [
+ return route('orchid.async.listener', [
'screen' => Crypt::encryptString(get_class($screen)),
'layout' => Crypt::encryptString(static::class),
]);
diff --git a/src/Screen/Layouts/Metric.php b/src/Screen/Layouts/Metric.php
index 4388a51b4..479d22f1d 100644
--- a/src/Screen/Layouts/Metric.php
+++ b/src/Screen/Layouts/Metric.php
@@ -16,7 +16,7 @@ class Metric extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.metric';
+ protected $template = 'orchid::layouts.metric';
/**
* @var string|null
diff --git a/src/Screen/Layouts/Modal.php b/src/Screen/Layouts/Modal.php
index be284e7f9..baec75743 100644
--- a/src/Screen/Layouts/Modal.php
+++ b/src/Screen/Layouts/Modal.php
@@ -9,7 +9,7 @@
use Orchid\Screen\Commander;
use Orchid\Screen\Layout;
use Orchid\Screen\Repository;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
/**
* Class Modal.
@@ -51,7 +51,7 @@ class Modal extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.modal';
+ protected $template = 'orchid::layouts.modal';
/**
* Modal constructor.
@@ -226,13 +226,13 @@ public function async(string $method): self
*/
protected function asyncRoute(): ?string
{
- $screen = Dashboard::getCurrentScreen();
+ $screen = Orchid::getCurrentScreen();
if (! $screen) {
return null;
}
- return route('platform.async', [
+ return route('orchid.async', [
'screen' => Crypt::encryptString(get_class($screen)),
'method' => $this->method,
'template' => $this->getSlug(),
diff --git a/src/Screen/Layouts/Persona.php b/src/Screen/Layouts/Persona.php
index f2b418518..1229997f4 100644
--- a/src/Screen/Layouts/Persona.php
+++ b/src/Screen/Layouts/Persona.php
@@ -12,7 +12,7 @@ class Persona extends Content
/**
* @var string
*/
- protected $template = 'platform::layouts.persona';
+ protected $template = 'orchid::layouts.persona';
public function render(Personable $user): View
{
diff --git a/src/Screen/Layouts/Rows.php b/src/Screen/Layouts/Rows.php
index 0b7b88165..8b8faa4c3 100644
--- a/src/Screen/Layouts/Rows.php
+++ b/src/Screen/Layouts/Rows.php
@@ -19,7 +19,7 @@ abstract class Rows extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.row';
+ protected $template = 'orchid::layouts.row';
/**
* Used to create the title of a group of form elements.
diff --git a/src/Screen/Layouts/Selection.php b/src/Screen/Layouts/Selection.php
index 63098276b..9af4cb14c 100644
--- a/src/Screen/Layouts/Selection.php
+++ b/src/Screen/Layouts/Selection.php
@@ -17,12 +17,12 @@ abstract class Selection extends Layout
/**
* Drop-down filters.
*/
- public const TEMPLATE_DROP_DOWN = 'platform::layouts.selection';
+ public const TEMPLATE_DROP_DOWN = 'orchid::layouts.selection';
/**
* Line filters.
*/
- public const TEMPLATE_LINE = 'platform::layouts.filter';
+ public const TEMPLATE_LINE = 'orchid::layouts.filter';
/**
* @var string
diff --git a/src/Screen/Layouts/Sortable.php b/src/Screen/Layouts/Sortable.php
index c9b83d094..7ea39c435 100644
--- a/src/Screen/Layouts/Sortable.php
+++ b/src/Screen/Layouts/Sortable.php
@@ -12,7 +12,7 @@ abstract class Sortable extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.sortable';
+ protected $template = 'orchid::layouts.sortable';
/**
* Used to create the title of a group of form elements.
diff --git a/src/Screen/Layouts/Split.php b/src/Screen/Layouts/Split.php
index 9e039748c..399745e51 100644
--- a/src/Screen/Layouts/Split.php
+++ b/src/Screen/Layouts/Split.php
@@ -17,7 +17,7 @@ abstract class Split extends Layout
*
* @var string
*/
- protected $template = 'platform::layouts.split';
+ protected $template = 'orchid::layouts.split';
/**
* An array of default variables that will be passed to the template.
diff --git a/src/Screen/Layouts/TabMenu.php b/src/Screen/Layouts/TabMenu.php
index 961922841..b3a1471c2 100644
--- a/src/Screen/Layouts/TabMenu.php
+++ b/src/Screen/Layouts/TabMenu.php
@@ -19,7 +19,7 @@ abstract class TabMenu extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.tabMenu';
+ protected $template = 'orchid::layouts.tabMenu';
/**
* @throws Throwable
diff --git a/src/Screen/Layouts/Table.php b/src/Screen/Layouts/Table.php
index a7862a979..6fffd316e 100644
--- a/src/Screen/Layouts/Table.php
+++ b/src/Screen/Layouts/Table.php
@@ -20,7 +20,7 @@ abstract class Table extends Layout
/**
* @var string
*/
- protected $template = 'platform::layouts.table';
+ protected $template = 'orchid::layouts.table';
/**
* @var Repository
diff --git a/src/Screen/Layouts/Tabs.php b/src/Screen/Layouts/Tabs.php
index af452bf68..f6ad984be 100644
--- a/src/Screen/Layouts/Tabs.php
+++ b/src/Screen/Layouts/Tabs.php
@@ -15,7 +15,7 @@ abstract class Tabs extends Layout
/**
* @var string
*/
- public $template = 'platform::layouts.tabs';
+ public $template = 'orchid::layouts.tabs';
/**
* @var array
diff --git a/src/Screen/Screen.php b/src/Screen/Screen.php
index beb8603cb..3cb6afdb6 100644
--- a/src/Screen/Screen.php
+++ b/src/Screen/Screen.php
@@ -16,7 +16,7 @@
use Illuminate\Support\Facades\Route;
use Orchid\Platform\Http\Controllers\Controller;
use Orchid\Screen\Layouts\Listener;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
/**
* Class Screen.
@@ -49,7 +49,7 @@ public function __invoke(Request $request, ...$arguments)
*/
public function screenBaseView(): string
{
- return 'platform::layouts.base';
+ return 'orchid::layouts.base';
}
/**
@@ -124,7 +124,7 @@ public function build(Repository $repository)
*/
public function asyncBuild(string $method, string $slug)
{
- Dashboard::setCurrentScreen($this, true);
+ Orchid::setCurrentScreen($this, true);
abort_unless(method_exists($this, $method), 404, "Async method: {$method} not found");
@@ -160,7 +160,7 @@ public function asyncBuild(string $method, string $slug)
*/
public function asyncParticalLayout(Layout $layout, Request $request)
{
- Dashboard::setCurrentScreen($this, true);
+ Orchid::setCurrentScreen($this, true);
abort_unless($this->checkAccess(request()), static::unaccessed());
@@ -168,7 +168,7 @@ public function asyncParticalLayout(Layout $layout, Request $request)
$repository = $layout->handle($state, $request);
- $view = $layout->build($repository).view('platform::partials.state', [
+ $view = $layout->build($repository).view('orchid::partials.state', [
'state' => $this->serializeStateWithPublicProperties($state),
]);
@@ -322,7 +322,7 @@ public static function unaccessed()
*/
public function handle(Request $request, ...$arguments)
{
- Dashboard::setCurrentScreen($this);
+ Orchid::setCurrentScreen($this);
$method = $request->route()->parameter('method', 'view');
@@ -372,7 +372,7 @@ public function formValidateMessage(): string
*/
public function needPreventsAbandonment(): bool
{
- return config('platform.prevents_abandonment', true);
+ return config('orchid.prevents_abandonment', true);
}
/**
@@ -388,7 +388,7 @@ public function isScreenFullStatePreserved(): bool
->filter()
->isNotEmpty();
- return config('platform.full_state', $existListenerLayout);
+ return config('orchid.full_state', $existListenerLayout);
}
/**
diff --git a/src/Screen/Sight.php b/src/Screen/Sight.php
index 3156204c0..8d0de8136 100644
--- a/src/Screen/Sight.php
+++ b/src/Screen/Sight.php
@@ -17,7 +17,7 @@ class Sight extends Cell
*/
public function buildDt()
{
- return view('platform::partials.layouts.dt', [
+ return view('orchid::partials.layouts.dt', [
'column' => $this->column,
'title' => $this->title,
'popover' => $this->popover,
diff --git a/src/Screen/TD.php b/src/Screen/TD.php
index f7665b745..2fa868cb6 100644
--- a/src/Screen/TD.php
+++ b/src/Screen/TD.php
@@ -221,7 +221,7 @@ public function colspan(int $colspan): self
*/
public function buildTh()
{
- return view('platform::partials.layouts.th', [
+ return view('orchid::partials.layouts.th', [
'width' => is_numeric($this->width) ? $this->width.'px' : $this->width,
'align' => $this->align,
'sort' => $this->sort,
@@ -285,7 +285,7 @@ public function buildTd($repository, ?object $loop = null)
{
$value = $this->render ? $this->handler($repository, $loop) : $repository->getContent($this->name);
- return view('platform::partials.layouts.td', [
+ return view('orchid::partials.layouts.td', [
'align' => $this->align,
'value' => $value,
'render' => $this->render,
@@ -313,7 +313,7 @@ public function buildItemMenu()
return;
}
- return view('platform::partials.layouts.selectedTd', [
+ return view('orchid::partials.layouts.selectedTd', [
'title' => $this->title,
'slug' => $this->sluggable(),
'defaultHidden' => var_export($this->defaultHidden, true),
diff --git a/src/Support/Facades/Dashboard.php b/src/Support/Facades/Orchid.php
similarity index 89%
rename from src/Support/Facades/Dashboard.php
rename to src/Support/Facades/Orchid.php
index 60a59dc1c..b0a6ff593 100644
--- a/src/Support/Facades/Dashboard.php
+++ b/src/Support/Facades/Orchid.php
@@ -6,11 +6,11 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Facade;
-use Orchid\Platform\Dashboard as DashboardKernel;
+use Orchid\Platform\Orchid as OrchidPlatform;
use Orchid\Screen\Screen;
/**
- * Class Dashboard.
+ * Class Orchid.
*
* @method static Collection getSearch()
* @method static Collection getPermission()
@@ -27,7 +27,7 @@
* @method static Screen|null getCurrentScreen()
* @method static bool isPartialRequest()
*/
-class Dashboard extends Facade
+class Orchid extends Facade
{
/**
* Initiate a mock expectation on the facade.
@@ -36,6 +36,6 @@ class Dashboard extends Facade
*/
protected static function getFacadeAccessor()
{
- return DashboardKernel::class;
+ return OrchidPlatform::class;
}
}
diff --git a/stubs/app/Orchid/Layouts/Examples/ExampleElements.php b/stubs/app/Orchid/Layouts/Examples/ExampleElements.php
index 92a098f82..71556b4d3 100644
--- a/stubs/app/Orchid/Layouts/Examples/ExampleElements.php
+++ b/stubs/app/Orchid/Layouts/Examples/ExampleElements.php
@@ -16,16 +16,16 @@ protected function navigations(): iterable
{
return [
Menu::make('Basic Elements')
- ->route('platform.example.fields'),
+ ->route('orchid.example.fields'),
Menu::make('Advanced Elements')
- ->route('platform.example.advanced'),
+ ->route('orchid.example.advanced'),
Menu::make('Text Editors')
- ->route('platform.example.editors'),
+ ->route('orchid.example.editors'),
Menu::make('Run Actions')
- ->route('platform.example.actions'),
+ ->route('orchid.example.actions'),
];
}
}
diff --git a/stubs/app/Orchid/Layouts/Examples/TabMenuExample.php b/stubs/app/Orchid/Layouts/Examples/TabMenuExample.php
index c9b64f463..7275e6949 100644
--- a/stubs/app/Orchid/Layouts/Examples/TabMenuExample.php
+++ b/stubs/app/Orchid/Layouts/Examples/TabMenuExample.php
@@ -16,7 +16,7 @@ protected function navigations(): iterable
{
return [
Menu::make('Overview layouts')
- ->route('platform.example.layouts'),
+ ->route('orchid.example.layouts'),
Menu::make('Get Started')
->route('platform.main'),
@@ -25,7 +25,7 @@ protected function navigations(): iterable
->url('https://orchid.software/en/docs'),
Menu::make('Example Screen')
- ->route('platform.example')
+ ->route('orchid.example')
->badge(fn () => 6),
];
}
diff --git a/stubs/app/Orchid/PlatformProvider.php b/stubs/app/Orchid/PlatformProvider.php
index f49a20b9c..e27a01cfb 100644
--- a/stubs/app/Orchid/PlatformProvider.php
+++ b/stubs/app/Orchid/PlatformProvider.php
@@ -4,7 +4,7 @@
namespace App\Orchid;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\ItemPermission;
use Orchid\Platform\OrchidServiceProvider;
use Orchid\Screen\Actions\Menu;
@@ -12,20 +12,6 @@
class PlatformProvider extends OrchidServiceProvider
{
- /**
- * Bootstrap the application services.
- *
- * @param Dashboard $dashboard
- *
- * @return void
- */
- public function boot(Dashboard $dashboard): void
- {
- parent::boot($dashboard);
-
- // ...
- }
-
/**
* Register the application menu.
*
@@ -41,29 +27,29 @@ public function menu(): array
Menu::make('Sample Screen')
->icon('bs.collection')
- ->route('platform.example')
+ ->route('orchid.example')
->badge(fn () => 6),
Menu::make('Form Elements')
->icon('bs.card-list')
- ->route('platform.example.fields')
+ ->route('orchid.example.fields')
->active('*/examples/form/*'),
Menu::make('Overview Layouts')
->icon('bs.window-sidebar')
- ->route('platform.example.layouts'),
+ ->route('orchid.example.layouts'),
Menu::make('Grid System')
->icon('bs.columns-gap')
- ->route('platform.example.grid'),
+ ->route('orchid.example.grid'),
Menu::make('Charts')
->icon('bs.bar-chart')
- ->route('platform.example.charts'),
+ ->route('orchid.example.charts'),
Menu::make('Cards')
->icon('bs.card-text')
- ->route('platform.example.cards')
+ ->route('orchid.example.cards')
->divider(),
Menu::make(__('Users'))
@@ -88,7 +74,7 @@ public function menu(): array
->icon('bs.box-arrow-up-right')
->url('https://github.com/orchidsoftware/platform/blob/master/CHANGELOG.md')
->target('_blank')
- ->badge(fn () => Dashboard::version(), Color::DARK),
+ ->badge(fn () => Orchid::version(), Color::DARK),
];
}
diff --git a/stubs/app/Orchid/Screens/User/UserListScreen.php b/stubs/app/Orchid/Screens/User/UserListScreen.php
index d22122ff5..085008e91 100644
--- a/stubs/app/Orchid/Screens/User/UserListScreen.php
+++ b/stubs/app/Orchid/Screens/User/UserListScreen.php
@@ -65,7 +65,7 @@ public function commandBar(): iterable
return [
Link::make(__('Add'))
->icon('bs.plus-circle')
- ->route('platform.systems.users.create'),
+ ->route('orchid.systems.users.create'),
];
}
diff --git a/stubs/app/Providers/OrchidServiceProvider.php b/stubs/app/Providers/OrchidServiceProvider.php
new file mode 100644
index 000000000..c4f50cd80
--- /dev/null
+++ b/stubs/app/Providers/OrchidServiceProvider.php
@@ -0,0 +1,24 @@
+name('platform.main');
+ ->name('orchid.main');
// Platform > Profile
Route::screen('profile', UserProfileScreen::class)
- ->name('platform.profile')
+ ->name('orchid.profile')
->breadcrumbs(fn (Trail $trail) => $trail
- ->parent('platform.index')
- ->push(__('Profile'), route('platform.profile')));
+ ->parent('orchid.index')
+ ->push(__('Profile'), route('orchid.profile')));
// Platform > System > Users > User
Route::screen('users/{user}/edit', UserEditScreen::class)
- ->name('platform.systems.users.edit')
+ ->name('orchid.systems.users.edit')
->breadcrumbs(fn (Trail $trail, $user) => $trail
- ->parent('platform.systems.users')
- ->push($user->name, route('platform.systems.users.edit', $user)));
+ ->parent('orchid.systems.users')
+ ->push($user->name, route('orchid.systems.users.edit', $user)));
// Platform > System > Users > Create
Route::screen('users/create', UserEditScreen::class)
- ->name('platform.systems.users.create')
+ ->name('orchid.systems.users.create')
->breadcrumbs(fn (Trail $trail) => $trail
- ->parent('platform.systems.users')
- ->push(__('Create'), route('platform.systems.users.create')));
+ ->parent('orchid.systems.users')
+ ->push(__('Create'), route('orchid.systems.users.create')));
// Platform > System > Users
Route::screen('users', UserListScreen::class)
- ->name('platform.systems.users')
+ ->name('orchid.systems.users')
->breadcrumbs(fn (Trail $trail) => $trail
- ->parent('platform.index')
- ->push(__('Users'), route('platform.systems.users')));
+ ->parent('orchid.index')
+ ->push(__('Users'), route('orchid.systems.users')));
// Platform > System > Roles > Role
Route::screen('roles/{role}/edit', RoleEditScreen::class)
- ->name('platform.systems.roles.edit')
+ ->name('orchid.systems.roles.edit')
->breadcrumbs(fn (Trail $trail, $role) => $trail
- ->parent('platform.systems.roles')
- ->push($role->name, route('platform.systems.roles.edit', $role)));
+ ->parent('orchid.systems.roles')
+ ->push($role->name, route('orchid.systems.roles.edit', $role)));
// Platform > System > Roles > Create
Route::screen('roles/create', RoleEditScreen::class)
- ->name('platform.systems.roles.create')
+ ->name('orchid.systems.roles.create')
->breadcrumbs(fn (Trail $trail) => $trail
- ->parent('platform.systems.roles')
- ->push(__('Create'), route('platform.systems.roles.create')));
+ ->parent('orchid.systems.roles')
+ ->push(__('Create'), route('orchid.systems.roles.create')));
// Platform > System > Roles
Route::screen('roles', RoleListScreen::class)
- ->name('platform.systems.roles')
+ ->name('orchid.systems.roles')
->breadcrumbs(fn (Trail $trail) => $trail
- ->parent('platform.index')
- ->push(__('Roles'), route('platform.systems.roles')));
+ ->parent('orchid.index')
+ ->push(__('Roles'), route('orchid.systems.roles')));
// Example...
Route::screen('example', ExampleScreen::class)
- ->name('platform.example')
+ ->name('orchid.example')
->breadcrumbs(fn (Trail $trail) => $trail
- ->parent('platform.index')
+ ->parent('orchid.index')
->push('Example Screen'));
-Route::screen('/examples/form/fields', ExampleFieldsScreen::class)->name('platform.example.fields');
-Route::screen('/examples/form/advanced', ExampleFieldsAdvancedScreen::class)->name('platform.example.advanced');
-Route::screen('/examples/form/editors', ExampleTextEditorsScreen::class)->name('platform.example.editors');
-Route::screen('/examples/form/actions', ExampleActionsScreen::class)->name('platform.example.actions');
+Route::screen('/examples/form/fields', ExampleFieldsScreen::class)->name('orchid.example.fields');
+Route::screen('/examples/form/advanced', ExampleFieldsAdvancedScreen::class)->name('orchid.example.advanced');
+Route::screen('/examples/form/editors', ExampleTextEditorsScreen::class)->name('orchid.example.editors');
+Route::screen('/examples/form/actions', ExampleActionsScreen::class)->name('orchid.example.actions');
-Route::screen('/examples/layouts', ExampleLayoutsScreen::class)->name('platform.example.layouts');
-Route::screen('/examples/grid', ExampleGridScreen::class)->name('platform.example.grid');
-Route::screen('/examples/charts', ExampleChartsScreen::class)->name('platform.example.charts');
-Route::screen('/examples/cards', ExampleCardsScreen::class)->name('platform.example.cards');
+Route::screen('/examples/layouts', ExampleLayoutsScreen::class)->name('orchid.example.layouts');
+Route::screen('/examples/grid', ExampleGridScreen::class)->name('orchid.example.grid');
+Route::screen('/examples/charts', ExampleChartsScreen::class)->name('orchid.example.charts');
+Route::screen('/examples/cards', ExampleCardsScreen::class)->name('orchid.example.cards');
-//Route::screen('idea', Idea::class, 'platform.screens.idea');
+//Route::screen('idea', Idea::class, 'orchid.screens.idea');
diff --git a/tests/App/ExemplarServiceProvider.php b/tests/App/ExemplarServiceProvider.php
index 84b1017ac..3626679e2 100644
--- a/tests/App/ExemplarServiceProvider.php
+++ b/tests/App/ExemplarServiceProvider.php
@@ -6,7 +6,7 @@
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Tests\App\Fields\BaseSelectScreen;
use Orchid\Tests\App\Screens\AsyncHeaderButtonActionScreen;
use Orchid\Tests\App\Screens\ConfirmScreen;
@@ -26,7 +26,7 @@ class ExemplarServiceProvider extends ServiceProvider
/**
* Boot the application events.
*/
- public function boot(Dashboard $dashboard, Router $router): void
+ public function boot(Orchid $dashboard, Router $router): void
{
$dashboard->registerSearch([
SearchUser::class,
@@ -34,9 +34,9 @@ public function boot(Dashboard $dashboard, Router $router): void
$this->loadViewsFrom($dashboard->path('tests/App/Views'), 'exemplar');
- $router->domain((string) config('platform.domain'))
- ->prefix(Dashboard::prefix('/'))
- ->middleware(config('platform.middleware.private'))
+ $router->domain((string) config('orchid.domain'))
+ ->prefix(Orchid::prefix('/'))
+ ->middleware(config('orchid.middleware.private'))
->as('test.')
->group(function ($route) {
$route->screen('modal-validation', ModalValidationScreen::class)->name('modal-validation');
diff --git a/tests/Console/ArtisanTest.php b/tests/Console/ArtisanTest.php
index f62045474..111f94d2e 100644
--- a/tests/Console/ArtisanTest.php
+++ b/tests/Console/ArtisanTest.php
@@ -7,7 +7,7 @@
use Generator;
use Illuminate\Support\Str;
use Orchid\Platform\Models\User;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
use Orchid\Tests\TestConsoleCase;
class ArtisanTest extends TestConsoleCase
@@ -65,7 +65,7 @@ public function testArtisanOrchidAdmin(): void
$user->refresh();
- $this->assertEquals(Dashboard::getAllowAllPermission()->toArray(), $user->permissions);
+ $this->assertEquals(Orchid::getAllowAllPermission()->toArray(), $user->permissions);
}
public function testArtisanOrchidInstall(): void
diff --git a/tests/Environment.php b/tests/Environment.php
index 9d8ab1e36..fa0ba349d 100644
--- a/tests/Environment.php
+++ b/tests/Environment.php
@@ -9,7 +9,7 @@
use Orchid\Platform\Models\User;
use Orchid\Platform\Providers\FoundationServiceProvider;
use Orchid\Support\Facades\Alert;
-use Orchid\Support\Facades\Dashboard;
+use Orchid\Support\Facades\Orchid;
use Orchid\Tests\App\ExemplarServiceProvider;
use Tabuna\Breadcrumbs\Breadcrumbs;
use Tabuna\Breadcrumbs\BreadcrumbsServiceProvider;
@@ -111,7 +111,7 @@ protected function getPackageAliases($app): array
'Alert' => Alert::class,
'Active' => Active::class,
'Breadcrumbs' => Breadcrumbs::class,
- 'Dashboard' => Dashboard::class,
+ 'Orchid' => Orchid::class,
];
}
}
diff --git a/tests/Feature/App/RouteResolveScreenTest.php b/tests/Feature/App/RouteResolveScreenTest.php
index 161144f35..d79d2590e 100644
--- a/tests/Feature/App/RouteResolveScreenTest.php
+++ b/tests/Feature/App/RouteResolveScreenTest.php
@@ -30,7 +30,7 @@ public function testResolveModel(): void
public function testImplicitBinding(): void
{
Route::screen('bind/users/{user}', ModelRouteBindScreen::class)
- ->middleware(config('platform.middleware.private'))
+ ->middleware(config('orchid.middleware.private'))
->name('bind.implicit-binding');
$user = $this->createAdminUser();
@@ -46,7 +46,7 @@ public function testImplicitBinding(): void
public function testImplicitBindingWhenAllowNull(): void
{
Route::screen('bind/users/{user?}', ModelRouteBindScreen::class)
- ->middleware(config('platform.middleware.private'))
+ ->middleware(config('orchid.middleware.private'))
->name('bind.implicit-binding');
$user = $this->createAdminUser();
@@ -62,7 +62,7 @@ public function testImplicitBindingWhenAllowNull(): void
public function testCustomizingKey(): void
{
Route::screen('bind/users/{user:email}', ModelRouteBindScreen::class)
- ->middleware(config('platform.middleware.private'))
+ ->middleware(config('orchid.middleware.private'))
->name('bind.customizing-key');
$user = $this->createAdminUser();
@@ -80,7 +80,7 @@ public function testExplicitBinding(): void
Route::model('bind', User::class);
Route::screen('bind/users/{bind}', ModelRouteParamBindScreen::class)
- ->middleware(config('platform.middleware.private'))
+ ->middleware(config('orchid.middleware.private'))
->name('bind.explicit-binding');
$user = $this->createAdminUser();
@@ -100,7 +100,7 @@ public function testResolutionLogic(): void
});
Route::screen('bind/users/{user}', ModelRouteBindScreen::class)
- ->middleware(config('platform.middleware.private'))
+ ->middleware(config('orchid.middleware.private'))
->name('bind.resolution-logic');
$user = $this->createAdminUser();
diff --git a/tests/Feature/Example/UserTest.php b/tests/Feature/Example/UserTest.php
index cd2aaab6c..d78d4841f 100644
--- a/tests/Feature/Example/UserTest.php
+++ b/tests/Feature/Example/UserTest.php
@@ -23,7 +23,7 @@ public function testRouteSystemsUsersCreate(): void
{
$response = $this
->actingAs($this->createAdminUser())
- ->get(route('platform.systems.users.create'));
+ ->get(route('orchid.systems.users.create'));
$response->assertOk()
->assertSee('field-user');
diff --git a/tests/Feature/Platform/AuthTest.php b/tests/Feature/Platform/AuthTest.php
index 8f1a82695..dab9d9e1c 100644
--- a/tests/Feature/Platform/AuthTest.php
+++ b/tests/Feature/Platform/AuthTest.php
@@ -32,7 +32,7 @@ public function testRouteDashboardLoginAuthSuccess(): void
'remember' => 'on',
])
->assertStatus(302)
- ->assertRedirect(route(config('platform.index')))
+ ->assertRedirect(route(config('orchid.index')))
->assertCookieNotExpired('lockUser');
}
@@ -60,7 +60,7 @@ public function testRouteDashboardSwitchLogout(): void
$this
->actingAs($this->createAdminUser())
->post(route('platform.switch.logout'))
- ->assertRedirect(route(config('platform.index')));
+ ->assertRedirect(route(config('orchid.index')));
}
public function testRouteDashboardAuthLogout(): void
diff --git a/tests/Feature/Platform/FallbackDisabledTest.php b/tests/Feature/Platform/FallbackDisabledTest.php
index 1c3a05e14..a63259c36 100644
--- a/tests/Feature/Platform/FallbackDisabledTest.php
+++ b/tests/Feature/Platform/FallbackDisabledTest.php
@@ -5,7 +5,7 @@
namespace Orchid\Tests\Feature\Platform;
use Illuminate\Support\Str;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Tests\TestFeatureCase;
class FallbackDisabledTest extends TestFeatureCase
@@ -24,7 +24,7 @@ public function testRouteDisabled(): void
{
$response = $this
->actingAs($this->createAdminUser())
- ->get(Dashboard::prefix('/error-test/').Str::random());
+ ->get(Orchid::prefix('/error-test/').Str::random());
$response
->assertDontSee('orchid.software')
diff --git a/tests/Feature/Platform/FallbackEnabledTest.php b/tests/Feature/Platform/FallbackEnabledTest.php
index 0d619f152..7f2dc0fab 100644
--- a/tests/Feature/Platform/FallbackEnabledTest.php
+++ b/tests/Feature/Platform/FallbackEnabledTest.php
@@ -5,7 +5,7 @@
namespace Orchid\Tests\Feature\Platform;
use Illuminate\Support\Str;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Tests\TestFeatureCase;
class FallbackEnabledTest extends TestFeatureCase
@@ -14,7 +14,7 @@ public function testRouteEnabled(): void
{
$response = $this
->actingAs($this->createAdminUser())
- ->get(Dashboard::prefix('/error-test/').Str::random());
+ ->get(Orchid::prefix('/error-test/').Str::random());
$response
->assertSee('orchid.software')
diff --git a/tests/Feature/Platform/GuardAuthTest.php b/tests/Feature/Platform/GuardAuthTest.php
index f966c01f3..5e8ff2e44 100644
--- a/tests/Feature/Platform/GuardAuthTest.php
+++ b/tests/Feature/Platform/GuardAuthTest.php
@@ -36,7 +36,7 @@ public function testRouteCustomGuardAuthSuccess(): void
'remember' => 'on',
])
->assertStatus(302)
- ->assertRedirect(route(config('platform.index')));
+ ->assertRedirect(route(config('orchid.index')));
}
public function testFailCustomGuard(): void
@@ -50,7 +50,7 @@ public function testFailCustomGuard(): void
public function testCustomGuardShouldUse(): void
{
- Route::middleware(config('platform.middleware.private'))->get('custom-guard', function () {
+ Route::middleware(config('orchid.middleware.private'))->get('custom-guard', function () {
/** @var \Illuminate\Auth\SessionGuard $sessionGuard */
$sessionGuard = Auth::guard();
diff --git a/tests/Unit/DashboardTest.php b/tests/Unit/DashboardTest.php
index e7fdcc034..269b72eaa 100644
--- a/tests/Unit/DashboardTest.php
+++ b/tests/Unit/DashboardTest.php
@@ -5,7 +5,7 @@
namespace Orchid\Tests\Unit;
use Illuminate\Support\Str;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\Models\User;
use Orchid\Screen\Actions\Menu;
use Orchid\Tests\TestUnitCase;
@@ -17,12 +17,12 @@ class DashboardTest extends TestUnitCase
{
public function testIsVersion(): void
{
- $this->assertEquals(Dashboard::VERSION, Dashboard::version());
+ $this->assertEquals(Orchid::VERSION, Orchid::version());
}
public function testIsModelDefault(): void
{
- $class = Dashboard::modelClass('UnknownClass', User::class);
+ $class = Orchid::modelClass('UnknownClass', User::class);
$default = new User();
@@ -31,32 +31,32 @@ public function testIsModelDefault(): void
public function testIsModelCustomNotFound(): void
{
- Dashboard::useModel(User::class, 'MyCustomClass');
+ Orchid::useModel(User::class, 'MyCustomClass');
- $user = Dashboard::modelClass(User::class);
+ $user = Orchid::modelClass(User::class);
$this->assertEquals('MyCustomClass', $user);
}
public function testIsModelConfigure(): void
{
- Dashboard::configure([
+ Orchid::configure([
'models' => [
User::class => 'MyCustomClass',
],
]);
- $class = Dashboard::model(User::class);
- $option = Dashboard::option('models.'.User::class);
+ $class = Orchid::model(User::class);
+ $option = Orchid::option('models.'.User::class);
$this->assertEquals('MyCustomClass', $class);
$this->assertEquals('MyCustomClass', $option);
- $this->assertEquals(null, Dashboard::option('random'));
+ $this->assertEquals(null, Orchid::option('random'));
}
public function testIsRegisterResource(): void
{
- $dashboard = new Dashboard();
+ $dashboard = new Orchid();
$script = $dashboard
->registerResource('scripts', 'app.js')
@@ -107,14 +107,14 @@ public function testIsRegisterResource(): void
*/
public function testIsMacro($name = 'customMarcoName'): void
{
- Dashboard::macro('returnNameMacroFunction', fn (string $test) => $test);
+ Orchid::macro('returnNameMacroFunction', fn (string $test) => $test);
- $this->assertEquals(Dashboard::returnNameMacroFunction($name), $name);
+ $this->assertEquals(Orchid::returnNameMacroFunction($name), $name);
}
public function testRegisterMenuElement(): void
{
- $dashboard = new Dashboard();
+ $dashboard = new Orchid();
$view = $dashboard
->registerMenuElement(Menu::make('Item 1')->sort(3))
@@ -128,7 +128,7 @@ public function testRegisterMenuElement(): void
public function testAddMenuSubElements(): void
{
- $dashboard = new Dashboard();
+ $dashboard = new Orchid();
$view = $dashboard
->registerMenuElement(Menu::make('Item 1')->slug('item'))
@@ -143,12 +143,12 @@ public function testAddMenuSubElements(): void
protected function setUp(): void
{
parent::setUp();
- Dashboard::configure([]);
+ Orchid::configure([]);
}
protected function tearDown(): void
{
parent::tearDown();
- Dashboard::configure([]);
+ Orchid::configure([]);
}
}
diff --git a/tests/Unit/LocaleTest.php b/tests/Unit/LocaleTest.php
index d6fb2b5f9..8d139757c 100644
--- a/tests/Unit/LocaleTest.php
+++ b/tests/Unit/LocaleTest.php
@@ -5,7 +5,7 @@
namespace Orchid\Tests\Unit;
use Illuminate\Support\Collection;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Tests\TestUnitCase;
use Symfony\Component\Finder\Finder;
@@ -48,7 +48,7 @@ public function testUsageAllTranslateString(): void
protected function getTranslationFiles(): Collection
{
- $patternPath = Dashboard::path('resources/lang').'/*.json';
+ $patternPath = Orchid::path('resources/lang').'/*.json';
return collect(glob($patternPath));
}
@@ -66,11 +66,11 @@ protected function checkUsageTranslateStringInProject(string $string): bool
->ignoreUnreadableDirs()
->followLinks()
->in([
- Dashboard::path('src'),
- Dashboard::path('stubs'),
- Dashboard::path('routes'),
- Dashboard::path('resources/js'),
- Dashboard::path('resources/views'),
+ Orchid::path('src'),
+ Orchid::path('stubs'),
+ Orchid::path('routes'),
+ Orchid::path('resources/js'),
+ Orchid::path('resources/views'),
])
->contains($string)
->hasResults();
diff --git a/tests/Unit/PermissionTest.php b/tests/Unit/PermissionTest.php
index c1669c38c..70ebad69b 100644
--- a/tests/Unit/PermissionTest.php
+++ b/tests/Unit/PermissionTest.php
@@ -5,7 +5,7 @@
namespace Orchid\Tests\Unit;
use Exception;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Platform\ItemPermission;
use Orchid\Platform\Models\Role;
use Orchid\Platform\Models\User;
@@ -114,7 +114,7 @@ private function createRole(): Role
*/
public function testIsRegisteredPermission(): void
{
- $dashboard = new Dashboard();
+ $dashboard = new Orchid();
$permission = ItemPermission::group('Test')
->addPermission('test', 'Test Description');
@@ -129,7 +129,7 @@ public function testIsRegisteredPermission(): void
*/
public function testGetPermissionsByGroup(): void
{
- $dashboard = new Dashboard();
+ $dashboard = new Orchid();
$permissionA = ItemPermission::group('Test-A')
->addPermission('test_a', 'Test Description A');
@@ -149,7 +149,7 @@ public function testGetPermissionsByGroup(): void
*/
public function testIsWasRemovedPermission(): void
{
- $dashboard = new Dashboard();
+ $dashboard = new Orchid();
$permission = ItemPermission::group('Test')
->addPermission('test', 'Test Description');
$dashboard->registerPermissions($permission);
diff --git a/tests/Unit/PublishedResourceTest.php b/tests/Unit/PublishedResourceTest.php
index b6a146e5d..d2062e4e2 100644
--- a/tests/Unit/PublishedResourceTest.php
+++ b/tests/Unit/PublishedResourceTest.php
@@ -4,7 +4,7 @@
namespace Orchid\Tests\Unit;
-use Orchid\Platform\Dashboard;
+use Orchid\Platform\Orchid;
use Orchid\Support\Formats;
use Orchid\Tests\TestUnitCase;
@@ -26,17 +26,17 @@ public function testFilesAreMinified(): void
$maxVendorSize = 2 * 1028 * 1028; // ~2 mb
$this->assertLessThan($maxCssSize,
- filesize(Dashboard::path('/public/css/orchid.css')),
+ filesize(Orchid::path('/public/css/orchid.css')),
'File orchid.css more '.Formats::formatBytes($maxCssSize)
);
$this->assertLessThan($maxJsSize,
- filesize(Dashboard::path('/public/js/orchid.js')),
+ filesize(Orchid::path('/public/js/orchid.js')),
'File orchid.js more '.Formats::formatBytes($maxJsSize)
);
$this->assertLessThan($maxVendorSize,
- filesize(Dashboard::path('/public/js/vendor.js')),
+ filesize(Orchid::path('/public/js/vendor.js')),
'File vendor.js more '.Formats::formatBytes($maxVendorSize)
);
}