Componette

Componette

ging-dev

ging-dev / nette-eloquent

💡 Eloquent Bridge for Nette Framework

download-cloud-line composer require ging-dev/nette-eloquent

Nette-eloquent

Eloquent Bridge for Nette Framework

StyleCI

Installation

composer require ging-dev/nette-eloquent

Configuration

extensions:
    eloquent: Gingdev\NetteExtension\EloquentExtension


eloquent:
    driver: sqlite
    database: %appDir%/database.db

Example

<?php

declare(strict_types=1);

namespace App\Presenters;

use Illuminate\Database\Connection;
use Nette;


final class HomepagePresenter extends Nette\Application\UI\Presenter
{
    /** @var Connection */
    protected $database;

    public function injectDatabase(Connection $database) {
        $this->database = $database;
    }

    public function actionDefault()
    {
        $this->database->getSchemaBuilder()->drop('users');
        $this->database->getSchemaBuilder()->create('users', function ($table) {
            $table->increments('id');
            $table->string('name')->unique();
        });
        $this->database->table('users')->select('*')
            ->where('name', 'gingdev')
            ->get();
    }
}

No release at this moment. Try to create first one.

bar-chart-fill

Statistics

download-cloud-fill
16
star-fill
4
bug-fill
0
flashlight-fill
28d
price-tag-2-line

Badges

guide-fill

Dependencies

Componette Componette felix@nette.org