Skip to content

Commit

Permalink
從官方那邊抓了新版homestead.md翻譯 (#337)
Browse files Browse the repository at this point in the history
* Correct the note regarding assertJson

* Add view() usage information to notifications

* Add note about assertJsonStructure()

* adjust wordin

* remove second param

* Fix typo in Filesystem doc

* update wording

* Document Passport::actingAs()

*          document the changes in model create and forceCreate

* update wording

*        add notes about bind and instance

* update wording

* add note on optional fields

* remove word

* add note on normaliation

* add note about autoloading

*    document assertJsonFragment

*    minor edit

* Update Mix documentation about `version`

* spelling

* Example for redirectTo() Method

Add simple return example, to clarify redirectTo() method, if used, should return a path string.

* document intersect method

* Added changes to Event Fake changes

added changes for `assertNotFired` to `assertNotDispatched`

* Document Route::resourceVerbs() method

* Update upgrade.md

* fix wording

* wording

*    use BrowserKitTestCase

* fix: remove comma

* Better wording for Cashier warning

* update docs

* Remove compiled.php to upgrade guide

laravel/framework#17003 (comment)

* Update upgrade.md

* Fix method name in dusk.md

Method is called `elements`

* Change PHPUnit to 5.7

composer.json has been updated a week ago;
laravel/laravel@926f53b

* give more clarity

* Correct reference to resources directory name

When describing the resource_path() helper, there was an incorrect mention of the storage directory. Likely due to copy & paste.

* Update http-tests.md

Tests are now using namespaces. We need to access global scope for User::class

* import class

* 📝 add documentation for collection when method

Documentation for the collection `when` method introduced in
laravel/framework#17917.

* update wording

* added to docs

* use correct name of method

* Adding brackets.

* Changing heading

* Removing references to the .homestead directory.

This commit (laravel/homestead@06b52c7) removes the `.homestead` directory, placing the `Homestead.yaml` file in the Homestead directory instead.

* Add missing config entry.

* Update notifications.md

* work on docs

* add notes for random dropdown selection

related to this Dusk PR

laravel/dusk#140

* Update dusk.md

* Updated dusk.md

Add docs for radio selection assertions
re: laravel/dusk#138

* Added note about indentation level on markdown emails

* adjust wording

* Removes PM2 from homestead docs

Not included in vagrant box

* Extend Mix docs

* fix formatting and wording

* fix mistake in stylus

* Fix typo in Homestead doc

* ✨ 📚 Add JSON Config info, share() docs, notes about using stable versions

* Replace htmlentities with htmlspecialchars

* fix various errors and problems

* Use path to sass instead of less

* use uri() instead of getPath() for Route

* Replace "login" with "log in"

* Add note about the removal of the ConfigureLogging

As per this commit the ConfigureLogging bootstrapper is no more in 5.4 with the Monolog setup being moved to a base service provider in Illuminate\Foundation\Application laravel/framework@919f21b#diff-67364880bdf444edbf5e384f3686b9b9

* update dusk.md

Added queryString assertions to list of available assertions.

* Update homestead.md

* added docs for testing file uploads

* More clarification of the example commands used.

* Document Collection::whereNotIn()

* Update mix.md

>Behind the scenes, Mix will download and include the appropriate `babel-preset-react` Babel plug-in.

It used to say:

>Behind the scenes, React will download and include the appropriate `babel-preset-react` Babel plug-in.

* Update collections.md

* fix wording

* Change dot to semicolon

* Update mix.md

Add missing word.

* Update structure

Add `channels,php` to `routes` directory.

* Update structure.md

* Add new drag methods to documentation

* fix formatting

* Terminable route middleware clarification

There was some confusion with some developers because the documentation seemed to say that terminable middleware has to be defined in your *global* middleware list, but in fact terminable middleware can be used as *route* middleware as well.

* Update middleware.md

* e function sets double_encode to false

This behaviour is not intuitive as the parameter is set to true per default in htmlspecialchars.

* Fixed typo error.

* Added kebab_case() to the string helpers

Was this method not documented so it will not break the 6 methods per column on 3 columns?

* Added kebab_case() to the string helpers

Was this method not documented so it will not break the 6 methods per column on 3 columns?

* Update helpers.md

* Mention the array_wrap helper

* tweak wording

* changes for custom pivot table model

The pivot model must extend the the relations/pivot class

* Adding semicolon.

* Fixed typo

* Update authorization.md

Include namespace in 'Actions that don't require models' in the Blade section

* Added description for getMessage() in Error pages

$exception variable has methods for displaying the message passed by the abort function, which can be useful in Custom HTTP Error Pages. The proposed changes mention this method with an example for blade template under - "Custom HTTP Error Pages" section.

* Update queries.md

MariaDB already support JSON functions. refer [here](https://mariadb.com/kb/en/mariadb/json-functions/)

* Update queries.md

* Update errors.md

* Update errors.md

* Document Eloquent\Builder::withCount() aliasing support

Documents the feature added by laravel/framework#15279

* tweak formatting

* update example

* document csrf

* clear up wording

* Fixes syntax error

minor syntax error in docs

* Adding getForeignKey rename to upgrade guide

* move docs

* document customization

* Update views.md

* Corrected wrong example code (in sync with master)

The master branch has updated the docs, making the same changes in 5.4

https://github.com/laravel/docs/blob/master/eloquent-relationships.md#many-to-many

* Fix React anchor link. Updated to #react to match section heading

* Update v5.4 Upgrade Guide

Currently the Upgrade guide references a change in the API to
relations where the name of the `getForeignKey` method has changed
to `getForeignKeyName`  In reviewing the code and API docs this
doesn't seem to actually be true.

Example (https://laravel.com/api/5.4/Illuminate/Database/Eloquent/Relations/BelongsTo.html)

This commit removes the seemingly false reference.

* Document Collection::isNotEmpty() method

Documents the feature added by laravel/framework#16797

* Document Collection::containsStrict() method

Documents the feature added by laravel/framework#14657

Also updates the Collection::contains() documentation to outline its behavior and where they differ.

* Document Collection::median() and Collection::mode() methods

Documents the features added by laravel/framework#14305

I also changed the Collection::avg() documentation with the same code snippet to better demonstrate where they differ since they all are related. Since they can be confusing to understand, I also added reference links to Wikipedia to each one.

* [5.4] Document Collection::uniqueStrict() method

Documents the feature added by laravel/framework#14661

Also updates the Collection::unique() documentation to outline its behavior and where they differ.

* [5.4] Document Collection::tap() method

Documents the feature added by laravel/framework#17756

* [5.4] Sync Eloquent\Collection available methods

* Fix reference to getMessage in exception

* Improvements to collections documentation

* Correct example for sending markdown slack attachements

* Update use statement

https://github.com/laravel/laravel/blob/master/app/Providers/AuthServiceProvider.php#L6

* Update scheduling.md file

I feel like the '/path/to/artisan' is a bit confusing a better use of words would be 'path-to-your-project'.

I also found out there are some more people thinking like me:
https://laracasts.com/discuss/channels/laravel/pathtoartisan-where-it-is?page=1

* add notes on laravel version scheme

* Clarifies tests namespace change

Makes clear the composer.json's change is required even for those who skip the "Running Laravel 5.3 & 5.4 Tests In A Single Application" section.

* [5.4] Change user_id to unsigned integer

In the session database table, user_id should be an unsigned integer.

*           add docs for running dusk on travis and circleci

* fix

* Semantic Versioning paragraph small typo fix.

* tweak wording

*     fix CircleCI formatting

* Update facades.md

* Update facades.md

* Added `deleteFileAfterSend()` back in the docs

it is a feature.

* wip

* Document Collection::times() method and flatMap shortcut

* Update collections.md

* Improve the environment configuration documentation

- Moves two general-topic paragraphs from "Retrieving Environment Configuration" sub-section into the main "Environment Configuration" section
- Adds a security note about committing .env files
- Adds a general note to clarify that .env files variables can be overridden by external environment variables
- Makes the "Retrieving Environment Configuration" sub-section linkable
- Adds a tip to the "Determining The Current Environment" sub-section to mention that the APP_ENV variable could be overridden at server-level configuration

* Change word.

* adjust wording and tips

* remove section from docs... php has built in ?? operator

* Clarify 2nd argument of firstOrNew & firstOrCreate

* Update charset/collation

* adjust wording

* Document the Mailable callbacks functionality

* Fix event-fake link

Replace old "mocking-events" to "event-fake" HTML ID

* clean up some documentation

* clarify `optional` and `present`

* clarify note

* Add Documentation for new Blade directives @empty & @Isset

* Adds `assertJsonFragmentMission()` to the list of available testing methods

Signed-off-by: Jesse Schutt <jesse.schutt@zaengle.com>

* Update http-tests.md

* adjust wording

* adjust wording

* @empty checks if $records is empty

* Update query builder JSON docs

* Update homestead.md

* Document "flatten" parameter of mix.copy()

* fix example

* add note
  • Loading branch information
asadman1523 authored and appleboy committed Jul 8, 2017
1 parent 9c488c6 commit 9b756f4
Show file tree
Hide file tree
Showing 40 changed files with 1,027 additions and 243 deletions.
4 changes: 2 additions & 2 deletions authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ If the redirect path needs custom generation logic you may define a `redirectTo`

protected function redirectTo()
{
//
return '/path';
}

> {tip} The `redirectTo` method will take precedence over the `redirectTo` attribute.
Expand Down Expand Up @@ -403,7 +403,7 @@ If you are not using a traditional relational database to store your users, you

use Illuminate\Support\Facades\Auth;
use App\Extensions\RiakUserProvider;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
Expand Down
4 changes: 2 additions & 2 deletions authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ These directives are convenient shortcuts for writing `@if` and `@unless` statem

Like most of the other authorization methods, you may pass a class name to the `@can` and `@cannot` directives if the action does not require a model instance:

@can('create', Post::class)
@can('create', App\Post::class)
<!-- The Current User Can Create Posts -->
@endcan

@cannot('create', Post::class)
@cannot('create', App\Post::class)
<!-- The Current User Can't Create Posts -->
@endcannot
15 changes: 8 additions & 7 deletions billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

Laravel Cashier provides an expressive, fluent interface to [Stripe's](https://stripe.com) and [Braintree's](https://www.braintreepayments.com) subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing. In addition to basic subscription management, Cashier can handle coupons, swapping subscription, subscription "quantities", cancellation grace periods, and even generate invoice PDFs.

> {note} If you're only performing "one-off" charges and do not offer subscriptions. You should not use Cashier. You should use the Stripe and Braintree SDKs directly.
> {note} If you're only performing "one-off" charges and do not offer subscriptions, you should not use Cashier. Instead, use the Stripe and Braintree SDKs directly.
<a name="configuration"></a>
## Configuration
Expand Down Expand Up @@ -92,6 +92,7 @@ Finally, you should configure your Stripe key in your `services.php` configurati

'stripe' => [
'model' => App\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
],

Expand Down Expand Up @@ -199,7 +200,7 @@ To create a subscription, first retrieve an instance of your billable model, whi

$user = User::find(1);

$user->newSubscription('main', 'monthly')->create($creditCardToken);
$user->newSubscription('main', 'monthly')->create($stripeToken);

The first argument passed to the `newSubscription` method should be the name of the subscription. If your application only offers a single subscription, you might call this `main` or `primary`. The second argument is the specific Stripe / Braintree plan the user is subscribing to. This value should correspond to the plan's identifier in Stripe or Braintree.

Expand All @@ -209,7 +210,7 @@ The `create` method will begin the subscription as well as update your database

If you would like to specify additional customer details, you may do so by passing them as the second argument to the `create` method:

$user->newSubscription('main', 'monthly')->create($creditCardToken, [
$user->newSubscription('main', 'monthly')->create($stripeToken, [
'email' => $email,
]);

Expand All @@ -221,7 +222,7 @@ If you would like to apply a coupon when creating the subscription, you may use

$user->newSubscription('main', 'monthly')
->withCoupon('code')
->create($creditCardToken);
->create($stripeToken);

<a name="checking-subscription-status"></a>
### Checking Subscription Status
Expand Down Expand Up @@ -358,7 +359,7 @@ If the user cancels a subscription and then resumes that subscription before the

The `updateCard` method may be used to update a customer's credit card information. This method accepts a Stripe token and will assign the new credit card as the default billing source:

$user->updateCard($creditCardToken);
$user->updateCard($stripeToken);

<a name="subscription-trials"></a>
## Subscription Trials
Expand All @@ -372,7 +373,7 @@ If you would like to offer trial periods to your customers while still collectin

$user->newSubscription('main', 'monthly')
->trialDays(10)
->create($creditCardToken);
->create($stripeToken);

This method will set the trial period ending date on the subscription record within the database, as well as instruct Stripe / Braintree to not begin billing the customer until after this date.

Expand Down Expand Up @@ -416,7 +417,7 @@ Once you are ready to create an actual subscription for the user, you may use th

$user = User::find(1);

$user->newSubscription('main', 'monthly')->create($creditCardToken);
$user->newSubscription('main', 'monthly')->create($stripeToken);

<a name="handling-stripe-webhooks"></a>
## Handling Stripe Webhooks
Expand Down
26 changes: 12 additions & 14 deletions blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,11 @@ Of course, you are not limited to displaying the contents of the variables passe

The current UNIX timestamp is {{ time() }}.

> {note} Blade `{{ }}` statements are automatically sent through PHP's `htmlentities` function to prevent XSS attacks.
#### Echoing Data If It Exists

Sometimes you may wish to echo a variable, but you aren't sure if the variable has been set. We can express this in verbose PHP code like so:

{{ isset($name) ? $name : 'Default' }}

However, instead of writing a ternary statement, Blade provides you with the following convenient shortcut, which will be compiled to the ternary statement above:

{{ $name or 'Default' }}

In this example, if the `$name` variable exists, its value will be displayed. However, if it does not exist, the word `Default` will be displayed.
> {note} Blade `{{ }}` statements are automatically sent through PHP's `htmlspecialchars` function to prevent XSS attacks.
#### Displaying Unescaped Data

By default, Blade `{{ }}` statements are automatically sent through PHP's `htmlentities` function to prevent XSS attacks. If you do not want your data to be escaped, you may use the following syntax:
By default, Blade `{{ }}` statements are automatically sent through PHP's `htmlspecialchars` function to prevent XSS attacks. If you do not want your data to be escaped, you may use the following syntax:

Hello, {!! $name !!}.

Expand Down Expand Up @@ -211,6 +199,16 @@ For convenience, Blade also provides an `@unless` directive:
You are not signed in.
@endunless

In addition to the conditional directives already discussed, the `@isset` and `@empty` directives may be used as convenient shortcuts for their respective PHP functions:

@isset($records)
// $records is defined and is not null...
@endisset

@empty($records)
// $records is "empty"...
@endempty

<a name="loops"></a>
### Loops

Expand Down
2 changes: 2 additions & 0 deletions broadcasting.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ When using Pusher and [Laravel Echo](#installing-laravel-echo), you should speci

import Echo from "laravel-echo"

window.Pusher = require('pusher-js');

window.Echo = new Echo({
broadcaster: 'pusher',
key: 'your-pusher-key'
Expand Down
Loading

0 comments on commit 9b756f4

Please sign in to comment.