2017 © Pedro Peláez
 

library podata-laravel

Expose Odata services from laravel

image

algo-web/podata-laravel

Expose Odata services from laravel

  • Thursday, July 19, 2018
  • by c-harris
  • Repository
  • 3 Watchers
  • 11 Stars
  • 1,468 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 7 Open issues
  • 14 Versions
  • 4 % Grown

The README.md

Build Status Scrutinizer Code Quality Coverage Status Latest Stable Version Latest Unstable Version Total Downloads Monthly Downloads Daily Downloads, (*1)

POData-Laravel

Composer Package to provide Odata functionality to Laravel, (*2)

  • PHP 5.6 support has been dropped *

To install, run, (*3)

composer require algo-web/podata-laravel

Edit config/app.php and add this to providers section:, (*4)

AlgoWeb\PODataLaravel\Providers\MetadataProvider::class,
AlgoWeb\PODataLaravel\Providers\MetadataRouteProvider::class,
AlgoWeb\PODataLaravel\Providers\QueryProvider::class,
AlgoWeb\PODataLaravel\Providers\MetadataControllerProvider::class,

You then add the trait to the models you want to expose., (*5)

    use \AlgoWeb\PODataLaravel\Models\MetadataTrait;

By default, following Laravel convention, POData-Laravel pluralises the model names to use as endpoints. That's an implementation choice in POData-Laravel, not anything intrinsic to OData itself., (*6)

Eg, for User model, all else equal:, (*7)

    /odata.svc/Users

If you have just installed the package and have trouble reaching your models' endpoints, try setting APP_DISABLE_AUTH=true in your project's .env file temporarily, and then try reaching those endpoints again., (*8)

-- Known Limitations --, (*9)

  • Cannot expose two models with the same class name in different namespaces - trying to expose both App\Foo\Model and App\Bar\Model will trip an exception complaining that resource set has already been added.
  • This can be worked around by setting a custom endpoint name on one of the colliding models.
  • Controller input parameters map 'id' to underlying model's primary key
  • Assumes autoloader has been optimised with composer -o dump-autoload.

-- Configuration options -- These need to go in your Laravel project's .env file., (*10)

  • APP_METADATA_CACHING - Whether or not to turn model metadata caching on
  • APP_METADATA_CACHE_DURATION - If caching, how long (in minutes) to retain cached metadata
  • APP_DISABLE_AUTH - Disable authentication (boolean)
  • APP_DRY_RUN - Roll back DB changes unconditionally (boolean)

Contributing

See CONTRIBUTING.md for the details., (*11)

Features Supported

(thanks to @renanwilliam for the initial version of this list), (*12)

  • [ ] Full CRUD Support
  • [x] $count
  • [x] $filter
    • [x] Comparison Operators
    • [x] eq
    • [x] ne
    • [x] lt
    • [x] le
    • [x] gt
    • [x] ge
    • [x] Logical Operators
    • [x] and
    • [x] or
    • [x] not
    • [x] Comparison Operators
    • [x] has
    • [x] String Functions
    • [x] indexof
    • [x] contains
    • [x] endswith
    • [x] startswith
    • [x] length
    • [x] substring
    • [x] tolower
    • [x] toupper
    • [x] trim
    • [x] concat
    • [x] Arithmetic Operators
    • [x] add
    • [x] sub
    • [x] mul
    • [x] div
    • [x] mod
    • [x] Date Functions
    • [x] year
    • [x] month
    • [x] day
    • [x] hour
    • [x] minute
    • [x] second
    • [x] fractionalseconds
    • [x] date
    • [x] time
    • [x] totaloffsetminutes
    • [x] now
    • [x] mindatetime
    • [x] maxdatetime
    • [x] Math Functions
    • [x] round
    • [x] floor
    • [x] ceiling
  • [x] $select
  • [x] $top
  • [x] $skip
  • [x] $skiptoken
  • [x] $orderby
  • [x] $expand

The Versions

27/12 2016

v0.2.4

0.2.4.0

Expose Odata services from laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel services odata podata

25/12 2016

v0.2.3

0.2.3.0

Expose Odata services from laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel services odata podata

24/12 2016

v0.2.2

0.2.2.0

Expose Odata services from laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel services odata podata

24/12 2016

v0.2.1

0.2.1.0

Expose Odata services from laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel services odata podata

21/12 2016

v0.2.0

0.2.0.0

Expose Odata services from laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel services odata podata

04/11 2016

0.1.1

0.1.1.0

Expose Odata services from laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel services odata podata

03/11 2016

0.1.0

0.1.0.0

Expose Odata services from laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel services odata podata