Skip to content

AlexNguetcha/Larva

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Larva 1.5.1

What News?

  1. Larva console added ☺ you can now generate

[V 1.5.1]

  • Sql table creation code for a model
      //generate sql code
      php bin/larva make:sql model_name
  • CRUD routes with an API controller for a model
     //generate sql code
     php bin/larva make:api model_name

model,repository,controller,templates and launch project via command line :

//launch project
php -S 127.0.0.1:5000 -t public
//create a model, repo, controller and template in same command
php bin/larva make User
//create a model
php bin/larva make:model model_name
//create a repository
php bin/larva make:repository repo_name
//create a controller
php bin/larva make:controller controller_name
//create a template
php bin/larva make:template template_name
  1. Easy upload any file via Alpha:

what is Alpha?

Alpha is a larva component that help you for file uploading Example :

//....
class UploadController extends BaseController
{
    public function upload(Request $request): Render
    {
        //upload verification
        //....
        $alpha = new Alpha();
        $alpha->setRootPath("web/")
        ->setMaxFileSize(2*1024*1024)
        ->addFileExtension("png", "gif")
        ->addFileMimeType("image/png", "image/gif");
        //.....
        $alpha->uploadFile("new_filename", "custom/upload/directory")
    }
}

installation :

//install composer
composer dump-upload
//run project
php -S 127.0.0.1:8001 -t public

databse configuration

configure database in config/databse.json

{
    "hostname": "localhost",
    "dbname": "project1",
    "username": "root",
    "password": ""
}

PDOFactory :

PDOFactory::createTable(array $table) is used to create database tables.

$pdo = Database::getPDO();
$table = [];
$table[0] = "CREATE TABLE user .....";
//.......
$pdo->createTable($table);

About

Mini Framework de base PHP !

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages