コード例 #1
0
ファイル: EntryController.php プロジェクト: Houbsi/Website
 /**
  * @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.');
 }
コード例 #2
0
ファイル: EntryController.php プロジェクト: Houbsi/Website
 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.');
 }
コード例 #3
0
ファイル: EntryController.php プロジェクト: Houbsi/Website
 public function subscribe(SubscribeRequest $request)
 {
     $this->entry->subscribe($request->email);
     return Response::json('Thank you! You have successfully applied for beta access.');
 }
コード例 #4
0
 public function compose(View $view)
 {
     $view->with('entries', $this->entryRepository->allActive());
 }
コード例 #5
0
ファイル: EntriesWidget.php プロジェクト: Houbsi/Website
 /**
  * Get the widget data to send to the view
  * @return array
  */
 protected function data()
 {
     return ['entriesAmount' => $this->entry->countAll()];
 }
コード例 #6
0
 public function like(Request $request)
 {
     $entry = $this->entry->find($request->get('entryId'));
     return response()->json($entry->incrementLikesForIp($request->ip()));
 }
コード例 #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');
 }
コード例 #8
0
ファイル: EntriesGraphWidget.php プロジェクト: Houbsi/Website
 /**
  * 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()];
 }
コード例 #9
0
ファイル: ProfileController.php プロジェクト: Houbsi/Website
 public function beta()
 {
     $user = $this->auth->check();
     $entry = $this->entry->findByEmail($user->email);
     return view('profile::public.beta-access', compact('user', 'entry'));
 }
コード例 #10
0
 public function compose(View $view)
 {
     //dd($this->entry->mostPopular(5));
     $view->with('popularEntries', $this->entry->mostPopular(5));
 }