1. Go to this page and download the library: Download laravel-ai/cli 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/ */
laravel-ai / cli example snippets
bash
php artisan ai
bash
php artisan ai:ask "What are the best practices for Laravel security?"
bash
php artisan ai:document app/Services/PaymentService.php
How would you like to receive the documentation?:
[0] Display in terminal
[1] Save to file (DOCUMENTATION_PaymentService.md)
> 1
bash
php artisan ai:image {prompt} {options}
bash
php artisan ai:image "A serene mountain landscape at sunset"
Select image quality:
[0] high
[1] medium
[2] low
> 0
Select aspect ratio:
[0] square
[1] portrait
[2] landscape
> 2
✓ Successfully generated image!
1. /Users/hardik/laravel-php/laravel-ai-cli/IMAGE_2026-02-07_15-30-45_1.png
📋 Metadata saved to: /Users/hardik/laravel-php/laravel-ai-cli/metadata_2026-02-07_15-30-45.json
bash
# Generate 3 images at once
php artisan ai:image "A futuristic city" --count=3 --metadata