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 | |
| /** | |
| * Handle dynamic, static calls to the object. | |
| */ | |
| public static function __callStatic($method, $args) | |
| { | |
| $instance = static::getFacadeRoot(); | |
| switch (count($args)) | |
| { |
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 | |
| /** | |
| * Get the available container instance. | |
| * | |
| * @param string $make | |
| * @param array $parameters | |
| * @return mixed|\Illuminate\Foundation\Application | |
| */ | |
| function app($make = null, $parameters = []) | |
| { |
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 | |
| use Illuminate\Database\Seeder; | |
| use Illuminate\Database\Eloquent\Model; | |
| #/database/seeds/DatabaseSeeder.php | |
| class DatabaseSeeder extends Seeder | |
| { | |
| // Este é o método executado quando executamos -> php artisan db:seed | |
| public function run() | |
| { |
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\Contracts\Repositories\Segregated; | |
| use Illuminate\Database\Eloquent\Model; | |
| interface Common | |
| { | |
| /** | |
| * @param bool $paginate | |
| * @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder $query |
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\Providers; | |
| use Illuminate\Support\ServiceProvider; | |
| class AppServiceProvider extends ServiceProvider { | |
| //... | |
| public function boot() | |
| { | |
| //... | |
| $this->loadViewsFrom(base_path('resources/views/painel'), 'painel'); |
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 | |
| ## resource ## | |
| Route::group(['prefix' => 'painel', 'namespace' => 'Painel'], function() | |
| { | |
| Route::resource('posts', 'PostsCtrl'); | |
| # Gera | |
| # | |
| # painel.posts.index # painel.posts.show # painel.posts.create | |
| # painel.posts.store # painel.posts.update # painel.posts.destroy |
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 | |
| // Painel (ADMIN) | |
| Route::group(['prefix' => 'painel', 'namespace' => 'Painel'], function() | |
| { | |
| Route::get('posts', ['as' => 'painel.posts.index', 'uses' => 'PostsCtrl@index']); // App/Http/Controllers/Painel/Posts.php | |
| Route::get('posts/{id}', ['as' => 'painel.posts.show', 'uses' => 'PostsCtrl@show']); | |
| }); | |
| // Front (Site) |
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 | |
| # Estendendo PainelCtrl e FrontCtrl você mantem seu sistema organizado, | |
| # podendo implementar regras comuns aos seus controllers, deixando seu código mais legivel e flexivel | |
| # Controller 1 (Painel) | |
| # app/http/controllers/Painel/ClientsCtrl.php | |
| namespace App\Http\Controllers\Painel; | |
| class ClientsCtrl extends PainelCtrl {} |
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
| # app/http/controllers/Painel/PainelCtrl.php | |
| <?php namespace App\Http\Controllers\Painel; | |
| use App\Http\Controllers\Controllers; | |
| abstract class PainelCtrl extends Controller | |
| { | |
| # implemente as suas regras e/ou métodos que serão válidas/usadas em todos os controllers do seu "painel" | |
| } |
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
| # app/http/controllers/Front/FrontCtrl.php | |
| <?php namespace App\Http\Controllers\Front; | |
| use App\Http\Controllers\Controller; | |
| abstract class FrontCtrl extends Controller | |
| { | |
| # implemente as suas regras e/ou métodos que serão válidas/usadas em todos os controllers do seu "front" | |
| } |