GithubHelp home page GithubHelp logo

zrkb / nexus Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 15.78 MB

Nexus is an Admin Panel based on Laravel Framework

License: MIT License

PHP 1.35% CSS 25.67% JavaScript 70.78% Makefile 0.01% SCSS 1.16% Blade 1.03%
laravel php admin dashboard

nexus's Introduction

Nexus

Nexus is an Admin Panel based on Laravel Framework

Installation

Requirements

  • Composer
  • Laravel Framework 6.x/7.x/8.x
  • Laravel Mix
  • Node.js & NPM

Installing Nexus

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

Database Credentials

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

Run the installer

Finally, run the install command and migrate Artisan commands.

$ php artisan nexus:install

Admin User

In order to create an user for the admin panel, run the next command:

$ php artisan nexus:user

Admin User Provider

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,
    ],

    // ...
],

Usage

Defining resources

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.

Register Resources

Once the resource are created, we need to add them to the project:

1. Add route

Edit your routes/web.php and the new resource:

Nexus::resource('bookmarks', 'BookmarkController');

or the equivalent:

Nexus::group(function () {
    Route::resource('bookmarks', 'BookmarkController');
});

2. Add to sidebar

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.

Todo

  • 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

Security

If you discover any security related issues, please use the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

nexus's People

Contributors

zrkb avatar dependabot[bot] avatar

Stargazers

radardetektif avatar Resolv Services avatar

Watchers

James Cloos avatar  avatar

Forkers

radardetektif

nexus's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.