This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (0.0.1) of this package.

Data Repositories for Foodsharing Laravel Projects

0.0.1 2017-06-17 11:29 UTC

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

  1. Go into your Foodsharing laravel Project and add tht requires composer package
$ composer require foodsharing/data "dev-master"
  1. register Laravel Service Provider in "config/app.php".
    'providers' => [
    // ...
    Foodsharing\Data\DataServiceProvider::class,
    // ...
  1. 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
	]);

    }
}