PHP code example of recca0120 / laraigniter

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

    

recca0120 / laraigniter example snippets


$db['default']['hostname'] = 'your hostname';
$db['default']['username'] = 'your username';
$db['default']['password'] = 'your password';
$db['default']['database'] = 'your test';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = true;
$db['default']['db_debug'] = true;
$db['default']['cache_on'] = false;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = true;
$db['default']['stricton'] = false;

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

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

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

use App\Models\User;

class Welcome extends CI_Controller
{
    public function index()
    {
        User::create([
            'name'     => 'test'.uniqid(),
            'email'    => 'test'.uniqid().'@test.com',
            'password' => md5('test'.uniqid()),
        ]);

        $users = User::paginate(5);
        $this->output->set_output(View::make('users', compact('users')));
    }
}