Skip to content

Instantly share code, notes, and snippets.

@soubrunorocha
Created April 24, 2019 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soubrunorocha/172ad098ca3fd3164f9924f2bb495f7b to your computer and use it in GitHub Desktop.
Save soubrunorocha/172ad098ca3fd3164f9924f2bb495f7b to your computer and use it in GitHub Desktop.
Exemplo 1 para APDA
<?php
namespace App\Services;
class LogService
{
public function handleLog()
{
//Função de Log
}
}
<?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