PHP code example of psamatt / spot-service-provider

1. Go to this page and download the library: Download psamatt/spot-service-provider 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/ */

    

psamatt / spot-service-provider example snippets


$app->register(
    new Psamatt\Silex\SpotServiceProvider('mysql://username:password@localhost/db_name')
);

// Find all the posts from the database where the status is 1
$app['spot']->all('Entity\Post', array('status' => 1));
    
// Find one post where the title is Test Post
$app['spot']->first('Entity\Post', array('title' => "Test Post"));