Skip to content

Commit

Permalink
laravel docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vankovap committed Jan 17, 2025
1 parent f29d438 commit f9d0d59
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 195 deletions.
95 changes: 62 additions & 33 deletions apps/docs/content/frameworks/laravel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Zerops implements what we call "transparent infrastructure" - you get enterprise

*No artificial limitations, no framework-specific compromises - just solid infrastructure that lets Laravel do what it does best.*

:::tip
New Zerops accounts receive $15 in free credits for testing. After verifying your account with a $10 initial payment, you'll get an additional $50 in credits.
:::

## Quick Start

Choose a recipe that matches your needs and deploy with a single click. Each recipe sets up a complete environment with all necessary services preconfigured.
Expand All @@ -30,11 +34,10 @@ All recipes include:
- **L3/L7 balancers**
- **Logging & metrics**

<div className="grid grid-cols-2 gap-2">
<div className="grid grid-cols-1 md:grid-cols-2 gap-2">
<div className="min-w-[250px]">
<CustomCardWithIcon icon={IconLaravel} title="Laravel Minimal">
<div className="flex-grow pb-0.5 pt-0.5">This is the most bare-bones example of Laravel app including core services + PostgreSQL.</div>

<div className="flex-grow pb-0.5 pt-0.5">This is the most bare-bones example of Laravel app including core services + PostgreSQL.</div>
<DeployButton link="laravel-minimal" badgeWidth="200" />
</CustomCardWithIcon>
</div>
Expand All @@ -60,6 +63,11 @@ All recipes include:

## Core Features

### Infrastructure and Security
Each project runs in its own isolated network with enterprise-level security features automatically configured.

What makes this special is how it combines security with simplicity - this infrastructure requires zero configuration from you – it's all handled automatically when you create your project.

### Native Service Discovery
Services within your project communicate seamlessly using internal hostnames:

Expand All @@ -71,7 +79,13 @@ REDIS_HOST=${cache_hostname}
*Environment variables are automatically injected and synchronized across all containers.*

### Intelligent Scaling
Resources scale automatically in both directions based on actual usage:
One of Zerops' most powerful features is its intelligent autoscaling system, which:
* Scales resources (CPU, RAM, Disk) up and down based on actual usage
* Maintains minimum required resources to optimize costs
* Handles both vertical and horizontal scaling automatically
* Manages disk space dynamically (a unique feature in the industry)

Through a simple configuration, you define resource boundaries while Zerops automatically handles the complex scaling decisions:

```yaml
# Example scaling configuration
Expand All @@ -91,7 +105,6 @@ services:
Deploy with confidence using our battle-tested pipeline:
```yaml title="zerops.yml"
# zerops.yml
zerops:
- setup: app
build:
Expand All @@ -105,11 +118,11 @@ zerops:
initCommands:
- php artisan config:cache
- php artisan route:cache
- php artisan migrate --force
- php artisan migrate --force --isolated
```
### High Availability by Design
Every service can run in HA mode with automatic failover:
### High Availability
Every service can run in HA mode with automatic failover.
```yaml
services:
Expand All @@ -122,22 +135,40 @@ services:
mode: HA # Redis cluster configuration
```
Setting up a production-grade HA database cluster typically requires deep DevOps expertise. Zerops automates this complexity, giving you an enterprise-grade setup with a single configuration flag:
* **Database Cluster** distributed across multiple physical servers
* **Automatic failover** and data replication
* **Enhanced performance** through load distribution
* **Production-grade reliability** out of the box
## Development Workflow
{/* ### Local Development */}
{/* Connect your local environment directly to remote services: */}
### Team Collaboration
Zerops enables seamless team development through:
{/* ```bash */}
{/* # Install Zerops CLI */}
{/* npm i -g @zerops/zcli */}
* **Declarative Infrastructure** - version control your entire setup
* **Identical Environments** - every team member gets production-parity
* **Automated Setup** - new team members are productive in minutes
* **Transparent Configuration** - easily review and audit changes
{/* # Login and connect to your project */}
{/* zcli login */}
{/* zcli connect my-laravel-project */}
### Local Development
Connect to your production-grade databases without any local setup through Zerops' VPN.
Start with
```
zcli vpn up
```
and select your project. Get your database credentials from the service's **Access details** in your project dashboard and update your local `.env`. See PostgreSQL example below:

