β

Voyager – Can an Admin UI Make Laravel Even More A

SitePoint » PHP 59 阅读

Today, we are talking about Voyager !

Voyager logo

Voyager is a Laravel package that provides a full administration system for the framework in its "skeleton app" form. Voyager has 4 main features:

Let's take a closer look at it.

Installing Voyager

First, let's start with a fresh Laravel installation. Of course, we can start with an existing project, but for the purpose of this article we will start with a fresh one.

While it's outside the scope of this article, the recommended way to start a new Laravel project is by using Composer :

composer create-project laravel/laravel voyager

This will create a new Laravel project called voyager inside the /voyager folder. To serve this new Laravel project, using PHP's built in server:

php artisan serve

On Homestead Improved , the serving is taken care of for you with Nginx.

With a fresh Laravel installation up and running, we can now focus on installing the Voyager Admin package.

composer require tcg/voyager

As we can see during the installation process, Voyager is pulling components from some very well known PHP packages like Doctrine ORM for the database manager, or Guzzle and Intervention Image for PHP image handling and manipulation. This shows us that Voyager is built on top of reliable and proven components.

Next, let's fire up our favorite code editor. We will need to edit some files in order to have Voyager up and running.

First, we open the .env file and add our database credentials so that Voyager can connect to it.

DB_HOST=localhost
DB_DATABASE=database
DB_USERNAME=username
DB_PASSWORD=password

After that, let's add the Voyager and Image Intervention service providers to our providers array. This array can be found in the config/app.php file, and all we need to do is append the following elements to it:

TCG\Voyager\VoyagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,

To finish the installation:

php artisan voyager:install

We should now see the "Successfully installed Voyager! Enjoy :)" message.

Continue reading % Voyager – Can an Admin UI Make Laravel Even More Approachable? %

作者:SitePoint » PHP
Learn CSS | HTML5 | JavaScript | Wordpress | Tutorials-Web Development | Reference | Books and More
原文地址:Voyager – Can an Admin UI Make Laravel Even More A, 感谢原作者分享。

发表评论