Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Add support for Laravel 5.1 LTS #10

Merged
merged 4 commits into from
May 19, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 2 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
```

Expand All @@ -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

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.


```php
Expand All @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small change but please upcase the first character in this comment?

```
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
],
"require": {
"php": ">=5.5.9",
"illuminate/support": "^5.2|^5.3",
"illuminate/support": "^5.1|^5.2|^5.3",
"superbalist/flysystem-google-storage": "^3.0|^4.0",
"illuminate/filesystem": "^5.2|^5.3"
"illuminate/filesystem": "^5.1|^5.2|^5.3"
},
"autoload": {
"psr-4": {
Expand Down