1. Go to this page and download the library: Download patrixsmart/adjustfly library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
patrixsmart / adjustfly example snippets
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Adjustment Routes
|--------------------------------------------------------------------------
|
*/
Route::group([
'namespace' => 'Patrixsmart\Adjustfly\Http\Controllers',
'prefix' => 'api'
], function () {
Route::apiResource('adjustments','AdjustmentController')->only(['index','show']);
});
/**
* http://yourdomain.com/adjustments to get all adjustments with pagination
*/
/**
* http://yourdomain.com/adjustments/{adjustment_id} to see details of an adjustment made with
* the current state of the adjustable model.
*/
use Patrixsmart\Adjustfly\Traits\HasAdjustments;
class ModelClass extends Model
{
use HasAdjustments;
// This exposes this methods to the model
// ModelClass->recordAdjustment() and ModelClass->adjustments()
}
use Patrixsmart\Adjustfly\Traits\OwnedAdjustments;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use OwnedAdjustments;
// This exposes this method to the model
// UserClass->ownedAdjustments()
}
sh
php artisan vendor:publish --tag="adjustfly-config"
sh
php artisan migrate
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.