All Projects → uepg → laravel-sybase

uepg / laravel-sybase

Licence: GPL-2.0 license
Connection and Laravel Eloquent driver for Sybase

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-sybase

Rdbc
Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers
Stars: ✭ 328 (+1031.03%)
Mutual labels:  odbc, driver
LaraPersonate
Login as a different user quickly
Stars: ✭ 121 (+317.24%)
Mutual labels:  eloquent, laravel-package
Laravel-Auto-Hard-Deleter
Laravel and Lumen Auto Hard Deleter
Stars: ✭ 34 (+17.24%)
Mutual labels:  eloquent, laravel-package
Jwt Auth Guard
JWT Auth Guard for Laravel and Lumen Frameworks.
Stars: ✭ 319 (+1000%)
Mutual labels:  driver, laravel-package
Eloquent Approval
Approval process for Laravel Eloquent models
Stars: ✭ 79 (+172.41%)
Mutual labels:  eloquent, laravel-package
laravel-db2
laravel-db2 is a simple DB2 service provider for Laravel. It provides DB2 Connection by extending the Illuminate Database component of the laravel framework.
Stars: ✭ 56 (+93.1%)
Mutual labels:  odbc, driver
query-filter
Define filters for your Eloquent models based on your request
Stars: ✭ 20 (-31.03%)
Mutual labels:  eloquent, laravel-package
Laravel Shopify
A full-featured Laravel package for aiding in Shopify App development
Stars: ✭ 634 (+2086.21%)
Mutual labels:  driver, laravel-package
Laravel Schedulable
Schedule and unschedule eloquent models elegantly without cron jobs
Stars: ✭ 78 (+168.97%)
Mutual labels:  eloquent, laravel-package
Eloquent Ldap
A Laravel 5.1 package that first tries to log the user against the internal database if that fails, it tries against the configured LDAP/AD server.
Stars: ✭ 19 (-34.48%)
Mutual labels:  eloquent, laravel-package
eloquent-repository
Repository pattern for Eloquent ORM with focus in cache.
Stars: ✭ 30 (+3.45%)
Mutual labels:  eloquent, laravel-package
Laravel Deletable
👾 Gracefully restrict deletion of Laravel Eloquent models
Stars: ✭ 137 (+372.41%)
Mutual labels:  eloquent, laravel-package
Simple Cache
An easy to use Caching trait for Laravel's Eloquent Models.
Stars: ✭ 19 (-34.48%)
Mutual labels:  eloquent, laravel-package
Eloquent Relativity
Allows you to decouple your eloquent models from one another.
Stars: ✭ 112 (+286.21%)
Mutual labels:  eloquent, laravel-package
Blogetc
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.
Stars: ✭ 198 (+582.76%)
Mutual labels:  eloquent, laravel-package
pushbullet
Pushbullet notifications channel for Laravel
Stars: ✭ 14 (-51.72%)
Mutual labels:  laravel-package
laravel-cachable-attributes
Allows to cache attribute accessor values in an easy way.
Stars: ✭ 24 (-17.24%)
Mutual labels:  eloquent
mongosh
The MongoDB Shell
Stars: ✭ 215 (+641.38%)
Mutual labels:  driver
dev twitter
A module to make the /dev/twitter
Stars: ✭ 72 (+148.28%)
Mutual labels:  driver
airbrake-laravel
Laravel package for the Airbrake API, which supports Errbit
Stars: ✭ 16 (-44.83%)
Mutual labels:  laravel-package

Sybase ASE based Eloquent module extension for Laravel

Packagist Version PHP from Packagist Packagist GitHub contributors GitHub

  • Enables use of multiple kinds of fields.
  • Use default eloquent: works with odbc and dblib!
  • Migrations! (WIP - Work in Progress)

Install

Add the following in the require section of your composer.json:

Laravel 5.1, 5.2, 5.3

"uepg/laravel-sybase": "~1.0"

Laravel 5.4, 5.5, 5.6, 5.7, 5.8, 6.x, 7.x, 8.x, 9.x

"uepg/laravel-sybase": "~2.0"

Update the package dependencies executing:

composer update

Add the following entry to your providers array in config/app.php file, optional in Laravel 5.5 or above:

Uepg\LaravelSybase\SybaseServiceProvider::class,

Add the following entry to your aliases array in config/app.php file, optional in Laravel 5.5 or above:

'UepgBlueprint' => Uepg\LaravelSybase\Database\Schema\Blueprint::class,

Update your config/database.php's default driver with the settings for the sybase or your custom odbc. See the following example:

<?php

...

return [
    ...

    'connections' => [
        ...

        'sybase' => [
            'driver' => 'sqlsrv',
            'host' => env('DB_HOST', 'sybase.myserver.com'),
            'port' => env('DB_PORT', '5000'),
            'database' => env('DB_DATABASE', 'mydatabase'),
            'username' => env('DB_USERNAME', 'user'),
            'password' => env('DB_PASSWORD', 'password'),
            'charset' => 'utf8',
            'prefix' => '',
        ],

        ...
    ],

    ...
]

Update your .env with the settings for the sybase or your custom odbc. See the following example:

...

DB_CONNECTION=sybase
DB_HOST=sybase.myserver.com
DB_PORT=5000
DB_DATABASE=mydatabase
DB_USERNAME=user
DB_PASSWORD=password

...

Configuration of freetds driver

In Linux systems the driver version must be set in freetds.conf file to the right use of charset pages.

The file is usualy found in /etc/freetds/freetds.conf. Set the configuration at global section as the following example:

[global]
    # TDS protocol version
    tds version = 5.0

Setting to use numeric data type

In the migration file you must replace use Illuminate\Database\Schema\Blueprint; with use Uepg\LaravelSybase\Database\Schema\Blueprint;. See the following example:

<?php

use Illuminate\Support\Facades\Schema;
// use Illuminate\Database\Schema\Blueprint;
use Uepg\LaravelSybase\Database\Schema\Blueprint; // or "use UepgBlueprint as Blueprint"
use Illuminate\Database\Migrations\Migration;

class CreateTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('table_name', function (Blueprint $table) {
            $table->numeric('column_name', length, autoIncrement);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('table_name');
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].