PHP code example of ug-code / laranova
1. Go to this page and download the library: Download ug-code/laranova 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/ */
ug-code / laranova example snippets
// config/laranova.php
return [
'default_headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'auto_content_type' => true, // Auto-add Content-Type for body requests
'faker' => [
'locale' => env('LARANOVA_FAKER_LOCALE', 'en_US'),
],
'http' => [
'timeout' => env('LARANOVA_HTTP_TIMEOUT', 30),
'connect_timeout' => env('LARANOVA_HTTP_CONNECT_TIMEOUT', 10),
],
'history' => [
'max_items' => env('LARANOVA_HISTORY_MAX', 100),
],
'routes' => [
'exclude_prefixes' => [
'laranova', '_debugbar', '_ignition', 'telescope', 'sanctum',
],
],
'security' => [
'type' => env('LARANOVA_SECURITY_TYPE', 'bearer'), // null, bearer, basic, apikey
'name' => env('LARANOVA_SECURITY_NAME', 'api_key'),
'position' => env('LARANOVA_SECURITY_POSITION', 'header'),
],
'default_variables' => [
'baseUrl' => env('LARANOVA_DEFAULT_BASE_URL', 'http://pinsever.test'),
'bearerToken' => '',
],
];
bash
# config/app.php
'providers' => [
// ...
\Laranova\LaranovaServiceProvider::class,
],
bash
php artisan vendor:publish --tag=laranova-config
bash
php artisan vendor:publish --tag=laranova-views