voyager Laravel 配置和使用

handsomeqin5年前技术728

地址: https://github.com/the-control-group/voyager

Installation Steps

1. Require the Package

After creating your new Laravel application you can include the Voyager package with the following command:

composer require tcg/voyager

2. Add the DB Credentials & APP_URL

Next make sure to create a new database and add your database credentials to your .env file:

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

You will also want to update your website URL inside of the APP_URL variable inside the .env file:

APP_URL=http://localhost:8000

3. Run The Installer

Lastly, we can install voyager. You can do this either with or without dummy data. The dummy data will include 1 admin account (if no users already exists), 1 demo page, 4 demo posts, 2 categories and 7 settings.

To install Voyager without dummy simply run

php artisan voyager:install

If you prefer installing it with dummy run

php artisan voyager:install --with-dummy

And we're all good to go!

Start up a local development server with php artisan serve And, visit http://localhost:8000/admin.

Creating an Admin User

If you did go ahead with the dummy data, a user should have been created for you with the following login credentials:

email: admin@admin.com
password: password

NOTE: Please note that a dummy user is only created if there are no current users in your database.

If you did not go with the dummy user, you may wish to assign admin privileges to an existing user. This can easily be done by running this command:

php artisan voyager:admin your@email.com

If you did not install the dummy data and you wish to create a new admin user you can pass the --create flag, like so:

php artisan voyager:admin your@email.com --create

And you will be prompted for the user's name and password.

阅读剩余的25%

相关文章

在这里插入图片描述
大概在这个位置给www用户权限;添加这句:www ALL=(ALL) ALL;强制保存并退出:wq!
然后切换到www用户的家目录

cd /home/www1

准备工作做完了,现在开始下载nginx源包,使用wget工具下载

wget http://nginx.org/download/nginx-1.6.3.tar.gz1

如果执行这一步的时候出现了,命令不存在之类的错误信息,可能是因为wget工具未安装,需要使用yum工具安装一下wget工具

yum -y install wget1

安装成功后在执行下载命令;
此时www的家目录中会有一个名为nginx-1.6.3.tar.gz的压缩文件
切换到www用户并解压这个文件

su - wwwtar -xvf nginx-1.6.3.tar.gz12

解压之后会有一个名为nginx-1.6.3的目录文件;
我们更改一下nginx-1.6.3及其子文件的属主和属组

chown -R www:www nginx-1.6.31

更改成功之后进入这个文件

cd nginx-1.6.31

执行配置命令

./configure1

接下来编译文件,编译成功后,可以看到一个Makefile文件

make1

一般在这里会出现问题,下面给出问题截图和解决方法
1、
在这里插入图片描述
问题原因:不知道
解决方法:进入到nginx-1.6.3目录下(解压的目录)
找到当前目录下找到objs文件夹,并进入,打开文件Makefile,

vim objs/Makefile1

找到有一下内容的这行:(就在前几行)

CFLAGS =  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g 1

-Werror: gcc将所有的警告当成错误进行处理把这行内容中的 “-Werror”去掉
2、在这里插入图片描述
错误原因:不知道
解决方法:编辑这个文件

vim /home/www/nginx-1.6.3/src/os/unix/ngx_user.c1

把这一行注释掉(35行左右)
Centos8下安装nginx

Centos8下安装nginx

在最近的实训实验中需要在centos8下安装nginx,在安装过程中遇到了很多问题,在此对我的安装过程做一个分享;准备工作Vmware(安装了centos8),虚拟机可以上网开始安装安装依赖包,使用y...

关于php不解析直接下载的问题

碰到xmdtn下的index.php不解析,直接download。修改nginx.conf 不管用。ca,原来要重启nginx和php-fpm:service nginx restartservice...

php中正则表达式对斜杠的处理

斜杠需要加两个反斜杠 \\ 进行转义.$key = "https://file.ipadown.com/tophub/assets/images/media/appinn.com.png&q...

今日热点值得看,上线啦!

热点人人关注,可是在如今信息泛滥的时代,太多嘈杂,太多干扰,太多的精力都放在筛选上了.经常有看着看着,迷失了,我是谁?我在哪里?我在干什么?当当当,今日热点值得看,隆重上线,专为解决以上问题.每日精选...

python flask实现网站微信登录

python flask实现网站微信登录

转载自:原文链接 https://www.cnblogs.com/cacique/p/4293348.html根据需求选择相应的登录方式微信现在提供两种登录接入方式移动应用微信登录网站应用微...

12个学习Python编程小游戏,有趣又好玩

12个学习Python编程小游戏,有趣又好玩

前言学习编程对大多数人来说是枯燥而无聊,大家有时候往往会觉得精神崩溃,提不起学习的兴趣,因此从入门到放弃(笑哭),面临这种困境该怎么办呢?这时候就有一些大牛设计出用游戏来学习编程知识点,所以,这世界上...