This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 146
Add support for Laravel 5.1 LTS #10
Merged
matthewgoslett
merged 4 commits into
Superbalist:master
from
jbaron-mx:support-laravel-5.1
May 19, 2017
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ Add a new disk to your `filesystems.php` config | |
'key_file' => env('GOOGLE_CLOUD_KEY_FILE', null), // optional: /path/to/service-account.json | ||
'bucket' => env('GOOGLE_CLOUD_STORAGE_BUCKET', 'your-bucket'), | ||
'path_prefix' => env('GOOGLE_CLOUD_STORAGE_PATH_PREFIX', null), // optional: /default/path/to/apply/in/bucket | ||
'storage_api_uri' => env('GOOGLE_CLOUD_STORAGE_API_URI', null), // see: Public URLs below | ||
'storage_api_uri' => env('GOOGLE_CLOUD_STORAGE_API_URI', null), | ||
], | ||
``` | ||
|
||
|
@@ -54,34 +54,6 @@ The Google Client uses a few methods to determine how it should authenticate wit | |
4. If running in **Google App Engine**, the built-in service account associated with the application will be used. | ||
5. If running in **Google Compute Engine**, the built-in service account associated with the virtual machine instance will be used. | ||
|
||
### Public URLs | ||
|
||
The adapter implements a `getUrl($path)` method which returns a public url to a file. | ||
|
||
```php | ||
$disk = Storage::disk('gcs'); | ||
$url = $disk->url('folder/my_file.txt'); | ||
>>> http://storage.googleapis.com/bucket-name/folder/my_file.txt | ||
``` | ||
|
||
If you configure a `path_prefix` in your config: | ||
```php | ||
$disk = Storage::disk('gcs'); | ||
$url = $disk->url('folder/my_file.txt'); | ||
>>> http://storage.googleapis.com/bucket-name/path-prefix/folder/my_file.txt | ||
``` | ||
|
||
If you configure a custom `storage_api_uri` in your config: | ||
```php | ||
$disk = Storage::disk('gcs'); | ||
$url = $disk->url('folder/my_file.txt'); | ||
>>> http://your-custom-domain.com/bucket-name/path-prefix/folder/my_file.txt | ||
``` | ||
|
||
For a custom domain (storage api uri), you will need to configure a CNAME DNS entry pointing to `storage.googleapis.com`. | ||
|
||
Please see https://cloud.google.com/storage/docs/xml-api/reference-uris#cname for further instructions. | ||
|
||
## Usage | ||
|
||
```php | ||
|
@@ -102,8 +74,5 @@ $disk->copy('old/file1.jpg', 'new/file1.jpg'); | |
// move a file | ||
$disk->move('old/file1.jpg', 'new/file1.jpg'); | ||
|
||
// get url to file | ||
$url = $disk->url('folder/my_file.txt'); | ||
|
||
// see https://laravel.com/docs/5.3/filesystem for full list of available functionality | ||
// see https://laravel.com/docs/5.1/filesystem for full list of available functionality | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some small change but please upcase the first character in this comment? |
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just put this back and clarify that older versions will not work. Having everything in a single branch is easier to maintain imo.