This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use App\Models\AppModel; | |
use App\Traits\FilterTrait; | |
class User extends AppModel | |
{ | |
use FilterTrait; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
trait FilterTrait { | |
/** | |
* add filtering. | |
* | |
* @param $builder: query builder. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
use App\User; | |
use Illuminate\Http\Request; | |
class UsersController extends Controller | |
{ | |
protected $model; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use App\Models\AppModel; | |
class User extends AppModel | |
{ | |
protected $table = 'users'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
class AppModel extends Model | |
{ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
use App\User; | |
use Illuminate\Http\Request; | |
class UsersController extends Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
use App\Http\Requests\Api\CreatePostRequest; | |
use App\Http\Requests\Api\UpdatePostRequest; | |
use App\Repositories\PostsRepository; | |
use Exception; | |
use Illuminate\Http\Request; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Repositories; | |
use App\Models\Post; | |
use App\Repositories\AppRepository; | |
use Illuminate\Http\Request; | |
class PostsRepository extends AppRepository | |
{ | |
protected $model; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Repositories; | |
use Illuminate\Database\Eloquent\Model; | |
class AppRepository | |
{ | |
/** | |
* Eloquent model instance. | |
*/ | |
protected $model; | |
/** |