Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

use illuminate component laravel outside laravel in any project

License

Notifications You must be signed in to change notification settings

OpenSID/bridge

 
 

Repository files navigation

Laravel Bridge

Installation

Add Presenter to your composer.json file:

"require": {
    "akas/laravel-bridge": "^2.0.0"
}

Require illuminate/translation when using Pagination.

Now, run a composer update on the command line from the root of your project:

composer update

NOTICE: NOT support Laravel 5.4.*

How to use

setup

use Akas\LaravelBridge\Laravel;

require __DIR__.'/vendor/autoload.php';

$connections = [
    'default' => [
        'driver'    => 'mysql',
        'host'      => 'localhost',
        'port'      => 3306,
        'database'  => 'forge',
        'username'  => 'forge',
        'password'  => '',
        'charset'   => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'    => '',
        'strict'    => false,
        'engine'    => null,
    ],
];

Laravel::run([
        'basePath' => FCPATH
    ])
    ->setupDatabase($connections);

eloquent

class User extends \Illuminate\Database\Eloquent\Model
{
    protected $fillable = [
       'name',
       'email',
       'password',
   ];
}

dd(User::all());

view

view.blade.php

@foreach ($rows as $row)
    {{ $row }};
@endforeach

view

echo View::make('view', ['rows' => [1, 2, 3]]);

Example

Laraigniter

About

use illuminate component laravel outside laravel in any project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 93.5%
  • Blade 4.6%
  • JavaScript 1.9%