Ejemplo n.º 1
0
 /**
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function batchInvite(Request $request)
 {
     $entries = $this->entry->notAccepted($request->get('amount', 50));
     foreach ($entries as $entry) {
         $this->entry->invite($entry);
     }
     return redirect()->route('admin.entry.entry.index')->with('success', 'Invites sent.');
 }
Ejemplo n.º 2
0
 public function addToOrganisation($token, GithubUsernameRequest $request)
 {
     $entry = $this->entry->findByEmail($request->get('email'));
     if (!$entry) {
         return redirect()->back()->withInput()->with('error', 'No Entry found with this email.');
     }
     if (!$this->isValidEntry($token, $entry)) {
         return redirect()->back()->withInput()->with('error', 'Not a valid submission.');
     }
     $this->githubService->addTeamMember($request->get('username'));
     $this->markActivationAsCompleted($token, $entry);
     $this->sendConfirmationEmail($entry);
     return redirect()->back()->with('success', 'You\'have been invited to the AsgardCms Github Organisation.');
 }
Ejemplo n.º 3
0
 public function subscribe(SubscribeRequest $request)
 {
     $this->entry->subscribe($request->email);
     return Response::json('Thank you! You have successfully applied for beta access.');
 }
Ejemplo n.º 4
0
 public function compose(View $view)
 {
     $view->with('entries', $this->entryRepository->allActive());
 }
Ejemplo n.º 5
0
 /**
  * Get the widget data to send to the view
  * @return array
  */
 protected function data()
 {
     return ['entriesAmount' => $this->entry->countAll()];
 }
Ejemplo n.º 6
0
 public function like(Request $request)
 {
     $entry = $this->entry->find($request->get('entryId'));
     return response()->json($entry->incrementLikesForIp($request->ip()));
 }
Ejemplo n.º 7
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  Entry $entry
  * @return Response
  */
 public function destroy(Entry $entry)
 {
     $this->entry->destroy($entry);
     flash()->success(trans('core::core.messages.resource deleted', ['name' => trans('entry::entries.title.entries')]));
     return redirect()->route('admin.entry.entry.index');
 }
Ejemplo n.º 8
0
 /**
  * Get the widget data to send to the view
  * @return array
  */
 protected function data()
 {
     return ['totalAcceptedAndCompleted' => $this->entry->countAcceptedAndCompleted(), 'totalAcceptedAndNotCompleted' => $this->entry->countAcceptedAndNotCompleted(), 'totalNotInvited' => $this->entry->countTotalNotInvited()];
 }
Ejemplo n.º 9
0
 public function beta()
 {
     $user = $this->auth->check();
     $entry = $this->entry->findByEmail($user->email);
     return view('profile::public.beta-access', compact('user', 'entry'));
 }
 public function compose(View $view)
 {
     //dd($this->entry->mostPopular(5));
     $view->with('popularEntries', $this->entry->mostPopular(5));
 }