1. Go to this page and download the library: Download marceloxp/laravel8 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/ */
return Result::success('Dados cadastrados com sucesso.');
return Result::success('Dados cadastrados com sucesso.', ['id': 396]);
return Result::error('Ocorreu um erro na gravação do registro');
return Result::cached('', { 'id': 1, 'uf': 'sp' });
return Result::undefined(); // Ocorreu um erro na solicitação.
return Result::invalid(); // Entrada de dados inválida.
return Result::exception($e); // Ocorreu um erro na solicitação.
RouteLang::lang(); // returns current language, string empty if is default language (pt-br). Ex.: ''
RouteLang::lang('pt-br'); // returns current language, string empty if is default language. Ex.: ''
RouteLang::lang('en'); // returns current language, string empty if is default language. Ex.: 'en'
RouteLang::root(); // returns current site root language
RouteLang::rootUrl(); // returns current site full root url language
RouteLang::rootUrl('en'); // returns full root url to language [enb]
RouteLang::prefix('/sobre'); // Translate prefix to current language
RouteLang::route($route, '/empresa'); // Translate url route to current language
RouteLang::getDefaultLocale(); // Returns app default locale config
RouteLang::getCurrentLocale(); // Returns app current locale config (dynamic)
echo db_database_name(); // Returns current database name
echo db_prefix(); // Returns current database prefix tables
echo db_comment_table('table_name', 'comment_table'); // Define table comment
echo db_get_comment_table('table_name'); // Returns table comment
echo db_get_pivot_table_name(['videos','tags'], true); // Returns pivot table name (Ex: blp_tag_video)
echo db_get_pivot_scope_name([Model1, Model2]); // Returns a pivot scope name (Ex: db_get_pivot_scope_name([Video::class, Tag::class]) => tagVideo)
echo db_get_primary_key('table_name'); // Returns id
echo db_get_name('table_name', 10); // Returns `name` field value
echo db_model_to_table_name('City'); // Returns table name from model name => cities
echo db_table_name_to_model('cities'); // Returns model name from table name => City
echo db_table_name_to_field_id('cities'); // Returns relative field id to another table => city_id
echo db_trim_table_prefix('blp_cities'); // Returns table name without database table prefix => cities
echo db_prefixed_table('cities'); // Returns table with database table prefix => blp_cities
echo db_table_exists('cities'); // Returns if table exists in database
app_version('0.0.3')
// returns version value from config/app.php or default.