PHP code example of akaadream / extendedmodel

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

    

akaadream / extendedmodel example snippets


use \Akaadream\ExtendedModel\ExtendedModel;

class MyModel extends ExtendedModel
{
    //
}

// ...

public function store (Request $request)
{
    MyModel::createOrupdateWith(new MyModel, $request);
}

public function store (Request $request)
{
    $filename = "extendedmodelimage.png";
    // ... image upload

    MyModel::createOrUdateWith(new MyModel, $request, ['image' => $filename]);
}