亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > PHP > 正文

laravel administrator一款通用的后臺插件(PHP框架擴展)

2020-03-22 18:03:01
字體:
來源:轉載
供稿:網友
  • 前幾天我看了一下zend framework 2的一些官方文檔,也找了一些例子,可惜所有的資料少之甚少。于是我就開始去找這國外用的比較流行的html' target='_blank'>PHP框架laravel,希望能夠找到其合適的例子,而且我本就打算寫一套后臺管理系統,卻正好發現了其擴展的包。Laravel-Administrator后臺擴展包,提供了基本上通用的界面以及數據操作的例子,我們再也不需要自己去找模板了,特別在這個html5開始盛行的時候,一步步苦苦摸索實在太費時費力。做過后臺的朋友不妨看看,這可以使你的工作更快快速和方便。

    1、安裝composer

    自從vim有統一的插件管理工具pathogen后,估摸著PHP的愛好者才想出了這么一個主意,統一的(依賴)管理器,開源插件進行統一管理也的確勢在必行,不說廢話了,首先看看怎么安裝這個東西吧。

    curl -s http://getcomposer.org/installer| php && mv composer.phar /usr/sbin/composer
    2、創建你的laravel項目

    一條命令就幫你搭建好了基本的架構,是不是很方便呢?

    composer create-project laravel/laravel your-project-name #記得改成你的項目名稱
    3、安裝Laravel-Administrator包
    cd your-project-name && vim composer.json #進入項目目錄并編輯composer.json,把"frozennode/administrator": "dev-master"加入到"require"下

    以下為最終的配置:

    {    "name": "laravel/laravel",    "description": "The Laravel Framework.",    "keywords": ["framework", "laravel"],    "license": "MIT",    "require": {        "laravel/framework": "4.2.*",        "frozennode/administrator": "dev-master"    },    "autoload": {        "classmap": [            "app/commands",            "app/controllers",            "app/models",            "app/database/migrations",            "app/database/seeds",            "app/tests/TestCase.php"        ]    },    "scripts": {        "post-install-cmd": [            "php artisan clear-compiled",            "php artisan optimize"        ],        "post-update-cmd": [            "php artisan clear-compiled",            "php artisan optimize"        ],        "post-create-project-cmd": [            "php artisan key:generate"        ]    },    "config": {        "preferred-install": "dist"    },    "minimum-stability": "stable"}
    4、配置包加載
    vim app/config/app.php #找到數組providers,并在最后加入'Frozennode/Administrator/AdministratorServiceProvider',

    以下為最終的配置:

    <?phpreturn array(    /*    |--------------------------------------------------------------------------    | Application Debug Mode    |--------------------------------------------------------------------------    |    | When your application is in debug mode, detailed error messages with    | stack traces will be shown on every error that occurs within your    | application. If disabled, a simple generic error page is shown.    |    */    'debug' => true,    /*    |--------------------------------------------------------------------------    | Application URL    |--------------------------------------------------------------------------    |    | This URL is used by the console to properly generate URLs when using    | the Artisan command line tool. You should set this to the root of    | your application so that it is used when running Artisan tasks.    |    */    'url' => 'http://pfadmins.local.com',    /*    |--------------------------------------------------------------------------    | Application Timezone    |--------------------------------------------------------------------------    |    | Here you may specify the default timezone for your application, which    | will be used by the PHP date and date-time functions. We have gone    | ahead and set this to a sensible default for you out of the box.    |    */    'timezone' => 'UTC',    /*    |--------------------------------------------------------------------------    | Application Locale Configuration    |--------------------------------------------------------------------------    |    | The application locale determines the default locale that will be used    | by the translation service provider. You are free to set this value    | to any of the locales which will be supported by the application.    |    */    'locale' => 'en',    /*    |--------------------------------------------------------------------------    | Application Fallback Locale    |--------------------------------------------------------------------------    |    | The fallback locale determines the locale to use when the current one    | is not available. You may change the value to correspond to any of    | the language folders that are provided through your application.    |    */    'fallback_locale' => 'en',    /*    |--------------------------------------------------------------------------    | Encryption Key    |--------------------------------------------------------------------------    |    | This key is used by the Illuminate encrypter service and should be set    | to a random, 32 character string, otherwise these encrypted strings    | will not be safe. Please do this before deploying an application!    |    */    'key' => '4g1RkrnrYg1UdkEHxUV3p8UBAlnTmWiZ',    'cipher' => MCRYPT_RIJNDAEL_128,    /*    |--------------------------------------------------------------------------    | Autoloaded Service Providers    |--------------------------------------------------------------------------    |    | The service providers listed here will be automatically loaded on the    | request to your application. Feel free to add your own services to    | this array to grant expanded functionality to your applications.    |    */    'providers' => array(        'Illuminate/Foundation/Providers/ArtisanServiceProvider',        'Illuminate/Auth/AuthServiceProvider',        'Illuminate/Cache/CacheServiceProvider',        'Illuminate/Session/CommandsServiceProvider',        'Illuminate/Foundation/Providers/ConsoleSupportServiceProvider',        'Illuminate/Routing/ControllerServiceProvider',        'Illuminate/Cookie/CookieServiceProvider',        'Illuminate/Database/DatabaseServiceProvider',        'Illuminate/Encryption/EncryptionServiceProvider',        'Illuminate/Filesystem/FilesystemServiceProvider',        'Illuminate/Hashing/HashServiceProvider',        'Illuminate/Html/HtmlServiceProvider',        'Illuminate/Log/LogServiceProvider',        'Illuminate/Mail/MailServiceProvider',        'Illuminate/Database/MigrationServiceProvider',        'Illuminate/Pagination/PaginationServiceProvider',        'Illuminate/Queue/QueueServiceProvider',        'Illuminate/Redis/RedisServiceProvider',        'Illuminate/Remote/RemoteServiceProvider',        'Illuminate/Auth/Reminders/ReminderServiceProvider',        'Illuminate/Database/SeedServiceProvider',        'Illuminate/Session/SessionServiceProvider',        'Illuminate/Translation/TranslationServiceProvider',        'Illuminate/Validation/ValidationServiceProvider',        'Illuminate/View/ViewServiceProvider',        'Illuminate/Workbench/WorkbenchServiceProvider',        'Frozennode/Administrator/AdministratorServiceProvider',    ),    /*    |--------------------------------------------------------------------------    | Service Provider Manifest    |--------------------------------------------------------------------------    |    | The service provider manifest is used by Laravel to lazy load service    | providers which are not needed for each request, as well to keep a    | list of all of the services. Here, you may set its storage spot.    |    */    'manifest' => storage_path().'/meta',    /*    |--------------------------------------------------------------------------    | Class Aliases    |--------------------------------------------------------------------------    |    | This array of class aliases will be registered when this application    | is started. However, feel free to register as many as you wish as    | the aliases are "lazy" loaded so they don't hinder performance.    |    */    'aliases' => array(        'App'             => 'Illuminate/Support/Facades/App',        'Artisan'         => 'Illuminate/Support/Facades/Artisan',        'Auth'            => 'Illuminate/Support/Facades/Auth',        'Blade'           => 'Illuminate/Support/Facades/Blade',        'Cache'           => 'Illuminate/Support/Facades/Cache',        'ClassLoader'     => 'Illuminate/Support/ClassLoader',        'Config'          => 'Illuminate/Support/Facades/Config',        'Controller'      => 'Illuminate/Routing/Controller',        'Cookie'          => 'Illuminate/Support/Facades/Cookie',        'Crypt'           => 'Illuminate/Support/Facades/Crypt',        'DB'              => 'Illuminate/Support/Facades/DB',        'Eloquent'        => 'Illuminate/Database/Eloquent/Model',        'Event'           => 'Illuminate/Support/Facades/Event',        'File'            => 'Illuminate/Support/Facades/File',        'Form'            => 'Illuminate/Support/Facades/Form',        'Hash'            => 'Illuminate/Support/Facades/Hash',        'HTML'            => 'Illuminate/Support/Facades/HTML',        'Input'           => 'Illuminate/Support/Facades/Input',        'Lang'            => 'Illuminate/Support/Facades/Lang',        'Log'             => 'Illuminate/Support/Facades/Log',        'Mail'            => 'Illuminate/Support/Facades/Mail',        'Paginator'       => 'Illuminate/Support/Facades/Paginator',        'Password'        => 'Illuminate/Support/Facades/Password',        'Queue'           => 'Illuminate/Support/Facades/Queue',        'Redirect'        => 'Illuminate/Support/Facades/Redirect',        'Redis'           => 'Illuminate/Support/Facades/Redis',        'Request'         => 'Illuminate/Support/Facades/Request',        'Response'        => 'Illuminate/Support/Facades/Response',        'Route'           => 'Illuminate/Support/Facades/Route',        'Schema'          => 'Illuminate/Support/Facades/Schema',        'Seeder'          => 'Illuminate/Database/Seeder',        'Session'         => 'Illuminate/Support/Facades/Session',        'SoftDeletingTrait' => 'Illuminate/Database/Eloquent/SoftDeletingTrait',        'SSH'             => 'Illuminate/Support/Facades/SSH',        'Str'             => 'Illuminate/Support/Str',        'URL'             => 'Illuminate/Support/Facades/URL',        'Validator'       => 'Illuminate/Support/Facades/Validator',        'View'            => 'Illuminate/Support/Facades/View',    ),);
    5、生成Laravel-Administrator配置
      php artisan config:publish frozennode/administrator #生成配置  vim app/config/packages/frozennode/administrator/administrator.php #你可以編輯此文件配置后臺參數
    6、配置Laravel-Administrator例子

    如果沒有示例我們也不知道如何開始,那么就讓我們看看這個插件包所給出的例子吧。

      cd ../ #退到工作目錄  git clone http://github.com/FrozenNode/Laravel-Administrator #下載插件  cp Laravel-Administrator/examples/app/config/packages/frozennode/administrator/administrator.php your-project-name/app/config/packages/frozennode/administrator/  cp Laravel-Administrator/examples/app/config/administrator your-project-name/app/config/ -r  cp Laravel-Administrator/examples/app/models your-project-name/app/ -r  cp Laravel-Administrator/examples/app/database/migrations/* your-project-name/app/database/migrations/  mkdir -p your-project-name/public/packages/frozennode/administrator  cp Laravel-Administrator/public/* your-project-name/public/packages/frozennode/administrator/ -r
      #創建數據庫  #首先根據你數據庫的配置創建出你需要的數據,這里以mysql為例  cd your-project-name # 進入你的項目目錄  vim app/config/database.php

    以下為我的配置:

    <?phpreturn array(    /*    |--------------------------------------------------------------------------    | PDO Fetch Style    |--------------------------------------------------------------------------    |    | By default, database results will be returned as instances of the PHP    | stdClass object; however, you may desire to retrieve records in an    | array format for simplicity. Here you can tweak the fetch style.    |    */    'fetch' => PDO::FETCH_CLASS,    /*    |--------------------------------------------------------------------------    | Default Database Connection Name    |--------------------------------------------------------------------------    |    | Here you may specify which of the database connections below you wish    | to use as your default connection for all database work. Of course    | you may use many connections at once using the Database library.    |    */    'default' => 'mysql',    /*    |--------------------------------------------------------------------------    | Database Connections    |--------------------------------------------------------------------------    |    | Here are each of the database connections setup for your application.    | Of course, examples of configuring each database platform that is    | supported by Laravel is shown below to make development simple.    |    |    | All database work in Laravel is done through the PHP PDO facilities    | so make sure you have the driver for your particular database of    | choice installed on your machine before you begin development.    |    */    'connections' => array(        'sqlite' => array(            'driver'   => 'sqlite',            'database' => __DIR__.'/../database/production.sqlite',            'prefix'   => '',        ),        'mysql' => array(            'driver'    => 'mysql',            'host'      => 'localhost',            'database'  => 'pf_admindb',            'username'  => 'root',            'password'  => 'mysql',            'charset'   => 'utf8',            'collation' => 'utf8_unicode_ci',            'prefix'    => '',        ),        'pgsql' => array(            'driver'   => 'pgsql',            'host'     => 'localhost',            'database' => 'forge',            'username' => 'forge',            'password' => '',            'charset'  => 'utf8',            'prefix'   => '',            'schema'   => 'public',        ),        'sqlsrv' => array(            'driver'   => 'sqlsrv',            'host'     => 'localhost',            'database' => 'database',            'username' => 'root',            'password' => '',            'prefix'   => '',        ),    ),    /*    |--------------------------------------------------------------------------    | Migration Repository Table    |--------------------------------------------------------------------------    |    | This table keeps track of all the migrations that have already run for    | your application. Using this information, we can determine which of    | the migrations on disk haven't actually been run in the database.    |    */    'migrations' => 'migrations',    /*    |--------------------------------------------------------------------------    | Redis Databases    |--------------------------------------------------------------------------    |    | Redis is an open source, fast, and advanced key-value store that also    | provides a richer set of commands than a typical key-value systems    | such as APC or Memcached. Laravel makes it easy to dig right in.    |    */    'redis' => array(        'cluster' => false,        'default' => array(            'host'     => '127.0.0.1',            'port'     => 6379,            'database' => 0,        ),    ),);

    保證數據庫用戶、密碼、IP、端口正確的情況下,還需保證你的數據庫存在后再執行以下命令。

      php artisan migrate:install && php artisan migrate # 創建數據庫及表  #以下是創建生成數據庫表的一些命令,了解即可  #php artisan migrate:make create_directors_table  #php artisan migrate:make create_films_table  #php artisan migrate:make create_box_office  #php artisan migrate:make create_actors  #php artisan migrate:make create_actors_films  #php artisan migrate:make create_theaters  #php artisan migrate:make create_films_theaters
    7、配置你的網站

    上次說到配置zend framework 2的時候,特別講到這個配置,而laravel配置是一模一樣的。

      server {    listen 80;    server_name zf2.local.com; #域名    root /data/www/zf2/public; #你的網站目錄,即項目目錄記得加上public,否則訪問方法不同    index index.php;    #charset utf-8;    location ~* /.(js|ico|gif|jpg|png|css|jpeg|swf)$ {      access_log off;      expires 2d;    }    location / {      if (!-f $request_filename) {        rewrite ^(.+)$ /index.php?$1& last;      }    }      location ~ /.php$ {      #root /var/www/html/public;      fastcgi_pass 127.0.0.1:9000; #如果你的php-fpm的監聽端口不是這個,請設置      fastcgi_index index.php;      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;      include fastcgi_params;    }    # deny access to .htaccess files, if Apache’s document root    # concurs with nginx’s one    #    location ~ //.ht {      deny all;    }  }
    8、開始瀏覽你的網站

    服務器IP與你的域名綁定,開始瀏覽,我這里的地址為http://pfadmins.local.com/admin。一定要加上admin,因為后臺的url就在admin,當然你可以配置。

    PHP編程

    鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

  • 發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
    亚洲一区二区三区sesese| 九九热这里只有精品6| 欧美日韩精品国产| 国产免费一区视频观看免费| 精品成人乱色一区二区| 不卡av日日日| 亚洲成人av片在线观看| 欧美专区福利在线| 欧美激情在线狂野欧美精品| 一区二区欧美在线| 欧美丝袜美女中出在线| 国产高清视频一区三区| 日本韩国在线不卡| 亚洲综合视频1区| 成人免费自拍视频| 国产精品大陆在线观看| 精品福利樱桃av导航| 欧美制服第一页| 亚洲大胆人体av| 性欧美亚洲xxxx乳在线观看| 国产亚洲欧洲在线| 97视频色精品| 麻豆国产精品va在线观看不卡| 91国产在线精品| 亚洲国产欧美一区| 一本色道久久综合狠狠躁篇怎么玩| 国产一区二区av| 一区二区中文字幕| 91九色视频导航| 91久久国产精品| 国产精品入口福利| 国产精品美女久久久久久免费| 久久精品国产精品亚洲| 欧美日韩国产一区二区| 成人激情在线播放| 在线视频欧美性高潮| 亚洲三级黄色在线观看| 国产精品看片资源| 国产欧美日韩最新| 久久免费成人精品视频| 欧洲日韩成人av| 亚洲奶大毛多的老太婆| 欧美不卡视频一区发布| 亚洲专区国产精品| 欧美激情欧美激情| 国内久久久精品| 国产精品久久久久久亚洲调教| 精品亚洲va在线va天堂资源站| 成人h猎奇视频网站| 日本最新高清不卡中文字幕| 欧美久久精品一级黑人c片| 亚洲精品网站在线播放gif| 富二代精品短视频| 一区二区成人精品| 欧美日韩一区二区三区在线免费观看| 少妇久久久久久| 国产精品日本精品| 26uuu亚洲伊人春色| 欧美在线观看网址综合| 国产日韩在线视频| 91久久久国产精品| 欧美日韩一区免费| 国产高清视频一区三区| 久久乐国产精品| 久久精品亚洲94久久精品| 5252色成人免费视频| 日韩中文在线观看| 国产成人精品日本亚洲专区61| 成人淫片在线看| 夜夜嗨av一区二区三区四区| 亚洲第一精品久久忘忧草社区| 91精品久久久久久久久久另类| 日韩欧美a级成人黄色| 91成人在线观看国产| 久久亚洲精品中文字幕冲田杏梨| 亚洲自拍偷拍色片视频| 日本久久久久久久久| 亚洲精品动漫100p| 第一福利永久视频精品| 精品福利免费观看| 川上优av一区二区线观看| 在线看欧美日韩| 高清日韩电视剧大全免费播放在线观看| 日韩欧美中文第一页| 综合av色偷偷网| 欧美亚洲日本网站| 91精品综合久久久久久五月天| 日韩在线视频观看正片免费网站| 国产欧亚日韩视频| 91九色视频导航| 日韩电影中文字幕| 精品久久久一区二区| 51色欧美片视频在线观看| 日韩a**中文字幕| 日韩精品亚洲精品| 国产精品手机播放| 国产91精品青草社区| 亚洲高清一区二| 亚洲精选中文字幕| 亚洲新中文字幕| 国产精品美女av| 亚洲一区二区三区香蕉| 狠狠久久亚洲欧美专区| 国产精品电影网站| 亚洲自拍欧美色图| 黑人与娇小精品av专区| 国产欧美一区二区白浆黑人| 欧美精品在线免费播放| 精品国产网站地址| 理论片在线不卡免费观看| 亚洲大胆人体av| 久久久久久久一区二区| 色偷偷噜噜噜亚洲男人的天堂| 久久久久亚洲精品成人网小说| 久久综合九色九九| 亚洲一区av在线播放| 亚洲一区二区中文字幕| 97婷婷涩涩精品一区| 成人免费淫片aa视频免费| 另类少妇人与禽zozz0性伦| 欧美亚洲一区在线| 中文字幕不卡av| 亚洲激情在线观看视频免费| 亚州国产精品久久久| 亚洲a级在线播放观看| 中文字幕亚洲二区| 国产丝袜视频一区| 久久国产天堂福利天堂| 欧美激情视频一区二区| 青青在线视频一区二区三区| 亚洲国产第一页| 欧美激情视频在线免费观看 欧美视频免费一| 中国人与牲禽动交精品| 精品中文字幕视频| 中文字幕欧美日韩va免费视频| 国产精品h片在线播放| 国产精品揄拍500视频| 亚洲欧美中文日韩在线v日本| 国产一区二区三区在线观看视频| 97视频免费看| 日韩在线播放视频| 亚洲乱码国产乱码精品精天堂| 亚洲成人激情在线观看| 最新国产成人av网站网址麻豆| 国产精品久久久久久久久久99| 国产日产久久高清欧美一区| 国产精品久久久久久久久久东京| 久久国产精品电影| 日韩欧美在线中文字幕| 成人午夜高潮视频| 日韩精品在线影院| 91在线观看免费观看| 一区二区三区回区在观看免费视频| 国产女同一区二区| 日韩免费av一区二区| 亚洲日本成人女熟在线观看| 91在线无精精品一区二区| 亚洲国产高清自拍| 日韩a**中文字幕| 91国内精品久久| 中文字幕最新精品| 伊人伊成久久人综合网小说| 欧美最猛黑人xxxx黑人猛叫黄| 97超级碰碰碰久久久|