[[oktatas:web:composer|< Composer]] ====== Composer illuminate/database ====== * **Szerző:** Sallai András * Copyright (c) Sallai András, 2021 * Licenc: [[https://creativecommons.org/licenses/by-sa/4.0/|CC Attribution-Share Alike 4.0 International]] * Web: https://szit.hu ===== Illuminate/Database ===== A Laravel Illuminate/Database komponense használható a Laraveltől függetlenül is. ===== Telepítés ===== composer require illuminate/events composer require illuminate/database ===== Példaprogram ===== addConnection([ 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'triangle', 'username' => 'triangle', 'password' => 'titok', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ]); $capsule->setEventDispatcher(new Dispatcher(new Container)); $capsule->setAsGlobal(); $capsule->bootEloquent(); echo Capsule::table('areas')->where('id', 1)->get(); echo Capsule::table('areas')->get(); Capsule::table('areas')->insert(['area' => 400]); ===== Forrás ===== * https://packagist.org/packages/illuminate/database * https://github.com/mattstauffer/Torch/tree/master/components/database * https://laravel.com/docs/8.x/queries * Ami a Laravel dokumentációban DB itt Capsule