This is a repository that allows to developers, to works with Laravel bare minimum requirements. The repository got updates if a new need is identified.
The compose.yaml, contains the next containers:
(automakes the projects if not exists and have 5 php threads).
Note
More information about the container of Laravel laravel-docker Configuration about php.ini and initial config of Laravel laravel-config
Note
More information about the interoperability of Laravel and PostgreSQL laravel-postgress Configuration about php.ini and initial config of Laravel laravel-config Aditional packages installed and required: php-pgsql
php artisan migrate
use Illuminate\Support\Facades\DB;
// Test database connection
try {
DB::connection()->getPdo();
} catch (\Exception $e) {
die("Could not connect to the database. Please check your configuration. error:" . $e );
}
Note
Redis configuration in this link redis-config
In the path routes/web.php
We can run the Cache::remember() function to get an 1. To get values from the cache.
Route::get('my-first-route', function()
{
$value = Cache::remember('users', 1000, function () {
return 1;
});
return 'Hello World!'.$value;
});
Added support to composer get Livewire blades. To fast deploy webs.
Note
Livewire configuration in this link Livewire
To deploy a new Livewire.
php artisan make:livewire class name
This makes:
- app/Livewire/Class.php
- resources/views/livewire/class.blade.php
Make in that order
- Controller
php artisan make:controller ClassController
- Make the Components (Views)
php artisan make:livewire class name
- In the controller put the next :
use Illuminate\Support\Facades\App;
class MyController extends Controller
{
public function index()
{
return App::call(MyLivewireComponent::class);
// OR
return view('livewire.livewire-component')
}
}
In web.php, this point to index.
use App\Http\Controllers\MyController;
Route::get('/controller', [MyController::class, 'index']);
- To make api routes in routes/api.php
https://laravel.com/docs/11.x/routing#api-routes
- To get the data paginated with eloquent resources
https://laravel.com/docs/11.x/eloquent-resources#concept-overview