Skip to content

Commit

Permalink
Updating interface to app directory
Browse files Browse the repository at this point in the history
Signed-off-by: Vallabh Kansagara <vrkansagara@gmail.com>
  • Loading branch information
vrkansagara committed Nov 18, 2018
1 parent 52bf362 commit 0ea0562
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/AuthController.php
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Api\interfaces\AuthInterface;
use App\Interfaces\AuthInterface;
use App\Http\Controllers\ApiController;
use App\Entity\User;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
Expand Down
25 changes: 23 additions & 2 deletions app/Http/Controllers/Api/Blog/BlogController.php
Expand Up @@ -2,20 +2,41 @@

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Api\Blog\BlogInterface;
use App\Interfaces\BlogInterface;
use App\Http\Controllers\ApiController;
use App\Repositories\Blog\BlogRepository;
use Illuminate\Http\Request;

class BlogController extends ApiController implements BlogInterface
{
/**
* @var BlogRepository
*/
private $blogRepository;

/**
* BlogController constructor.
* @param BlogRepository $blogRepository
*/
public function __construct(BlogRepository $blogRepository)
{
$this->blogRepository = $blogRepository;
}


/**
* @param Request $request
* @return mixed
*/
public function index(Request $request)
{
// TODO: Implement index() method.
$blogs = $this->blogRepository->paginate();

$responseData = [
'blog_posts' => $blogs
];

return response()->json($responseData);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/Blog/CategoryController.php
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Api\Blog\Interfaces\CategoryInterface;
use App\Interfaces\CategoryInterface;
use Illuminate\Http\Request;

class CategoryController extends ApiController implements CategoryInterface
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/Blog/TagController.php
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Http\Controllers\Api\Blog\Interfaces\TagInterface;
use App\Interfaces\TagInterface;
use Illuminate\Http\Request;

class TagController extends ApiController implements TagInterface
Expand Down
15 changes: 14 additions & 1 deletion app/Http/Controllers/ApiController.php
Expand Up @@ -2,12 +2,25 @@

namespace App\Http\Controllers;

use App\Interfaces\ApiInterface;
use App\Traits\ApiTraits;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

class ApiController extends BaseController
class ApiController extends BaseController implements ApiInterface
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use ApiTraits;

public function __construct()
{

}

public function response()
{

}
}
15 changes: 15 additions & 0 deletions app/Interfaces/ApiInterface.php
@@ -0,0 +1,15 @@
<?php
/**
* Created by PhpStorm.
* User: vallabh
* Date: 18/11/18
* Time: 12:36 PM
*/

namespace App\Interfaces;


interface ApiInterface
{

}
Expand Up @@ -6,7 +6,7 @@
* Time: 10:04 PM
*/

namespace App\Http\Controllers\Api\interfaces;
namespace App\Interfaces;

use Illuminate\Http\Request;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions app/Traits/ApiTraits.php
@@ -0,0 +1,15 @@
<?php
/**
* Created by PhpStorm.
* User: vallabh
* Date: 18/11/18
* Time: 12:36 PM
*/

namespace App\Traits;


trait ApiTraits
{

}
2 changes: 1 addition & 1 deletion bootstrap/app.php
Expand Up @@ -20,7 +20,7 @@
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| Next, we need to bind some important Interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
Expand Down
4 changes: 2 additions & 2 deletions config/ide-helper.php
Expand Up @@ -101,12 +101,12 @@
| Interface implementations
|--------------------------------------------------------------------------
|
| These interfaces will be replaced with the implementing class. Some interfaces
| These Interfaces will be replaced with the implementing class. Some Interfaces
| are detected by the helpers, others can be listed below.
|
*/

'interfaces' => array(
'Interfaces' => array(

),

Expand Down

0 comments on commit 0ea0562

Please sign in to comment.