Download the PHP package aiven/aiven-laravel without Composer

On this page you can find all versions of the php package aiven/aiven-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package aiven-laravel

Aiven Commands for Laravel

✨ Add some Aiven magic to your Laravel project ✨

This Laravel package provides some aiven commands for artisan to help with managing your development databases and producing the correct configuration to use with them. This version supports both MySQL and PostgreSQL.

Use the commands to:

Getting started

Install the package with Composer:

You will need an Aiven account - sign up for a free trial if you don't have one already. Go ahead and create the database(s) you'll be using in your project through the web interface, or investigate the Aiven CLI.

Get an auth token for your Aiven account, and set it as AIVEN_API_TOKEN in your environment.

It's recommended to also set AIVEN_DEFAULT_PROJECT as the project in your Aiven account that you'll be using services from (but you can also supply --project [projectname] for all the commands instead if you like)

Usage

Get a list of the Aiven services (databases) available:

Get the environment variables to export or paste into .env for a particular service:

When you use the DATABASE_URL in Laravel, you must remove the existing DB_HOST, DB_PORT, etc configuration so that it does not conflict.

Check the status of the service:

Power the service on or off:

It's useful to power things down when you're not using them so that you aren't being charged (even if you're still paying in trial credits!)

Datastore-specific setup

MySQL and PostgreSQL®

PHP is on good terms with relational databases, and Laravel makes this very straight forward.

  1. Remove all the configuration entries from .env starting with DB_

  2. Paste the output of the aiven:getconfig command. For both MySQL and PostgreSQL, this is a DATABASE_URL. For PostgreSQL, we need to tell Laravel we want to use Postgres (MySQL is the default) so the command also outputs DB_CONNECTION=pgsql and this should also be included.

Redis™*

Redis™ needs some extra dependencies (see Laravel Redis docs), and then you can set the REDIS_URL to the value returned by aiven:getconfig.

OpenSearch® with Laravel Scout

This uses some Elasticsearch libraries because the OpenSearch project is a fork so they are reasonably compatible.

The aiven:getconfig command will give you just the connection string for an OpenSearch service; put this in the config/explorer.php so that it looks something like this:

The Scout documentation has a good overview of how to make your models searchable, and the Explorer project adds commands to create the index.

Troubleshooting

MySQL primary key errors

Laravel's initial migrations assumes that your MySQL database doesn't enforce primary keys (see related bug for more info) - disable the mysql.sql_require_primary_key setting on Aiven if you run into this.

Connection problems

If you add the config to your environment and still can't connect, check that you don't have other environment variables with names starting DB_ ... values like DB_HOST should be removed when you use the DATABASE_URL field to connect.

Get in touch

Questions? Problems? Open an issue and let us know.

Trademarks

MySQL, OpenSearch, PostgreSQL and Laravel are trademarks and property of their respective owners. All product and service names used in this website are for identification purposes only and do not imply endorsement.

/* Redis is a trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by Aiven Oy is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and Aiven Oy.


All versions of aiven-laravel with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aiven/aiven-laravel contains the following files

Loading the files please wait ....