Skip to content

Commit

Permalink
Merge pull request #2971 from Wixty/docs-fix
Browse files Browse the repository at this point in the history
Docs formatting
  • Loading branch information
z-song committed Jan 26, 2019
2 parents 2db4701 + dd88ca8 commit 5de64a5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 36 deletions.
12 changes: 6 additions & 6 deletions docs/en/custom-authentication.md
@@ -1,6 +1,6 @@
# Custom authentication

If you do not use the `laravel-admin` built-in authentication login logic, you can refer to the following way to customize the login authentication logic
If you do not use the `laravel-admin` built-in authentication login logic, you can refer to the following way to customize the login authentication logic.

First of all, you need define a `User provider`, used to obtain the user identity, such as `app/Providers/CustomUserProvider.php`:

Expand Down Expand Up @@ -36,9 +36,9 @@ class CustomUserProvider implements UserProvider

```

In the methods `retrieveByCredentials` and `validateCredentials`, the parameter `$credentials` is the user name and password array submitted in the login page, you can use `$credentials` to implement your own login logic
In the methods `retrieveByCredentials` and `validateCredentials` the parameter `$credentials` is the user name and password array submitted on the login page, you can use `$credentials` to implement your own login logic.

The definition of interface `Illuminate\Contracts\Auth\Authenticatable`
The definition of interface `Illuminate\Contracts\Auth\Authenticatable`:
```php
<?php

Expand All @@ -56,7 +56,7 @@ interface Authenticatable {
}
```

More details about custom authentication please refer to[adding-custom-user-providers](https://laravel.com/docs/5.5/authentication#adding-custom-user-providers)
For more details about custom authentication please refer to [adding-custom-user-providers](https://laravel.com/docs/5.5/authentication#adding-custom-user-providers).


After you created cusom user provider, you will need to extend Laravel with it:
Expand Down Expand Up @@ -89,7 +89,7 @@ class AuthServiceProvider extends ServiceProvider
}
```

Finally modify the configuration, open `config/admin.php`find the `auth` part:
Finally modify the configuration, open `config/admin.php`, find the `auth` part:

```php
'auth' => [
Expand All @@ -108,4 +108,4 @@ Finally modify the configuration, open `config/admin.php`,find the `auth` part
],
],
```
This completes the logic of custom authentication
This completes the logic of custom authentication.
8 changes: 4 additions & 4 deletions docs/en/custom-navbar.md
@@ -1,6 +1,6 @@
# Customize the head navigation bar

Since version `1.5.6`, you can add the html element to the top navigation bar, open `app/Admin/bootstrap.php`
Since version `1.5.6`, you can add the html element to the top navigation bar, open `app/Admin/bootstrap.php`:
```php
use Encore\Admin\Facades\Admin;

Expand All @@ -13,11 +13,11 @@ Admin::navbar(function (\Encore\Admin\Widgets\Navbar $navbar) {
});
```

method `left` nad `right`方is used to add the contents of the left and right sides of the head, the method parameters can be any object can be rendered( objects which impletements `Htmlable``Renderable`, or has method `__toString()`) or strings.
Methods `left` and `right` are used to add content to the left and right sides of the head, the method parameters can be any object that can be rendered (objects which impletements `Htmlable`, `Renderable`, or has method `__toString()`) or strings.

## Add elements to the left

For example, add a search bar on the left, first create a view `resources/views/search-bar.blade.php`
For example, add a search bar on the left, first create a view `resources/views/search-bar.blade.php`:
```php
<style>
Expand Down Expand Up @@ -145,4 +145,4 @@ Or use the following html to add a drop-down menu:
</li>
```

