PHP code example of tommyys / laravel_library

1. Go to this page and download the library: Download tommyys/laravel_library 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/ */

    

tommyys / laravel_library example snippets


'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    Intervention\Image\ImageServiceProvider::class,
    // ...
],

'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
      'Image' => Intervention\Image\Facades\Image::class,
    // ...
  ],

...
use Axstarzy\LaravelLibrary\ActionLog;
use Axstarzy\LaravelLibrary\ErrorLog;
use Axstarzy\LaravelLibrary\Telegram;
...

//create new action log
$log = ActionLog::createRecord($request, $user); //$user is optional, if variable not passed it will use auth()->user() by default

//check time gap between last request
$gap = ActionLog::check30sGap($request);

class TestController extends Controller
{
  public function foo(){
    sqlLog(ActionLog::where('user_id', 1));
  }
}

<span class="m-menu__link-text">
  {{trans('string.Stock')}}
</span>

<span class="m-menu__link-text">
  Stock
</span>

$userID = 123;
sqlLog(ActionLog::where('user_id', $userID));

echo roundDownDecimal(200.1779, 2); #returns 200.17
echo roundDownDecimal(200.175,2); #returns 200.17
echo roundDownDecimal(200.172,2); #returns 200.17