PHP code example of phpdominicana / lightwave

1. Go to this page and download the library: Download phpdominicana/lightwave 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/ */

    

phpdominicana / lightwave example snippets


$app->get('hello', new Route('/hello/{name}', ['_controller' => [HelloController::class, 'index']]));
$app->get('home',
            new Route(
                '/',
                [
                    '_controller' => [HomeController::class, 'index'],
                    'container' => new Psr11Container($app->getInjector())
                ]
            )
        );
$app->post('create_user',
            new Route(
                '/users',
                [
                    '_controller' => [UserController::class, 'store'],
                    'container' => new Psr11Container($app->getInjector())
                ]
            )
        );

'providers' => [
        \Phpdominicana\Lightwave\Providers\AppServiceProvider::class,
       \Phpdominicana\Lightwave\Providers\TwigServiceProvider::class,
         \Phpdominicana\Lightwave\Providers\RouteServiceProvider::class,
         \Phpdominicana\Lightwave\Providers\EloquentServiceProvider::class
    ],


 
namespace Phpdominicana\Lightwave\Models;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    protected $table = 'users';
    protected $fillable = ['name', 'email', 'password'];
}