PHP code example of quentingab / wodel

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

    

quentingab / wodel example snippets

 php
$posts = QuentinGgab\Models\Wodel::all();
foreach($posts as $post){
    echo $post->post_title;
}
 php
$post = QuentinGab\Models\Wodel::current();
 php
$post = QuentinGab\Models\Wodel::current();
$post->post_title = "Hello World";
$post->save();
 php
$post = new QuentinGab\Models\Wodel(
    [
    'post_title'=>'Hello World'
    ]
);
$post->save();
 php
$all = Event::all();
$only_active = Event::where(['active'=>true]);
$with_primary_key_1 = Event::find(1);