/LaravelSAPModels

This package creates SAP database models.

Primary LanguagePHPMIT LicenseMIT

This package is in production PLEASE DO NOT USE WIP.

This package create SAP Models in Laravel app.

Latest Version on Packagist Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Installation

You can install the package via composer:

composer require alixcan/laravelsapmodels

Publish the config file with:

php artisan vendor:publish --tag="laravelsapmodels-config"

This is the contents of the published config file:

return [
    'driver' => env('SAP_DATABASE_DRIVER', 'SAP'),
];

Edit config/database.php file

 'connections' => [
    ...
        'sapConnectionDriver' => [
                'driver' => 'sqlsrv',
                'url' => env('DATABASE_URL'),
                'port' => 1433,
                'database' => env('SAP_DATABASE_DATABASE'),
                'username' => env('SAP_DATABASE_USERNAME'),
                'password' => env('SAP_DATABASE_PASSWORD'),
                'charset' => 'utf8',
                'prefix' => '',
                'prefix_indexes' => true,
                //'read' => [
                //    'host' => env('SAP_DATABASE_HOST'),
                //],
                //'write' => [
                //    'host' => env('SAP_DATABASE_HOST'),
                //]
                'host' => env('SAP_DATABASE_HOST'),
                //'encrypt' => 'yes', // alternatively, defer to an env variable
                //'trust_server_certificate' => 'true', // alternatively, defer to an env variable
        
            ],
    ...
],

Create your .env variables

SAP_DATABASE_DRIVER=
SAP_DATABASE_DATABASE=
SAP_DATABASE_USERNAME=
SAP_DATABASE_PASSWORD=
SAP_DATABASE_HOST=

You can publish and use the models with:

 php artisan laravelsapmodels:generate --module=HumanResources

Aviable Modules

  • HumanResources
  • MRP
  • Reports
  • SalesOpportunities
  • Banking
  • Finance
  • General
  • Service
  • Business Partners
  • Inventory and Production
  • Marketing Documents
  • Administration
  • all

Usage

return \App\Models\SAP\HumanResources\OHTR::all();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.