Download the PHP package lexxsoft/odata without Composer

On this page you can find all versions of the php package lexxsoft/odata. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package odata

Laravel OData REST

Latest Stable Version GitHub Package validation status PHP Version Require License Total Downloads

Contents

Installation

Requirements

Component Version
PHP 8.1
Laravel 10.5

Setup

After installation all routes as /odata/* will be accessible

After that config/odata.php file will appear.

Update model requirements

To make model as OData entity, you must use Restable trait.

OData features

Data manipulations

Reading data

To read data, use GET request. Also, you can add parameters to your query from OData features section

Reading user with ID = 1

Updating data

To update data you should use PUT method. Then, fill request body by new data.

Request example:

Updating relations

To update Many-To-Many relationship, you need pass array of ID's for relation field name

Updating relations with pivot

Sometimes Many-To-Many table has additional fields. To update them, pass array of objects for relation field.

Note, key field is required.

Creating data

To create new record, use POST request type

Deleting data

To delete data, use DELETE request with record key

Using custom controller methods

OData plugin can make almost all CRUD operation automatically. But some cases should be operated individually. To make it real, OData plugin will search controller for model in path /app/Http/Controllers with filename pattern <Singular entity name>Controller.php. If controller file found, second step will be search corresponding method in class controller. Methods name are same as for resource controller. Use table below to check method name for yore case:

HTTP method Controller class method name
GET index
POST store
PUT update
PATCH update
DELETE destroy

As example, you have User model and UserController for it. But, when you make odata http request, you use plural name like /odata/users. Be carefully with this part.

Data validation rules

Operations like create or update should validate data, which comes from client. for this purpose ValidationRulesGenerator class is used. It generate validation rules only for Restable model, using database fields description. And, by default, it generate rules only for fillable fields.

Spatie laravel permissions

If you use laravel-permission from Spatie, then Rolemodel and Permission model not use Restable trait by default. To make them RESTable, you should create yore own models (for example, via php artisam make:model command) and extends yore new models from \Spatie\Permission\Models\* models


All versions of odata with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-dom Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lexxsoft/odata contains the following files

Loading the files please wait ....