Skip to content
Home » Laravel Asana Package

Laravel Asana Package

For the needs of a side project, I needed a Laravel package that allows me to use the Asana API. So I forked an existing package that was starting to date to update it and add what I needed.

You can find this package on my GitHub : Package Laravel Asana

Installation

Here is the command to install it via composer :

[pastacode lang=”bash” manual=”composer%20require%20sinepel%2Flaravel-asana” message=”” highlight=”” provider=”manual”/]

Register package

Laravel

Once installed, you must register the Laravel Asana package in the Laravel Providers. Open the config/app.php file and look for the providers table

[pastacode lang=”php” manual=”‘providers’%20%3D%3E%20%5B%0A%20%20%20%20Sinepel%5CLaravelAsana%5CServiceProvider%3A%3Aclass%2C%0A%5D” message=”” highlight=”” provider=”manual”/]

Lumen

For Lumen, add the following line to the file bootstrap/app.php

[pastacode lang=”php” manual=”%24app-%3Eregister(Sinepel%5CLaravelAsana%5CServiceProvider%3A%3Aclass)%3B” message=”” highlight=”” provider=”manual”/]

Facade

This package also comes with a facade (or you can just use the asana() function). To save the facade, add it to the alias table of your config/app.php file.

[pastacode lang=”php” manual=”‘aliases’%20%3D%3E%20%5B%0A%20%20%20%20’Asana’%20%3D%3E%20’Sinepel%5CLaravelAsana%5CFacade%5CAsana’%2C%0A%5D” message=”” highlight=”” provider=”manual”/]

Publishing the configuration file

Go to the root of your project on your device and run the following command

[pastacode lang=”bash” manual=”php%20artisan%20vendor%3Apublish%20–provider%3D%22Sinepel%5CLaravelAsana%5CServiceProvider%22%20–tag%3Dconfig” message=”” highlight=”” provider=”manual”/]

A new configuration file will be available in config/asana.php