```yml
DB_CONNECTION=pgsql
DB_HOST=db.zerops # References the service's hostname
DB_PORT=5432
DB_DATABASE=db
DB_USERNAME=db
DB_PASSWORD=[password from Access details]
```

{/* # Your local .env now works with remote services */}
{/* php artisan serve */}
{/* ``` */}
With this configuration, you can use any database tool - no local installation needed.

### Deployment Options
Choose the workflow that fits your team:
Expand All @@ -158,21 +189,19 @@ Choose the workflow that fits your team:
- Roll back to previous states
- Test deployment configurations

{/* ## Next Steps */}
## Next Steps

{/* - [Environment Variables & Secrets](/laravel/env-variables) */}
{/* - [Database Migrations](/laravel/migrations) */}
{/* - [Redis Configuration](/laravel/redis) */}
{/* - [SMTP Setup](/laravel/smtp) */}
{/* - [Backup Strategies](/laravel/backups) */}
{/* - [Log Management](/laravel/logging) */}
{/* - [Advanced Scaling](/laravel/scaling) */}
- [Environment Variables](/frameworks/laravel/env-variables)
- [Database Migrations](/frameworks/laravel/migrations)
- [Cache & Queue with Redis](/frameworks/laravel/redis)
- [Schedule Jobs & CRON](//frameworks/laravel/cron)
- [SMTP Configuration](/frameworks/laravel/smtp)
- [Logs](/frameworks/laravel/logs)

{/* ## Resources */}
## Resources

{/* - [GitHub Example Repository](https://github.com/zeropsio/laravel-example) */}
{/* - [Laravel Recipe Reference](/recipes/laravel) */}
{/* - [CLI Documentation](/cli/overview) */}
{/* - [API Reference](/api/overview) */}
- [Laravel Documentation](https://laravel.com/docs)
- [Laravel Recipe Repository](https://github.com/zeropsio/recipe-laravel-minimal)
- [zcli Documentation](/references/cli)

*Need help? Join our [Discord community](https://discord.gg/zerops) or check out our [getting started guides](/getting-started).*
*Need help? Join our [Discord community](https://discord.gg/zerops) or check out our [quickstart guide](/frameworks/laravel/introduction).*
20 changes: 11 additions & 9 deletions apps/docs/content/frameworks/laravel/env-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ services:
```
### Runtime Variables
These variables are typically environment-specific but not sensitive. Variables that reference secrets can be safely added in `zerops.yml` as they do not contain actual sensitive values.

These variables, defined in `zerops.yml`, are typically environment-specific but not sensitive.
:::note
Changes to runtime variables require application redeployment to take effect.
:::

Below is a complete working example of `envVariables` in `zerops.yml` (sourced from [Laravel Jetstream recipe](https://github.com/zeropsio/recipe-laravel-jetstream/blob/main/zerops.yml):
Below is a complete working example of `envVariables` in `zerops.yml` (sourced from [Laravel Jetstream recipe](https://github.com/zeropsio/recipe-laravel-jetstream/blob/main/zerops.yml)):

<Dropdown>
<DropdownItem title="Runtime Variables example">
Expand Down Expand Up @@ -152,8 +151,10 @@ FILESYSTEM_DISK: s3
Read more about [object storage](/object-storage/overview) in Zerops.

#### Logging Configuration
System monitoring and debugging configuration that determines how your application tracks events and errors.

System monitoring and debugging configuration that determines how your application tracks events and errors. Use `syslog` channel to access logs from Zerops Dashboard.
```
LOG_CHANNEL: syslog
```
Learn how to properly [configure logging](/frameworks/laravel/logs) for Laravel in Zerops.
#### Mail Configuration
Expand All @@ -172,10 +173,11 @@ Learn how to properly [configure cache, queue & session management](/frameworks/
:::tip
For automatic execution with each deploy, add these commands to the `initCommands` section of your `zerops.yml` file.
```yml title="zerops.yml"
initCommands:
- php artisan view:cache
- php artisan config:cache
- php artisan route:cache
initCommands:
- php artisan view:cache
- php artisan config:cache
- php artisan route:cache
```
:::
22 changes: 11 additions & 11 deletions apps/docs/content/frameworks/laravel/faq.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: FAQ
description: Frequently Asked Questions about Laravel on Zerops
description: Frequently asked questions about Laravel on Zerops
---

import { FAQ, FAQItem } from '/src/components/Faq';

<FAQ>
<FAQItem question="How Do I Configure Environment Variables?">
<FAQItem question="How do I configure environment variables?">
You can set environment variables through the Zerops dashboard or in your `zerops.yml` file under the `run.envVariables` section:

```yaml
Expand All @@ -20,7 +20,7 @@ import { FAQ, FAQItem } from '/src/components/Faq';
```
</FAQItem>
<FAQItem question="How Do I Run Database Migrations?">
<FAQItem question="How do I run database migrations?">
You can run migrations during initialization by adding the command to your `zerops.yml`:

```yaml
Expand All @@ -32,7 +32,7 @@ import { FAQ, FAQItem } from '/src/components/Faq';
```
</FAQItem>

<FAQItem question="Can I Use Laravel Queue with Zerops?">
<FAQItem question="Can I use Laravel queue with Zerops?">
Yes, Laravel Queue is fully supported. Configure Redis as your queue driver:

```yaml
Expand All @@ -46,7 +46,7 @@ import { FAQ, FAQItem } from '/src/components/Faq';
```
</FAQItem>

<FAQItem question="How Do I Handle File Storage?">
<FAQItem question="How do I handle file storage?">
Zerops supports S3-compatible storage. Configure it using these environment variables:

```yaml
Expand All @@ -64,11 +64,11 @@ import { FAQ, FAQItem } from '/src/components/Faq';
```
</FAQItem>

<FAQItem question="How Do I Enable HTTPS?">
<FAQItem question="How do I enable HTTPS?">
HTTPS is automatically enabled when you use either a Zerops subdomain or configure your custom domain. No additional configuration is required.
</FAQItem>

<FAQItem question="Can I Run Scheduled Tasks?">
<FAQItem question="Can I run scheduled tasks?">
Yes, you can configure cron jobs in your `zerops.yml`:

```yaml
Expand All @@ -82,7 +82,7 @@ import { FAQ, FAQItem } from '/src/components/Faq';
```
</FAQItem>

<FAQItem question="How Do I Configure Redis for Caching?">
<FAQItem question="How do I configure Redis for caching?">
Configure Redis for caching, sessions, and queues:

```yaml
Expand All @@ -98,7 +98,7 @@ import { FAQ, FAQItem } from '/src/components/Faq';
```
</FAQItem>

<FAQItem question="How Do I Optimize My Laravel Application?">
<FAQItem question="How do I optimize my Laravel application?">
Add these optimization commands to your initialization:

```yaml
Expand All @@ -113,7 +113,7 @@ import { FAQ, FAQItem } from '/src/components/Faq';
```
</FAQItem>

<FAQItem question="How Do I Handle Asset Compilation?">
<FAQItem question="How do I handle asset compilation?">
Configure asset compilation in your build phase:

```yaml
Expand All @@ -133,7 +133,7 @@ import { FAQ, FAQItem } from '/src/components/Faq';
```
</FAQItem>

<FAQItem question="How Do I Implement Health Checks?">
<FAQItem question="How do I implement health checks?">
Add health checks to ensure your application is running properly:

```yaml
Expand Down
Loading

0 comments on commit f9d0d59

Please sign in to comment.