Implement DocumentAPIController
This commit is contained in:
parent
eb1d5be47c
commit
1e370d2cce
2 changed files with 41 additions and 0 deletions
40
app/Http/Controllers/DocumentAPIController.php
Normal file
40
app/Http/Controllers/DocumentAPIController.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Document;
|
||||
|
||||
class DocumentAPIController extends BaseAPIController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
//stub
|
||||
}
|
||||
|
||||
public function show($publicId)
|
||||
{
|
||||
$document = Document::scope($publicId)->firstOrFail();
|
||||
|
||||
return DocumentController::getDownloadResponse($document);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
//stub
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
//stub
|
||||
}
|
||||
|
||||
public function destroy($publicId)
|
||||
{
|
||||
//stub
|
||||
}
|
||||
}
|
||||
|
|
@ -284,6 +284,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function()
|
|||
Route::post('add_token', 'AccountApiController@addDeviceToken');
|
||||
Route::post('update_notifications', 'AccountApiController@updatePushNotifications');
|
||||
Route::get('dashboard', 'DashboardApiController@index');
|
||||
Route::resource('documents', 'DocumentAPIController');
|
||||
|
||||
// Vendor
|
||||
Route::resource('vendors', 'VendorApiController');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue