Giter Site home page Giter Site logo

rahi-cube / laravel-admin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from z-song/laravel-admin

1.0 2.0 0.0 7.96 MB

Build a full-featured administrative interface in ten minutes

Home Page: http://120.26.143.106/admin

License: MIT License

CSS 25.12% JavaScript 7.31% PHP 57.57% HTML 9.99%

laravel-admin's Introduction

laravel-admin

Build Status StyleCI Scrutinizer Code Quality Packagist Total Downloads

laravel-admin is administrative interface builder for laravel which can help you build CRUD backends just with few lines of code.

Demo use username/password:admin/admin

Inspired by SleepingOwlAdmin and rapyd-laravel.

中文文档

Screenshots

laravel-admin

Installation

First, install laravel, and make sure that the database connection settings are correct.

Laravel 5.1
composer require encore/laravel-admin "1.1.*"

Laravel 5.2
composer require encore/laravel-admin "1.2.*"

Laravel 5.3
composer require encore/laravel-admin "1.3.*"

Inconfig/app.phpaddServiceProvider:

Encore\Admin\Providers\AdminServiceProvider::class

Then run these commands to publish assets and config:

php artisan vendor:publish --tag=laravel-admin

After run command you can find config file in config/admin.php, in this file you can change the install directory,db connection or table names.

At last run following command to finish install.

php artisan admin:install

Open http://localhost/admin/ in browser,use username admin and password admin to login.

Default Settings

The file in config/admin.php contains an array of settings, you can find the default settings in there.

Documentation

Directory structure

After install,you can find directoryapp/Admin,and then most of our develop work is under this directory.


app/Admin
├── Controllers
│   ├── ExampleController.php
│   └── HomeController.php
├── bootstrap.php
└── routes.php

app/Admin/routes.php is used to define routes,for more detail please read routes.

app/Admin/bootstrap.php is bootstrapper for laravel-admin, more usages see comments inside it.

The app/Admin/Controllers directory is used to store all the controllers, The HomeController.php file under this directory is used to handle home request of admin,The ExampleController.php file is a controller example.

Quick start

We use users table come with Laravel for example,the structure of table is:

CREATE TABLE `users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
  `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

And the model for this table is App\User.php

You can follow these steps to setup CURD interfaces of table users:

1.add controller

Use the following command to create a controller for App\User model

php artisan admin:make UserController --model=App\\User

// under windows use:
php artisan admin:make UserController --model=App\User

The above command will create the controller in app/Admin/Controllers/UserController.php.

2.add route

Add a route in app/Admin/routes.php

$router->resource('users', UserController::class);

3.add left menu item

Open http://localhost:8000/admin/auth/menu, add menu link and refresh the page, then you can find a link item in left menu bar.

4.build grid and form

The rest needs to be done is open app/Admin/Contollers/UserController.php, find form() and grid() method and write few lines of code with model-grid and model-form,for more detail, please read model-grid and model-form.

Other

laravel-admin based on following plugins or services:

License

laravel-admin is licensed under The MIT License (MIT).

laravel-admin's People

Contributors

z-song avatar axyr avatar scrutinizer-auto-fixer avatar chenlixin93 avatar elinxer avatar xqbumu avatar

Stargazers

Nam Nguyen avatar

Watchers

James Cloos avatar Rahul G. avatar

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.