More components can be found here [Bootstrap](https://getbootstrap.com/)
More components can be found here [Bootstrap](https://getbootstrap.com/)
23 changes: 13 additions & 10 deletions docs/en/installation.md
Expand Up @@ -4,34 +4,35 @@
First, install laravel, and make sure that the database connection settings are correct.

Then install require this package with command:
```
composer require encore/laravel-admin "1.5.*"
```

Then run these commands to publish assets and config:

Publish assets and config with command:
```
php artisan vendor:publish --provider="Encore\Admin\AdminServiceProvider"
```
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.
After runnung previous command you can find config file in `config/admin.php`, in this file you can change default install directory (```/app/Admin```), 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.
To check that all is working, run `php artisan serve` and open `http://localhost/admin/` in browser, use username `admin` and password `admin` to login.

## Generated files

After the installation is complete, the following files are generated in the project directory:

### Configuration file

After the installation is complete,all configurations are in the `config/admin.php` file.
After the installation is complete, all configurations are in the `config/admin.php` file.

### Admin files

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

```
Expand All @@ -45,10 +46,12 @@ app/Admin

`app/Admin/routes.php` is used to define routes.

`app/Admin/bootstrap.php` is bootstrapper for laravel-admin, more usages see comments inside it.
`app/Admin/bootstrap.php` is bootstrapper for laravel-admin, for usage examples 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.
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.

### Static assets

The front-end static files are in the `/public/packages/admin` directory.
The front-end static files are in the `/public/packages/admin` directory.
32 changes: 16 additions & 16 deletions docs/en/widgets.md
Expand Up @@ -21,19 +21,19 @@ echo $box;

```

The `$content` parameter is the content element of the Box, which can be either an implementation of the `Illuminate\Contracts \ Support\Renderable` interface, or other printable variables.
The `$content` parameter is the content element of the Box, which can be either an implementation of the `Illuminate\Contracts\Support\Renderable` interface, or other printable variables.

The `Box::title($title)` method is used to set the Box component title.
`Box::title($title)` method is used to set the Box component title.

The `Box::content($content)` method is used to set the content element of a Box component.
`Box::content($content)` method is used to set the content element of a Box component.

The `Box::removable()` method sets the Box component as removable.
`Box::removable()` method sets the Box component as removable.

The `Box::collapsable()` method sets the Box component as collapsable.
`Box::collapsable()` method sets the Box component as collapsable.

`Box::style($style)` method sets the style of the Box component to fill in `primary`,` info`, `danger`,` warning`, `success`,` default`.
`Box::style($style)` method sets the style of the Box component to fill in `primary`, `info`, `danger`, `warning`, `success`, `default`.

The `Box::solid()` method adds a border to the Box component.
`Box::solid()` method adds a border to the Box component.

## Collapse

Expand All @@ -50,12 +50,12 @@ echo $collapse->render();

```

The `Collapse::add($title, $content)` method is used to add a collapsed item to the collapsing component. The `$title` parameter sets the title of the item. The`$content` parameter is used to .
`Collapse::add($title, $content)` method is used to add a collapsed item to the collapsing component. The `$title` parameter sets the title of the item. The`$content` parameter is used to .


## Form

`Encore\Admin\Widgets\Form` class is used to quickly build a form
`Encore\Admin\Widgets\Form` class is used to quickly build a form:

```php

Expand All @@ -76,17 +76,17 @@ $form->dateRange('created_at', 'updated_at');
echo $form->render();
```

`Form::__construct($data = [])` generates a form object. If the `$data` parameter is passed, the elements in the` $data` array will be filled into the form.
`Form::__construct($data = [])` generates a form object. If the `$data` parameter is passed, the elements in the `$data` array will be filled into the form.

`Form::action($uri)` method is used to set the form submission address.

`Form::method($method)` method is used to set the submit method of the form form, the default is `POST` method.
`Form::method($method)` method is used to set the submit method of the form, the default is `POST` method.

`Form::disablePjax()` disable pjax for form submit.

## Infobox

The `Encore\Admin\Widgets\InfoBox` class is used to generate the information presentation block:
`Encore\Admin\Widgets\InfoBox` class is used to generate the information presentation block:

```php
use Encore\Admin\Widgets\InfoBox;
Expand All @@ -97,11 +97,11 @@ echo $infoBox->render();

```

Refer to the section on the `InfoBox` in the` index()`method of the home page layout file [HomeController.php](https://github.com/z-song/laravel-admin/blob/master/src/Console/stubs/HomeController.stub).
Refer to the section on the `InfoBox` in the `index()` method of the home page layout file [HomeController.php](https://github.com/z-song/laravel-admin/blob/master/src/Console/stubs/HomeController.stub).

## Tab component

The `Encore\Admin\Widgets\Tab` class is used to generate the tab components:
`Encore\Admin\Widgets\Tab` class is used to generate the tab components:

```php
use Encore\Admin\Widgets\Tab;
Expand All @@ -116,11 +116,11 @@ echo $tab->render();

```

The `Tab::ad ($title, $content)` method is used to add a tab, `$title` for the option title, and the` $content` tab for the content.
`Tab::add($title, $content)` method is used to add new tab, `$title` is tab title, `$content` is tab content.

## Table

`Encore\Admin\Widgets\Table` class is used to generate forms
`Encore\Admin\Widgets\Table` class is used to generate forms:

```php
use Encore\Admin\Widgets\Table;
Expand Down

0 comments on commit 5de64a5

Please sign in to comment.