Where PHP, Meets Elegance.
Attribute-driven architecture — every feature crafted with intention, delivering a cohesive, intuitive DX.
use Doppar\AI\Agent;
use Doppar\AI\AgentFactory\Agent\OpenAI;
$stream = Agent::using(OpenAI::class)
->withKey(env('OPENAI_API_KEY'))
->model('gpt-4')
->prompt('Doppar vs. other PHP frameworks')
->withStreaming()
->send();
foreach ($stream as $chunk) {
echo $chunk;
flush();
}namespace App\Http\Controllers;
use Phaseolies\Support\Router\Attributes\Route;
use Phaseolies\Support\Router\Attributes\Mapper;
use Phaseolies\Database\Entity\Attributes\Model;
#[Mapper(prefix: 'user')]
class UserController extends Controller
{
#[Route(uri: '{user}', name: 'user.show')]
public function show(#[Model] ?User $user)
{
return view('profile', compact('user'));
}
}namespace App\Models;
use Doppar\Embeds\Attributes\Embeds;
use Doppar\Embeds\Concerns\Embeddable;
class Product extends Model
{
use Embeddable;
protected $creatable = ['name', 'body'];
#[Embeds]
protected $body;
}
// Search by meaning, not by keyword
$res = Product::whereSimilarTo('body', $req->q);
APP_NAME = "Doppar"
APP_KEY = "base64:wir4PVfTu*********="
APP_ENV = "local"
APP_DEBUG = true
APP_URL = "http://localhost:8000"
APP_RUNNING_IN_CONSOLE = false
APP_ROUTE_CACHE = true
LOG_CHANNEL = "stack"
SLACK_WEBHOOK_URL = "https://hooks.slack.com/***/"
CACHE_DRIVER = "file"
CACHE_PREFIX = ""
Frontend, Already Wired.
Vite, Odo layouts, CSRF tokens, and HMR are wired in from the moment you create a project. Pick React, Vue, Svelte, or Vanilla JS — Doppar handles the build pipeline, asset hashing, and production delivery.
Launch Ready.
Watch Doppar scaffold the project, install the frontend stack, and wire the build pipeline automatically. No loose setup steps. No manual configuration.
Scaffold
Creates the app shell, environment, and backend foundation.
Choose
Pick Tailwind, Bootstrap, React, Vue, Svelte, or Vanilla.
Launch
Vite, HMR, manifest hashing, and Odo layouts arrive prewired.
Elegance, Every Line.
AI agents, attribute routing, service binding, transactions, model hooks, queues, a temporal ORM, and precision scheduling — all expressed in the same clean, intentional PHP.
use Doppar\AI\Agent;
use Doppar\AI\AgentFactory\Agent\SelfHost;
$response = Agent::using(SelfHost::class)
->withHost('http://localhost:1234')
->model('local-model-name')
->prompt('Generate a PHP function to validate email')
->send();
use Doppar\AI\Agent;
use Doppar\AI\AgentFactory\Agent\OpenAI;
$stream = Agent::using(OpenAI::class)
->withKey(env('OPENAI_API_KEY'))
->model('gpt-4')
->prompt('Write a short story about a robot learning.')
->withStreaming()
->send();
foreach ($stream as $chunk) {
echo $chunk;
flush();
}
use Doppar\AI\Pipeline;
$order = $orderRepository->find(123);
$isUrgent = Pipeline::query(
item: $order,
question: 'Is this order urgent?'
);
if ($isUrgent) {
// Handle urgent order
}
#[Mapper(prefix: 'user', middleware: ['auth'])]
class UserController extends Controller
{
#[Route(
uri: '/{user}', methods: ['GET'], name: 'user',
middleware: ['is_permitted'],
domain: '{tenant}.app.com'
)]
public function show(#[Model] ?User $user, string $tenant) {}
}
use Phaseolies\Support\Facades\Route;
Route::group(['prefix' => 'api'], function () {
Route::bundle('users', UserController::class);
Route::post('login', [AuthController::class, 'login']);
});
#[Route(uri: '/dashboard', domain: '{tenant}.app.com')]
#[Middleware([TenantMiddleware::class])]
public function dashboard(string $tenant, TenantService $tenant)
{
$settings = $tenant->getTenantSettings($tenant);
return view('tenant.dashboard', compact('settings'));
}
class PostController extends Controller
{
public function __construct(
#[Bind(PostRepository::class)] private PostRepositoryInterface $post
) {}
#[Route('/')]
public function __invoke()
{
return $this->post->all();
}
}
#[Route('/process')]
public function process(
#[Bind(AnotherConcrete::class)] AnotherAbstract $repo
) {
return $repo->execute();
}
$this->app->bind(PaymentInterface::class, StripeProcessor::class);
public function charge(PaymentInterface $processor)
{
}
class PaymentController extends Controller
{
#[Transaction]
#[Route('payment', methods: ['POST'])]
public function __invoke()
{
// Automatically wrapped in a DB transaction
}
}
#[Transaction(attempts: 3, connection: 'mysql')]
public function checkout()
{
$order = $this->createOrder();
$this->processPayment($order);
}
use Phaseolies\Support\Facades\DB;
DB::transaction(function () {
// Complex operations with manual control
});
namespace App\Models;
use App\Watchers\EmployeeStatusWatcher;
use Phaseolies\Database\Entity\Attributes\Watches;
use Phaseolies\Database\Entity\Model;
class Employee extends Model
{
#[Watches(EmployeeStatusWatcher::class)]
protected bool $status;
}
// Watcher
namespace App\Watchers;
use Phaseolies\Database\Entity\Model;
class EmployeeStatusWatcher
{
/**
* Handle the watched property change.
*
* @param mixed $old
* @param mixed $new
* @param Model $model
* @return void
*/
public function handle(mixed $old, mixed $new, Model $model): void
{
info("Employee status changed from '{$old}' to '{$new}' for employee ID: {$model->id}");
}
}
namespace App\Models;
use Phaseolies\Database\Entity\Attributes\Hook;
class Post extends Model
{
#[Hook('before_created')]
public function generateSlug(): void
{
$this->slug = str()->slug($this->title);
}
#[Hook('after_created')]
public function notifySubscribers(): void
{
(new NotifySubscribersJob($this->id))->dispatch();
}
}
#[Queueable(tries: 3, retryAfter: 10, delayFor: 300)]
class SendWelcomeEmailJob extends Job
{
public function __construct(private User $user) {}
public function handle(): void
{
Mail::to($this->user->email)->send(new WelcomeEmail($this->user));
}
}
use Doppar\Queue\Drain;
Drain::conduct([
new Job1(),
new Job2(),
new Job3()
])
->onQueue('priority')
->delayFor(60)
->then(fn() => echo "Done!")
->catch(fn($job, $ex, $index) => Log::error($ex))
->dispatch();
namespace App\Models;
use Phaseolies\Database\Entity\Model;
use Phaseolies\Database\Temporal\Attributes\Temporal;
#[Temporal]
class Contract extends Model
{
protected $creatable = ['title', 'amount', 'client_id'];
}
User::embed([
'posts' => fn($q) => $q->newest()->limit(5),
'profile.address',
'roles.permissions',
])->get();
public function __published($query)
{
return $query->where('status', 'published');
}
$posts = Post::published()->get();
$schedule->command('sync:data')
->atSeconds([0, 15, 30, 45])
->noOverlap();
# Start daemon
php pool cron:run --daemon
php pool cron:daemon start
$schedule->command('health:check')->everySecond();
$schedule->command('data:sync')->throttle('3/1d');
Packages
Doppar ships with elegant solutions for the features modern web apps demand. Our first-party packages handle the hard parts, so you don't have to reinvent the wheel.
Interface & realtime
AI & search
Background work
Auth & security
Tooling
RippleNew
Reactive interfaces from PHP components, without a JavaScript front end.
composer require doppar/rippleuse App\Models\Post;
use Doppar\Ripple\Attributes\Invokable;
use Doppar\Ripple\Attributes\QueryString;
use Doppar\Ripple\Component;
class SearchPosts extends Component
{
#[QueryString]
public string $q = '';
#[Invokable]
public function clear(): void
{
$this->q = '';
}
public function render(): mixed
{
return view('ripple.search-posts', [
'posts' => Post::where('title', 'LIKE', "%{$this->q}%")->limit(8)->get(),
]);
}
}
<div>
<input type="search" ripple:bind.live.debounce.300="q" placeholder="Search posts">
<button type="button" ripple:call="clear">Clear</button>
<ul>
#foreach ($posts as $post)
<li>[[ $post->title ]]</li>
#endforeach
</ul>
</div>
Airbend
Broadcast events to connected clients over WebSockets.
composer require doppar/airbenduse App\Events\OrderShippedEvent;
use App\Models\Order;
use Doppar\Airbend\Support\Facades\Broadcast;
class OrderController extends Controller
{
public function shipOrder(Request $request, int $orderId)
{
$order = Order::find($orderId);
// Your order shipping logic here
Broadcast::event(new OrderShippedEvent($order));
}
}
AI
Self-hosted LLMs or OpenAI through one fluent Agent API.
composer require doppar/aiuse Doppar\AI\Agent;
use Doppar\AI\AgentFactory\Agent\OpenAI;
class ChatController extends Controller
{
public function reply(Request $request)
{
$response = Agent::using(OpenAI::class)
->withKey(env('OPENAI_API_KEY'))
->model('gpt-4')
->prompt($request->input('message'))
->send();
return response()->json(['reply' => $response]);
}
}
Embeds
Attribute-driven semantic search for your models.
composer require doppar/embedsuse Doppar\Embeds\Attributes\Embeds;
use Doppar\Embeds\Concerns\Embeddable;
class Product extends Model
{
use Embeddable;
#[Embeds]
protected $description;
}
class ProductController extends Controller
{
public function search(Request $request)
{
return Product::whereSimilarTo(
'description',
$request->input('q'),
limit: 10
);
}
}
Bloom
Check probable set membership without hitting your database.
composer require doppar/bloomuse Doppar\Bloom\Facades\Bloom;
class RegisterController extends Controller
{
public function store(Request $request)
{
$email = $request->input('email');
if (Bloom::key('email')->has($email)) {
return back()->withErrors(['email' => 'Email probably already registered.']);
}
// Continue registration, then remember the email
Bloom::key('email')->add($email);
}
}
Queue
Dispatch jobs off the request cycle with automatic retries.
composer require doppar/queueuse App\Jobs\SendWelcomeEmailJob;
class RegisterController extends Controller
{
public function store(Request $request)
{
$user = User::create($request->validated());
(new SendWelcomeEmailJob($user))->dispatch();
return redirect('/dashboard');
}
}
Notifier
Send one notification class across email, SMS, and in-app.
composer require doppar/notifieruse App\Notifications\OrderShippedNotification;
class OrderController extends Controller
{
public function ship(Order $order)
{
$order->markAsShipped();
$order->customer->notify(new OrderShippedNotification($order));
return redirect()->back();
}
}
Orion
Run shell commands through a clean, chainable facade.
composer require doppar/orionuse Doppar\Orion\Support\Facades\Process;
class DeployController extends Controller
{
public function status()
{
$result = Process::ping('git rev-parse HEAD')->execute();
return response()->json([
'commit' => trim($result->getOutput()),
]);
}
}
Guard
Define abilities once, check them anywhere.
composer require doppar/guarduse Doppar\Authorizer\Support\Facades\Guard;
class SettingsController extends Controller
{
public function update(Request $request)
{
if (Guard::denies('edit-settings')) {
abort(403);
}
// Update settings
}
}
Flarion
Bearer-token API authentication in one trait.
composer require doppar/flarionuse Phaseolies\Support\Router\Attributes\Route;
class ProductController extends Controller
{
#[Route(uri: 'store/product', middleware: ['auth-api'])]
public function store(Request $request)
{
// Only reachable with a valid Bearer token
}
}
OAuthic
Social sign-in via GitHub, Google, LinkedIn, and more.
composer require doppar/oauthicuse Doppar\OAuthic\OAuthic;
use Phaseolies\Support\Facades\Auth;
use Phaseolies\Support\Router\Attributes\Route;
class OAuthController extends Controller
{
#[Route(uri: 'redirect', name: 'oauth.redirect')]
public function redirect()
{
return redirect(OAuthic::driver('github')->redirect());
}
#[Route(uri: 'callback', name: 'oauth.callback')]
public function callback()
{
$provider = OAuthic::driver('github')->user();
// Save or update the user, then log them in
Auth::login($user);
}
}
Insight
Local debugging and request-history dashboard, no third-party service.
composer require doppar/insightuse Doppar\Insight\ErrorHistoryRecorder;
class BeforeExceptionHandler
{
/**
* Runs before the application handles an uncaught exception,
* recording it so it shows up on the Insight dashboard.
*/
public function handle(Throwable $throwable): void
{
app(ErrorHistoryRecorder::class)->record($throwable);
}
}
Axios
Fluent, chainable HTTP client.
composer require doppar/axiosuse Doppar\Axios\Http\Axios;
class WeatherController extends Controller
{
public function forecast(string $city)
{
$data = Axios::to("https://api.weather.com/v1/{$city}")
->get()
->json();
return response()->json($data);
}
}
Twig Bridge
Render Twig templates alongside your Odo views.
composer require doppar/twig-bridgeuse Phaseolies\Http\Response;
use Phaseolies\Support\Router\Attributes\Route;
class WelcomeController extends Controller
{
#[Route(uri: '/', name: 'home')]
public function welcome(): Response
{
return view('hello.html.twig', ['name' => 'MyName']);
}
}
Doppar Insight
Trace the current request, compare it with recent traffic, and surface slow routes, failing endpoints, exceptions, cache activity, SQL timing, JSON responses, and request history from one focused local workspace.
- 1Cross-request visibility turns Overview and History into a live traffic dashboard with request volume, latency bands, error spikes, route search, and time filters.
- 2Current-request deep dive keeps HTTP, database, cache, auth, request, response, performance, session, logs, and JSON API one click away from the same panel.
The documentation you're reading right now is built with Doppar.
Every route, every rendered page, every query — this entire site runs on the very framework it documents. A real production application.
Build Yours