This is a basic wrapper package for sending events to the Moralis API. It exposes a single class function, moralis()
, that you can use across your Laravel controllers, models, and views.
Run composer require chernkiat/moralis-laravel
from your Laravel application root. Once that's finished, you'll need to open up your .env
file and add the following to the bottom:
MORALIS_API_KEY={your-api-key}
To send a single file to your Moralis server, use moralis('storage')->uploadFile(filename, content)
.
You can also send batch files with moralis('storage')->uploadFiles(files)
. See the documentation on batching for more details about how your files array should be formatted.
If you have any questions, feel free to reach out to me on Twitter @PCKiat.