Google\Cloud\Storage\StorageClient::createBucket PHP Method

createBucket() public method

Example: $bucket = $storage->createBucket('bucket'); Create a bucket with logging enabled. $bucket = $storage->createBucket('myBeautifulBucket', [ 'logging' => [ 'logBucket' => 'bucketToLogTo', 'logObjectPrefix' => 'myPrefix' ] ]);
See also: https://cloud.google.com/storage/docs/json_api/v1/buckets/insert Buckets insert API documentation.
public createBucket ( string $name, array $options = [] ) : Bucket
$name string Name of the bucket to be created.
$options array [optional] { Configuration options. @type string $predefinedAcl Apply a predefined set of access controls to this bucket. @type string $predefinedDefaultObjectAcl Apply a predefined set of default object access controls to this bucket. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. @type string $fields Selector which will cause the response to only return the specified fields. @type array $acl Access controls on the bucket. @type array $cors The bucket's Cross-Origin Resource Sharing (CORS) configuration. @type array $defaultObjectAcl Default access controls to apply to new objects when no ACL is provided. @type array $lifecycle The bucket's lifecycle configuration. @type string $location The location of the bucket. **Defaults to** `"US"`. @type array $logging The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. @type string $storageClass The bucket's storage class. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD and DURABLE_REDUCED_AVAILABILITY. @type array $versioning The bucket's versioning configuration. @type array $website The bucket's website configuration. }
return Bucket
    public function createBucket($name, array $options = [])
    {
        $response = $this->connection->insertBucket($options + ['name' => $name, 'project' => $this->projectId]);
        return new Bucket($this->connection, $name, $response);
    }