Created
April 24, 2019 23:38
-
-
Save soubrunorocha/172ad098ca3fd3164f9924f2bb495f7b to your computer and use it in GitHub Desktop.
Exemplo 1 para APDA
This file contains 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\Services; | |
class LogService | |
{ | |
public function handleLog() | |
{ | |
//Função de Log | |
} | |
} |
This file contains 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 Illuminate\Http\Request; | |
use App\Services\LogService; | |
class RandomController extends Controller | |
{ | |
/** | |
* @var LogService | |
*/ | |
private $logService; | |
public function __construct(LogService $logService) | |
{ | |
$this->logService = logService; | |
} | |
/** | |
* Store a newly created resource in storage. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @return \Illuminate\Http\JsonResponse | |
*/ | |
public function store(Request $request) : \Illuminate\Http\JsonResponse | |
{ | |
$this->logService->handleLog(); | |
//Salvando dados | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment