foodsharing / data
Data Repositories for Foodsharing Laravel Projects
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:package
This package is not auto-updated.
Last update: 2020-01-24 16:52:18 UTC
README
This Repo will hold the whole Datalogic of Foodsharing in as a Laravel Package.
- Foodsaver
- Stores
- Teams...
- ...
Installation
- Go into your Foodsharing laravel Project and add tht requires composer package
$ composer require foodsharing/data "dev-master"
- register Laravel Service Provider in "config/app.php".
'providers' => [ // ... Foodsharing\Data\DataServiceProvider::class, // ...
- Ready! For mor read the Laravel Dokumentation.
Use Repository
To use an Repository fetch it in your Laravel Controller you have to add an constructor i.e.
... class StoreController extends Controller { private $repo_store; public function __construct(StoreRepo $store_repo) { $this->repo_store = $store_repo; } public function profile() { $store = $this->repo_store->find(123); return view('store',[ 'store' => $store ]); } }