1. Go to this page and download the library: Download tanghengzhi/midjourney-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tanghengzhi / midjourney-php example snippets
use Ferranfg\MidjourneyPhp\Midjourney;
$midjourney = new Midjourney($discord_channel_id, $discord_user_token);
$message = $midjourney->generate('An astronaut riding a horse');
return $message->upscaled_photo_url;
$imagine_object = $midjourney->imagine('An astronaut riding a horse');
$imagine_object = $midjourney->getImagine('An astronaut riding a horse');