Skip to content

This are a repository to templating the Laravel Projects with clonning or forking.

Notifications You must be signed in to change notification settings

lovelace9981/laravelPlayground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Laravel Playground

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:

Laravel Bitnami

(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

PostgreSQL, the most potent RDBMS of the Open Source World.

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

Upstart the DB

php artisan migrate

How to check the status of the RDBMS

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 );
}

Redis, the Caching key value.

Note

Redis configuration in this link redis-config

How to check the status of Redis

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;
});

Livewire

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

Recommendations

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']);

API

  • 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

About

This are a repository to templating the Laravel Projects with clonning or forking.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published