adding doc routes.
This commit is contained in:
102
storage/documentation/artisan/commands.md
Normal file
102
storage/documentation/artisan/commands.md
Normal file
@@ -0,0 +1,102 @@
|
||||
# Artisan Commands
|
||||
|
||||
## Contents
|
||||
|
||||
- [Application Configuration](#application-configuration)
|
||||
- [Sessions](#sessions)
|
||||
- [Migrations](#migrations)
|
||||
- [Bundles](#bundles)
|
||||
- [Tasks](#tasks)
|
||||
- [Unit Tests](#unit-tests)
|
||||
- [Routing](#routing)
|
||||
- [Application Keys](#keys)
|
||||
- [CLI Options](#cli-options)
|
||||
|
||||
<a name="application-configuration"></a>
|
||||
## Application Configuration <small>[(More Information)](/docs/install#basic-configuration)</small>
|
||||
|
||||
Description | Command
|
||||
------------- | -------------
|
||||
Generate a secure application key. An application key will not be generated unless the field in **config/application.php** is empty. | `php artisan key:generate`
|
||||
|
||||
<a name="sessions"></a>
|
||||
## Database Sessions <small>[(More Information)](/docs/session/config#database)</small>
|
||||
|
||||
Description | Command
|
||||
------------- | -------------
|
||||
Create a session table | `php artisan session:table`
|
||||
|
||||
<a name="migrations"></a>
|
||||
## Migrations <small>[(More Information)](/docs/database/migrations)</small>
|
||||
|
||||
Description | Command
|
||||
------------- | -------------
|
||||
Create the Laravel migration table | `php artisan migrate:install`
|
||||
Creating a migration | `php artisan migrate:make create_users_table`
|
||||
Creating a migration for a bundle | `php artisan migrate:make bundle::tablename`
|
||||
Running outstanding migrations | `php artisan migrate`
|
||||
Running outstanding migrations in the application | `php artisan migrate application`
|
||||
Running all outstanding migrations in a bundle | `php artisan migrate bundle`
|
||||
Rolling back the last migration operation | `php artisan migrate:rollback`
|
||||
Roll back all migrations that have ever run | `php artisan migrate:reset`
|
||||
|
||||
<a name="bundles"></a>
|
||||
## Bundles <small>[(More Information)](/docs/bundles)</small>
|
||||
|
||||
Description | Command
|
||||
------------- | -------------
|
||||
Install a bundle | `php artisan bundle:install eloquent`
|
||||
Upgrade a bundle | `php artisan bundle:upgrade eloquent`
|
||||
Upgrade all bundles | `php artisan bundle:upgrade`
|
||||
Publish a bundle assets | `php artisan bundle:publish bundle_name`
|
||||
Publish all bundles assets | `php artisan bundle:publish`
|
||||
|
||||
<br>
|
||||
> **Note:** After installing you need to [register the bundle](../bundles/#registering-bundles)
|
||||
|
||||
<a name="tasks"></a>
|
||||
## Tasks <small>[(More Information)](/docs/artisan/tasks)</small>
|
||||
|
||||
Description | Command
|
||||
------------- | -------------
|
||||
Calling a task | `php artisan notify`
|
||||
Calling a task and passing arguments | `php artisan notify taylor`
|
||||
Calling a specific method on a task | `php artisan notify:urgent`
|
||||
Running a task on a bundle | `php artisan admin::generate`
|
||||
Running a specific method on a bundle | `php artisan admin::generate:list`
|
||||
|
||||
<a name="unit-tests"></a>
|
||||
## Unit Tests <small>[(More Information)](/docs/testing)</small>
|
||||
|
||||
Description | Command
|
||||
------------- | -------------
|
||||
Running the application tests | `php artisan test`
|
||||
Running the bundle tests | `php artisan test bundle-name`
|
||||
|
||||
<a name="routing"></a>
|
||||
## Routing <small>[(More Information)](/docs/routing)</small>
|
||||
|
||||
Description | Command
|
||||
------------- | -------------
|
||||
Calling a route | `php artisan route:call get api/user/1`
|
||||
|
||||
<br>
|
||||
> **Note:** You can replace get with post, put, delete, etc.
|
||||
|
||||
<a name="keys"></a>
|
||||
## Application Keys
|
||||
|
||||
Description | Command
|
||||
------------- | -------------
|
||||
Generate an application key | `php artisan key:generate`
|
||||
|
||||
<br>
|
||||
> **Note:** You can specify an alternate key length by adding an extra argument to the command.
|
||||
|
||||
<a name="cli-options"></a>
|
||||
## CLI Options
|
||||
|
||||
Description | Command
|
||||
------------- | -------------
|
||||
Setting the Laravel environment | `php artisan foo --env=local`
|
||||
Setting the default database connection | `php artisan foo --database=sqlitename`
|
||||
100
storage/documentation/artisan/tasks.md
Normal file
100
storage/documentation/artisan/tasks.md
Normal file
@@ -0,0 +1,100 @@
|
||||
# Tasks
|
||||
|
||||
## Contents
|
||||
|
||||
- [The Basics](#the-basics)
|
||||
- [Creating & Running Tasks](#creating-tasks)
|
||||
- [Bundle Tasks](#bundle-tasks)
|
||||
- [CLI Options](#cli-options)
|
||||
|
||||
<a name="the-basics"></a>
|
||||
## The Basics
|
||||
|
||||
Laravel's command-line tool is called Artisan. Artisan can be used to run "tasks" such as migrations, cronjobs, unit-tests, or anything that want.
|
||||
|
||||
<a name="creating-tasks"></a>
|
||||
## Creating & Running Tasks
|
||||
|
||||
To create a task create a new class in your **application/tasks** directory. The class name should be suffixed with "_Task", and should at least have a "run" method, like this:
|
||||
|
||||
#### Creating a task class:
|
||||
|
||||
class Notify_Task {
|
||||
|
||||
public function run($arguments)
|
||||
{
|
||||
// Do awesome notifying...
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Now you can call the "run" method of your task via the command-line. You can even pass arguments:
|
||||
|
||||
#### Calling a task from the command line:
|
||||
|
||||
php artisan notify
|
||||
|
||||
#### Calling a task and passing arguments:
|
||||
|
||||
php artisan notify taylor
|
||||
|
||||
Remember, you can call specific methods on your task, so, let's add an "urgent" method to the notify task:
|
||||
|
||||
#### Adding a method to the task:
|
||||
|
||||
class Notify_Task {
|
||||
|
||||
public function run($arguments)
|
||||
{
|
||||
// Do awesome notifying...
|
||||
}
|
||||
|
||||
public function urgent($arguments)
|
||||
{
|
||||
// This is urgent!
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Now we can call our "urgent" method:
|
||||
|
||||
#### Calling a specific method on a task:
|
||||
|
||||
php artisan notify:urgent
|
||||
|
||||
<a name="bundle-tasks"></a>
|
||||
## Bundle Tasks
|
||||
|
||||
To create a task for your bundle just prefix the bundle name to the class name of your task. So, if your bundle was named "admin", a task might look like this:
|
||||
|
||||
#### Creating a task class that belongs to a bundle:
|
||||
|
||||
class Admin_Generate_Task {
|
||||
|
||||
public function run($arguments)
|
||||
{
|
||||
// Generate the admin!
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
To run your task just use the usual Laravel double-colon syntax to indicate the bundle:
|
||||
|
||||
#### Running a task belonging to a bundle:
|
||||
|
||||
php artisan admin::generate
|
||||
|
||||
#### Running a specific method on a task belonging to a bundle:
|
||||
|
||||
php artisan admin::generate:list
|
||||
|
||||
<a name="cli-options"></a>
|
||||
## CLI Options
|
||||
|
||||
#### Setting the Laravel environment:
|
||||
|
||||
php artisan foo --env=local
|
||||
|
||||
#### Setting the default database connection:
|
||||
|
||||
php artisan foo --database=sqlite
|
||||
Reference in New Issue
Block a user