{"id":15282513,"url":"https://github.com/njasm/laravel5-soundcloud","last_synced_at":"2025-04-12T22:55:34.239Z","repository":{"id":27197192,"uuid":"30667567","full_name":"njasm/laravel5-soundcloud","owner":"njasm","description":"Soundcloud API Service Provider For Laravel 5","archived":false,"fork":false,"pushed_at":"2019-08-30T21:55:34.000Z","size":18,"stargazers_count":15,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T22:55:30.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/njasm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-11T20:14:06.000Z","updated_at":"2021-04-29T14:04:03.000Z","dependencies_parsed_at":"2022-08-17T17:15:11.790Z","dependency_job_id":null,"html_url":"https://github.com/njasm/laravel5-soundcloud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njasm%2Flaravel5-soundcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njasm%2Flaravel5-soundcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njasm%2Flaravel5-soundcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njasm%2Flaravel5-soundcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/njasm","download_url":"https://codeload.github.com/njasm/laravel5-soundcloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643050,"owners_count":21138353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T14:26:37.438Z","updated_at":"2025-04-12T22:55:34.217Z","avatar_url":"https://github.com/njasm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Total Downloads](https://poser.pugx.org/njasm/laravel5-soundcloud/downloads.png)](https://packagist.org/packages/njasm/laravel5-soundcloud)\n[![License](https://poser.pugx.org/njasm/laravel5-soundcloud/license.png)](https://packagist.org/packages/njasm/laravel5-soundcloud)\n\n## Laravel 5 - Soundcloud Api Service Provider\n\nSoundcloud API Service Provider For Laravel 5\n\n- [Installation](#installation)\n- [SoundCloud Credentials](#soundcloud-credentials)\n- [Configuration](#configuration)\n- [Usage](#usage)\n\n### Installation\nThe package can be installed via Composer by requiring the ``\"njasm/laravel5-soundcloud\": \"dev-master\"`` package in your project's composer.json.\n\n```json\n{\n    \"require\": {\n        \"njasm/laravel5-soundcloud\": \"dev-master\"\n    },\n    \"minimum-stability\": \"dev\"\n}\n```\n\nNext you need to add the service provider to ``config/app.php``.\n\n```php\n'providers' =\u003e [\n    // ...\n    Njasm\\Laravel\\Soundcloud\\SoundcloudProvider::class,\n],\n```\n\nAdditionally, if you wish to use the Facade, you may register an alias for it in ``config/app.php``:\n```php\n'aliases' =\u003e [\n    // ...\n    'Soundcloud' =\u003e Njasm\\Laravel\\Soundcloud\\Facades\\Soundcloud::class,\n],\n```\n\nWe've also got a dedicated config file, which can be published by running the following command:\n```\nphp artisan vendor:publish --provider=\"Njasm\\Laravel\\Soundcloud\\SoundcloudProvider\"\n```\n\n### SoundCloud Credentials\n\nSince you most-likely don't want your `client_id`, `client_secret`, `username` or `password` to be on your repository (for security concerns), put them in the `.env` file:\n```ini\nSOUNDCLOUD_CLIENT_ID=your_client_id\nSOUNDCLOUD_CLIENT_SECRET=your_client_secret\nSOUNDCLOUD_CALLBACK_URL=your_callback_url\nSOUNDCLOUD_USERNAME=your_username\nSOUNDCLOUD_PASSWORD=your_password\nSOUNDCLOUD_AUTO_CONNECT=false\n```\n\nand reference them in `config/services.php` as such:\n\n```php\n// ...\n'soundcloud' =\u003e [\n    'client_id' =\u003e env('SOUNDCLOUD_CLIENT_ID'),\n    'client_secret' =\u003e env('SOUNDCLOUD_CLIENT_SECRET'),\n    'callback_url' =\u003e env('SOUNDCLOUD_CALLBACK_URL'),\n],\n```\n\n### Configuration\n\nBesides the ones in `services.php` (which now holds all of your SoundCloud credentials), a few more options are available in the dedicated config file:\n- `username` and `password`, both used for connecting to the SoundCloud API as an actual user. These should be defined in the `.env` file.\n- `auto_connect`: When set to true, the user credentials above will be used to connect to SoundCloud automatically, without you having the call the `userCredentials` method manually. This may be useful to quickly access data of the authenticated user. Note that, since this option may vary depending of the app evironment (e.g. when running unit tests), it should be defined in the `.env` file as well.\n\n### Usage\n\nYou can access the Soundcloud object through a number of ways:\n\n**Using dependency injection**  \n\nIn this case, we'll make use of Laravel's IoC container to automatically resolve the binding:\n```php\nnamespace App\\Http\\Controllers;\n\nuse Njasm\\Soundcloud\\SoundcloudFacade;\n\nclass HomeController extends Controller\n{\n    public function index(SoundcloudFacade $soundcloud)\n    {\n        echo $soundcloud-\u003egetAuthUrl();\n    }\n}\n```\n\n\n**Using the facade**\n\n```php\nnamespace App\\Http\\Controllers;\n\nuse Soundcloud;\n\nclass HomeController extends Controller\n{\n    public function index()\n    {\n        echo Soundcloud::getAuthUrl();\n    }\n}\n```\n\n\n**Manually resolving the binding out of the container**\n\nYou can either use the full namespace to the `SoundcloudFacade` to reference the binding in the IoC:\n```php\n$soundcloud = $this-\u003eapp-\u003emake(\\Njasm\\Soundcloud\\SoundcloudFacade::class);\n$soundcloud = App::make(\\Njasm\\Soundcloud\\SoundcloudFacade::class);\n$soundcloud = app(\\Njasm\\Soundcloud\\SoundcloudFacade::class);\n```\n\nor use the shorthand alias:\n```php\n$soundcloud = $this-\u003eapp-\u003emake('Soundcloud');\n$soundcloud = App::make('Soundcloud');\n$soundcloud = app('Soundcloud');\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjasm%2Flaravel5-soundcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnjasm%2Flaravel5-soundcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjasm%2Flaravel5-soundcloud/lists"}