Nexus is an Admin Panel based on Laravel Framework
- Composer
- Laravel Framework 6.x/7.x/8.x
- Laravel Mix
- Node.js & NPM
Run the following command in your console terminal:
$ composer require zrkb/nexus
Or if you want to download the files, add the following configuration to the composer.json file:
"repositories": [
{
"type": "path",
"url": "../nexus"
}
],
Now run:
$ composer require zrkb/nexus @dev
Next make sure to create a new database and add your database credentials to your .env
file:
DB_HOST=localhost
DB_DATABASE=laravel
DB_USERNAME=laravel
DB_PASSWORD=secret
Finally, run the install command and migrate Artisan commands.
$ php artisan nexus:install
In order to create an user for the admin panel, run the next command:
$ php artisan nexus:user
Your admin user must subclass from Nexus Admin Model, you can change this in nexus.php
config file:
'providers' => [
'admins' => [
'driver' => 'eloquent',
'model' => \Nexus\Models\Admin::class,
],
// ...
],
You may want to generate a new resource using the nexus:crud
Artisan command:
$ php artisan nexus:crud Bookmark
This will create the following files:
// Model
app/Models/Bookmark.php
// Controller
app/Http/Controllers/Backend/BookmarkController.php
// Migration
database/migrations/YYYY_MM_DD_HHIISS_create_bookmarks_table.php
// Views
resources/views/bookmarks/create.blade.php
resources/views/bookmarks/edit.blade.php
resources/views/bookmarks/form.blade.php
resources/views/bookmarks/index.blade.php
resources/views/bookmarks/show.blade.php
Note: You may want to run
php artisan migrate
command to create the table in the database.
Once the resource are created, we need to add them to the project:
Edit your routes/web.php
and the new resource:
Nexus::resource('bookmarks', 'BookmarkController');
or the equivalent:
Nexus::group(function () {
Route::resource('bookmarks', 'BookmarkController');
});
Edit your resources/views/vendor/nexus/sidebar/user.blade.php
file and add the code below:
<li>
<a href="{{ route('bookmarks.index') }}"
class="nav-link {{ is_route('bookmarks.index') ? 'active' : '' }}"
role="button">
<i class='bx bx-bookmarks'></i>
<span>Bookmarks</span>
</a>
</li>
That's all! You may refresh your dashboard page and you'll see a new item in the sidebar, click on it and explore your new resource.
- Assign permissions automatically to role Developer when creating a resource
- Add middleware for auth routes redirect when login
- Migration file stub
- Menus Admin
- Media Library Admin
- Conditionals for stubs files (Case: not all models will use SoftDelete feature)
- Analyze Scaffold vs Runtime Gen
- Separate blog as a package
If you discover any security related issues, please use the issue tracker.
The MIT License (MIT). Please see License File for more information.