예제 #1
0
 /**
  * Handle the event.
  *
  * @param  ProfileCreatedEvent  $profileCreated
  * @return void
  */
 public function handle(ProfileCreatedEvent $profileCreated)
 {
     switch ($profileCreated->user->type) {
         case 'talent':
             ThreadRepository::notification('auth.registration.talent', $profileCreated->user, array('user' => $profileCreated->user));
             break;
         case 'startup':
             ThreadRepository::notification('auth.registration.startup', $profileCreated->user, array('user' => $profileCreated->user));
             break;
     }
 }
예제 #2
0
 /**
  * Prepare Morph Fileds
  */
 private function prepareMorphFields()
 {
     switch ($this->rated_type) {
         case 'startup':
             $this->rated_type = 'App\\Models\\Startup';
             $this->rated_by_type = 'App\\Models\\User';
             break;
         default:
             $this->rated_type = 'App\\Models\\User';
             $this->rated_by_type = 'App\\Models\\Startup';
             ThreadRepository::notification('talent.rating.talent', User::find($this->rated_id), array());
             break;
     }
 }
 /**
  * Handle the event.
  *
  * @param UserDeniedToJoinStartupEvent $userDenied
  */
 public function handle(UserDeniedToJoinStartupEvent $userDenied)
 {
     ThreadRepository::notification('startup.join.request.deny.talent', $userDenied->user, array('startup' => $userDenied->startup));
 }
예제 #4
0
 /**
  * Handle the event.
  *
  * @param UserLeftStartupEvent $userLeft
  * @internal param UserLeftStartup $event
  */
 public function handle(UserLeftStartupEvent $userLeft)
 {
     ThreadRepository::notification('startup.left.talent', $userLeft->user, array('startup' => $userLeft->startup));
     ThreadRepository::notification('startup.left.founder', $userLeft->startup->owner, array('startup' => $userLeft->startup, 'talent' => $userLeft->user));
 }
예제 #5
0
 /**
  * Invite the user to a startup
  */
 public function invite()
 {
     $userTo = User::findOrFail(Input::get('user_id'));
     $startup = Startup::findOrFail(Input::get('startup_id'));
     $userFrom = Auth::user();
     ThreadRepository::notification('startup.join.invite.talent', $userTo, array('startup' => $startup, 'fromUser' => $userFrom));
     Flash::message('You have successfully invited ' . $userTo->profile->first_name);
     return Redirect::intended('/users/' . $userTo->id);
 }
예제 #6
0
 /**
  * Handle the event.
  *
  * @param UserRatedEvent $userRated
  */
 public function handle(UserRatedEvent $userRated)
 {
     ThreadRepository::notification('talent.rating.talent', $userRated->user, array());
 }
예제 #7
0
 /**
  * Handle the event.
  *
  * @param StartupCreatedEvent $startupCreated
  */
 public function handle(StartupCreatedEvent $startupCreated)
 {
     ThreadRepository::notification('startup.created.owner', $startupCreated->startup->owner, array('startup' => $startupCreated->startup));
 }
 /**
  * Handle the event.
  *
  * @param UserAppliedToJoinStartupEvent $userApplied
  */
 public function handle(UserAppliedToJoinStartupEvent $userApplied)
 {
     ThreadRepository::notification('startup.join.request.owner', $userApplied->startup->owner, array('startup' => $userApplied->startup, 'talent' => $userApplied->user));
 }
예제 #9
0
 /**
  * Handle the event.
  *
  * @param UserJoinedStartupEvent $userJoined
  */
 public function handle(UserJoinedStartupEvent $userJoined)
 {
     ThreadRepository::notification('startup.join.talent', $userJoined->user, array('startup' => $userJoined->startup));
     ThreadRepository::notification('startup.join.owner', $userJoined->startup->owner, array('startup' => $userJoined->startup, 'talent' => $userJoined->user));
 }