### Install Dependencies and Run Tests Source: https://github.com/vimeo/laravel/blob/master/CONTRIBUTING.md This section provides commands to set up the project's dependencies using Composer and to execute the test suite with PHPUnit. Ensure Composer is installed globally before running these commands. ```sh $ composer install ``` ```sh $ vendor/bin/phpunit ``` -------------------------------- ### Install Laravel Vimeo Package Source: https://github.com/vimeo/laravel/blob/master/README.md Instructions for installing the Laravel Vimeo package using Composer. This command adds the necessary files to your project. ```bash $ composer require vimeo/laravel ``` -------------------------------- ### Upload Video to Vimeo Source: https://github.com/vimeo/laravel/blob/master/README.md Provides an example of uploading a video file to Vimeo using the library. It specifies the local path to the video file. ```php $vimeo->upload('/home/aaron/foo.mp4'); ``` -------------------------------- ### Fetch Vimeo Data Source: https://github.com/vimeo/laravel/blob/master/README.md Demonstrates how to fetch data from Vimeo using the library. It shows making a GET request to a Vimeo API endpoint with parameters. ```php $vimeo->request('/users/dashron', ['per_page' => 2], 'GET'); ``` -------------------------------- ### Publish Vendor Assets Source: https://github.com/vimeo/laravel/blob/master/README.md Command to publish the package's configuration file to your Laravel project. This allows customization of Vimeo connection settings. ```bash $ php artisan vendor:publish --provider="Vimeo\Laravel\VimeoServiceProvider" ``` -------------------------------- ### Vimeo Configuration Variables Source: https://github.com/vimeo/laravel/blob/master/README.md Lists the environment variables required for configuring Vimeo connections. These include client ID, secret, and access tokens for default and alternate connections. ```env VIMEO_CLIENT= VIMEO_SECRET= VIMEO_ACCESS= VIMEO_ALT_CLIENT= VIMEO_ALT_SECRET= VIMEO_ALT_ACCESS= ``` -------------------------------- ### Vimeo Dependency Injection Source: https://github.com/vimeo/laravel/blob/master/README.md Illustrates injecting the `VimeoManager` into a class constructor for usage, providing an alternative to using facades. This approach promotes better testability and adherence to SOLID principles. ```PHP use Vimeo\Laravel\VimeoManager; use Illuminate\Support\Facades\App; class Foo { protected $vimeo; public function __construct(VimeoManager $vimeo) { $this->vimeo = $vimeo; } public function bar() { $this->vimeo->upload('/foo.mp4'); } } App::make('Foo')->bar(); ``` -------------------------------- ### Register Vimeo Facade Alias Source: https://github.com/vimeo/laravel/blob/master/README.md Demonstrates how to set up the Vimeo facade alias in Laravel's configuration. This allows for convenient static method calls to the Vimeo manager. ```php 'Vimeo' => Vimeo\Laravel\Facades\Vimeo::class ``` -------------------------------- ### Vimeo Connection Management Source: https://github.com/vimeo/laravel/blob/master/README.md Shows how to explicitly select a Vimeo connection or rely on the default connection. Demonstrates checking and setting the default connection for the Vimeo manager. ```PHP use Vimeo\Laravel\Facades\Vimeo; // Writing this… Vimeo::connection('main')->upload('/bar.mp4'); // …is identical to writing this Vimeo::upload('/bar.mp4'); // and is also identical to writing this. Vimeo::connection()->upload('/bar.mp4'); // This is because the main connection is configured to be the default. Vimeo::getDefaultConnection(); // This will return main. // We can change the default connection. Vimeo::setDefaultConnection('alternative'); // The default is now alternative. ``` -------------------------------- ### Register Vimeo Service Provider Source: https://github.com/vimeo/laravel/blob/master/README.md Shows how to register the Vimeo service provider in Laravel's configuration file. This is essential for the package to function, especially in older Laravel versions. ```php Vimeo\Laravel\VimeoServiceProvider::class ``` -------------------------------- ### Basic Vimeo API Request and Upload Source: https://github.com/vimeo/laravel/blob/master/README.md Demonstrates making a request to the Vimeo API and uploading a file using the Laravel facade. Assumes authentication details are configured in the Laravel app. The `request` method takes an endpoint, parameters, and HTTP method, while `upload` takes a file path. ```PHP use Vimeo\Laravel\Facades\Vimeo; Vimeo::request('/me/videos', ['per_page' => 10], 'GET'); // We're done here - how easy was that, it just works! Vimeo::upload('/bar.mp4'); // This example is simple and there are far more methods available. ``` -------------------------------- ### Upload Image via Facade Source: https://github.com/vimeo/laravel/blob/master/README.md Illustrates using the Vimeo facade to upload an image to a specific video resource. This method is useful for managing video assets. ```php Vimeo::uploadImage('/videos/123/images', '/home/aaron/bar.png', true); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.