recca0120 / laravel-bridge
use laravel eloquent, view, pagination anywhere
v1.1.0
2019-06-13 16:02 UTC
Requires
- php: >=5.5.9
- illuminate/container: ^5.2
- illuminate/database: ^5.2
- illuminate/events: ^5.2
- illuminate/filesystem: ^5.2
- illuminate/http: ^5.2
- illuminate/pagination: ^5.2
- illuminate/support: ^5.2
- illuminate/view: ^5.2
- psr/container: ^1.0
- recca0120/laravel-tracy: ^1.5
Requires (Dev)
- illuminate/translation: ^5.2
- mockery/mockery: ~0.9.2
- nesbot/carbon: ~1.20
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ^4 | ^5 | ^6
- psy/psysh: ^0.9.9
- squizlabs/php_codesniffer: ^3.4
Conflicts
- illuminate/contracts: 5.3.* | 5.4.*
This package is auto-updated.
Last update: 2024-10-05 15:14:17 UTC
README
Installation
Add Presenter to your composer.json file:
"require": { "recca0120/laravel-bridge": "^1.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 Recca0120\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::instance() ->setupView(__DIR__.'/views/', __DIR__.'/views/cache/compiled/') ->setupDatabase($connections) ->setupPagination() ->setupTracy([ 'showBar' => true ]);
eloquent
class User extends \Illuminate\Database\Eloquent\Model { protected $fillable = [ 'name', 'email', 'password', ]; } var_dump(User::all());
view
view.blade.php
@foreach ($rows as $row) {{ $row }}; @endforeach
view
echo View::make('view', ['rows' => [1, 2, 3]]);