1. Go to this page and download the library: Download internetguru/laravel-common 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/ */
internetguru / laravel-common example snippets
use Illuminate\Support\Facades\Facade;
'aliases' => Facade::defaultAliases()->merge([
'Helpers' => InternetGuru\LaravelCommon\Support\Helpers::class,
])->toArray(),
use Illuminate\Support\ServiceProvider;
'providers' => ServiceProvider::defaultProviders()->replace([
Illuminate\Translation\TranslationServiceProvider::class => InternetGuru\LaravelCommon\TranslationServiceProvider::class,
])->toArray(),
use Illuminate\Database\Eloquent\Model;
use InternetGuru\LaravelCommon\Casts\CarbonIntervalCast;
class Task extends Model
{
protected $casts = [
'duration' => CarbonIntervalCast::class,
];
}
Route::get('/', function () {
// ...
})->name('home');
Route::get('/products', function () {
// ...
})->name('products.index');
Route::get('/products/{product}', function ($product) {
// ...
})->name('products.show');