PHP code example of kindharika / laravel-api-starter
1. Go to this page and download the library: Download kindharika/laravel-api-starter 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/ */
kindharika / laravel-api-starter example snippets
use Kindharika\ApiStarter\Base\BaseModel;
class Post extends BaseModel
{
protected $table = 'posts';
}
use Kindharika\ApiStarter\Base\BaseApiController;
class PostController extends BaseApiController
{
// use sendSuccess() / sendError()
}
use Kindharika\ApiStarter\Base\BaseService;
use Kindharika\ApiStarter\Base\BaseServiceInterface;
class PostService extends BaseService implements BaseServiceInterface
{
// implements dataTable, getById, create, update, delete
}
use Kindharika\ApiStarter\Traits\FirebaseNotification;
class YourService
{
use FirebaseNotification;
public function notify($user)
{
$this->sendNotification($user, 'Title", "Body", "INFO");
}
}