Last active
July 11, 2016 16:46
-
-
Save rafa-acioly/02acdba3bfa6fbff84403ffcc2219b71 to your computer and use it in GitHub Desktop.
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
use App\Content; // Model responsavel pelo gerenciamento de conteudo (datas) | |
private $content; | |
public function __construct(Content $content) { | |
$this->content = $content; | |
} | |
public function feed() | |
{ | |
$contents = $this->content->all(); // Busca todos os dados. | |
$feed = array(); | |
foreach ($contents as $content) { | |
$feed[] = [ | |
‘id’ => $content->id, | |
‘title’ => $content->title, | |
‘start’ => $content->scheduled_to, | |
‘end’ => $content->scheduled_to, | |
‘color’ => “gray” | |
]; | |
} | |
return response()->json($feed); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment