├── .env.example ├── .gitattributes ├── .githooks └── pre-commit ├── .github └── workflows │ └── run-tests.yml ├── .gitignore ├── .php_cs ├── app ├── Conference.php ├── Console │ ├── Commands │ │ ├── FetchTwitterInfoCommand.php │ │ └── Inspire.php │ └── Kernel.php ├── Events │ ├── Event.php │ └── FriendWasAdded.php ├── Exceptions │ ├── Handler.php │ └── ModelNotFoundException.php ├── Friend.php ├── Http │ ├── Controllers │ │ ├── API │ │ │ ├── ConferenceNewFriendsController.php │ │ │ ├── ConferenceOnlineFriendsController.php │ │ │ └── ConferencesController.php │ │ ├── Auth │ │ │ ├── AuthController.php │ │ │ ├── ForgotPasswordController.php │ │ │ └── ResetPasswordController.php │ │ ├── AvatarController.php │ │ ├── ConferenceIntroductionController.php │ │ ├── ConferencesController.php │ │ └── Controller.php │ ├── Kernel.php │ └── Middleware │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── UserOwnsConference.php │ │ └── VerifyCsrfToken.php ├── Jobs │ ├── FetchTwitterInfo.php │ └── Job.php ├── Listeners │ ├── .gitkeep │ └── FetchFriendInfo.php ├── OwnsModels.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Tweeter.php └── User.php ├── artisan ├── bin └── setup.sh ├── bootstrap ├── app.php ├── autoload.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── bugsnag.php ├── cache.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── confomo-logo.png ├── contributing.md ├── database ├── .gitignore ├── factories │ └── ModelFactory.php ├── migrations │ ├── .gitkeep │ ├── 2014_03_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2015_10_21_180012_create_conferences_table.php │ ├── 2015_10_21_185419_create_friends_table.php │ ├── 2016_07_10_080623_add_dates_to_conferences.php │ ├── 2016_07_16_115232_add_introduction_to_friends.php │ ├── 2016_09_01_125807_add_name_location_url_to_friends.php │ ├── 2017_06_08_195223_create_failed_jobs_table.php │ ├── 2017_07_07_141355_create_tweeters_table.php │ ├── 2017_07_10_150510_shift_failed_jobs_table.php │ ├── 2017_07_14_152816_change_created_at_to_nullable_on_password_resets_table.php │ └── 2017_07_19_162718_add_username_to_users_table.php └── seeds │ ├── .gitkeep │ └── DatabaseSeeder.php ├── gulpfile.js ├── helpers.php ├── nitpick.json ├── notes.txt ├── package-lock.json ├── package.json ├── phpspec.yml ├── phpunit.xml ├── public ├── .htaccess ├── assets │ └── img │ │ ├── cache │ │ └── twitter_profile_pics │ │ │ └── .gitkeep │ │ ├── confomo-logo.png │ │ ├── confomo-screenshot.png │ │ └── default_avatar.png ├── css │ ├── app.css │ └── app.css.map ├── favicon.ico ├── index.php ├── js │ ├── app.js │ └── app.js.map └── robots.txt ├── readme.md ├── resources ├── assets │ ├── js │ │ ├── app.js │ │ ├── components │ │ │ ├── Conference.vue │ │ │ ├── ConferenceIntroduction.vue │ │ │ ├── Dashboard.vue │ │ │ ├── Datepicker.vue │ │ │ ├── FormErrors.vue │ │ │ ├── FriendDetails.vue │ │ │ └── FriendsList.vue │ │ ├── core │ │ │ └── dependencies.js │ │ └── utils │ │ │ └── EventListener.js │ └── sass │ │ └── app.scss ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── conferences │ ├── introduce.blade.php │ └── show.blade.php │ ├── dashboard.blade.php │ ├── errors │ └── 503.blade.php │ ├── home.blade.php │ ├── layouts │ └── app.blade.php │ ├── partials │ └── navbar.blade.php │ └── vendor │ └── .gitkeep ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore └── tests ├── BrowserKitTestCase.php ├── ConferenceTest.php ├── FriendTest.php ├── MeetNewFriendTest.php ├── MeetOnlineFriendTest.php ├── NewFriendTest.php ├── OnlineFriendTest.php ├── PlanToMeetOnlineFriendTest.php ├── TestCase.php └── TweeterTest.php /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_DEBUG=true 3 | APP_KEY=SomeRandomString 4 | 5 | DB_HOST=localhost 6 | DB_DATABASE=confomo 7 | DB_USERNAME=root 8 | DB_PASSWORD= 9 | 10 | CACHE_DRIVER=file 11 | SESSION_DRIVER=file 12 | QUEUE_DRIVER=sync 13 | 14 | MAIL_DRIVER=smtp 15 | MAIL_HOST=mailtrap.io 16 | MAIL_PORT=2525 17 | MAIL_USERNAME=null 18 | MAIL_PASSWORD=null 19 | MAIL_ENCRYPTION=null 20 | 21 | TWITTER_CONSUMER_KEY= 22 | TWITTER_CONSUMER_SECRET= 23 | TWITTER_ACCESS_TOKEN= 24 | TWITTER_ACCESS_TOKEN_SECRET= 25 | TWITTER_URL= 26 | 27 | BUGSNAG_API_KEY= 28 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.less linguist-vendored 4 | -------------------------------------------------------------------------------- /.githooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | HAS_PHP_CS_FIXER=false 4 | 5 | PHP_CS_FIXER="vendor/bin/php-cs-fixer" 6 | 7 | if [ ! -x "$PHP_CS_FIXER" ]; then 8 | PHP_CS_FIXER=$(which php-cs-fixer); 9 | fi 10 | 11 | if [ -x "$PHP_CS_FIXER" ]; then 12 | HAS_PHP_CS_FIXER=true 13 | fi 14 | 15 | if $HAS_PHP_CS_FIXER; then 16 | git status --porcelain | grep -e '^[ACM]\(.*\).php$' | cut -c 3- | while read line; do 17 | "$PHP_CS_FIXER" fix --config=.php_cs "$line"; 18 | git add "$line" 19 | done 20 | git status --porcelain | grep -e '^[R]\(.*\).php$' | cut -c 3- | while read line; do 21 | files=(${line// -> / }) 22 | "$PHP_CS_FIXER" fix --config=.php_cs "${files[1]}"; 23 | git add "${files[1]}" 24 | done 25 | else 26 | echo "" 27 | echo "Please install php-cs-fixer, e.g.:" 28 | echo "" 29 | echo " composer require --dev friendsofphp/php-cs-fixer" 30 | echo "" 31 | fi -------------------------------------------------------------------------------- /.github/workflows/run-tests.yml: -------------------------------------------------------------------------------- 1 | name: Run Tests 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | 8 | jobs: 9 | tests: 10 | name: Tests 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v1 16 | 17 | - name: Setup PHP 18 | uses: shivammathur/setup-php@v2 19 | with: 20 | php-version: 7.4 21 | extensions: posix, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick 22 | coverage: none 23 | 24 | - name: Install dependencies 25 | run: composer install --prefer-source --no-interaction 26 | 27 | - name: Copy .env.example as .env 28 | run: cp .env.example .env 29 | 30 | - name: Generate App Key 31 | run: php artisan key:generate 32 | 33 | - name: Run PHP tests 34 | run: vendor/bin/phpunit 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | .env 3 | public/assets/img/cache/twitter_profile_pics/* 4 | !public/assets/img/cache/twitter_profile_pics/.gitkeep 5 | /node_modules 6 | Homestead.yaml 7 | /public/storage 8 | Homestead.json 9 | .env 10 | .php_cs.cache 11 | -------------------------------------------------------------------------------- /.php_cs: -------------------------------------------------------------------------------- 1 | notPath('bootstrap/cache') 5 | ->notPath('node_modules') 6 | ->notPath('public') 7 | ->notPath('storage') 8 | ->notPath('vendor') 9 | ->in(__DIR__) 10 | ->name('*.php') 11 | ->ignoreDotFiles(true) 12 | ->ignoreVCS(true); 13 | 14 | return PhpCsFixer\Config::create() 15 | ->setRules([ 16 | '@PSR1' => false, 17 | '@PSR2' => true, 18 | 19 | // Logical NOT operators (!) should have one trailing whitespace. 20 | 'not_operator_with_successor_space' => true, 21 | // PHP multi-line arrays should have a trailing comma. 22 | 'trailing_comma_in_multiline_array' => true, 23 | // Ordering use statements. 24 | 'ordered_imports' => true, 25 | // Removes extra blank lines and/or blank lines following configuration. 26 | 'no_extra_blank_lines' => ['use'], 27 | // An empty line feed should precede a return statement. 28 | 'blank_line_before_return' => true, 29 | // PHP arrays should be declared using the configured syntax. 30 | 'array_syntax' => ['syntax' => 'short'], 31 | // Cast (boolean) and (integer) should be written as (bool) and (int), (double) and (real) as (float), (binary) as (string). 32 | 'short_scalar_cast' => true, 33 | // PHP single-line arrays should not have trailing comma. 34 | 'no_trailing_comma_in_singleline_array' => true, 35 | // Arrays should be formatted like function/method arguments, without leading or trailing single line space. 36 | 'trim_array_spaces' => true, 37 | // Binary operators should be surrounded by space as configured. 38 | 'binary_operator_spaces' => ['align_double_arrow' => false, 'align_equals' => false], 39 | // Unused use statements must be removed. 40 | 'no_unused_imports' => true, 41 | ]) 42 | ->setFinder($finder) 43 | ->setUsingCache(true); 44 | -------------------------------------------------------------------------------- /app/Conference.php: -------------------------------------------------------------------------------- 1 | 'integer']; 13 | protected $dates = ['start_date', 'end_date']; 14 | 15 | public function save(array $options = []) 16 | { 17 | if ($this->slug === null) { 18 | return $this->saveWithNewSlug($options); 19 | } 20 | 21 | return parent::save($options); 22 | } 23 | 24 | private function saveWithNewSlug(array $options = []) 25 | { 26 | return retry(5, function () use ($options) { 27 | $this->regenerateSlug(); 28 | 29 | return parent::save($options); 30 | }); 31 | } 32 | 33 | private function regenerateSlug() 34 | { 35 | $this->slug = str_random(16); 36 | } 37 | 38 | public function user() 39 | { 40 | return $this->belongsTo(User::class); 41 | } 42 | 43 | public function meetNewFriend($username) 44 | { 45 | $friend = new Friend([ 46 | 'username' => $this->normalizeFriendName($username), 47 | 'type' => 'new', 48 | 'met' => true, 49 | ]); 50 | 51 | $this->newFriends()->save($friend); 52 | 53 | event(new FriendWasAdded($friend)); 54 | 55 | return $friend; 56 | } 57 | 58 | public function newFriends() 59 | { 60 | return $this->hasMany(Friend::class)->where('type', 'new'); 61 | } 62 | 63 | public function planToMeetOnlineFriend($username) 64 | { 65 | $friend = new Friend([ 66 | 'username' => $this->normalizeFriendName($username), 67 | 'type' => 'online', 68 | 'met' => false, 69 | ]); 70 | 71 | $this->onlineFriends()->save($friend); 72 | 73 | event(new FriendWasAdded($friend)); 74 | 75 | return $friend; 76 | } 77 | 78 | public function onlineFriends() 79 | { 80 | return $this->hasMany(Friend::class)->where('type', 'online'); 81 | } 82 | 83 | public function makeIntroduction($username) 84 | { 85 | $friend = Friend::firstOrNew([ 86 | 'conference_id' => $this->id, 87 | 'username' => $this->normalizeFriendName($username), 88 | ]); 89 | 90 | return $friend->exists 91 | ? $this->markExistingFriendAsIntroduction($username, $friend) 92 | : $this->addNewFriendAsIntroduction($username, $friend); 93 | } 94 | 95 | protected function markExistingFriendAsIntroduction($username, $friend) 96 | { 97 | $friend->update(['introduction' => true]); 98 | 99 | return $friend; 100 | } 101 | 102 | protected function addNewFriendAsIntroduction($username, $friend) 103 | { 104 | $friend->fill([ 105 | 'introduction' => true, 106 | 'type' => $this->isUpcoming() ? 'online' : 'new', 107 | 'met' => ! $this->isUpcoming(), 108 | ]); 109 | 110 | $relationship = sprintf('%sFriends', $friend->type); 111 | 112 | $this->$relationship()->save($friend); 113 | 114 | event(new FriendWasAdded($friend)); 115 | 116 | return $friend; 117 | } 118 | 119 | public function isUpcoming() 120 | { 121 | if (is_null($this->start_date)) { 122 | return false; 123 | } 124 | 125 | return $this->start_date->gt(Carbon::now()); 126 | } 127 | 128 | public function isInProgress() 129 | { 130 | if (is_null($this->start_date) || is_null($this->end_date)) { 131 | return false; 132 | } 133 | 134 | return Carbon::now()->between($this->start_date, $this->end_date); 135 | } 136 | 137 | public function isFinished() 138 | { 139 | if (is_null($this->end_date)) { 140 | return false; 141 | } 142 | 143 | return $this->end_date->lt(Carbon::now()); 144 | } 145 | 146 | public function getTweetTextAttribute() 147 | { 148 | if ($this->isUpcoming()) { 149 | return sprintf('Want to meet at %s?', $this->name); 150 | } 151 | 152 | return sprintf('Did we meet at %s?', $this->name); 153 | } 154 | 155 | protected function normalizeFriendName($username) 156 | { 157 | return str_replace('@', '', $username); 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /app/Console/Commands/FetchTwitterInfoCommand.php: -------------------------------------------------------------------------------- 1 | subDay())->get()->each(function ($tweeter) { 37 | $this->dispatch(new FetchTwitterInfo($tweeter)); 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Console/Commands/Inspire.php: -------------------------------------------------------------------------------- 1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('twitter:fetch-info')->daily(); 28 | } 29 | 30 | /** 31 | * Register the Closure based commands for the application. 32 | * 33 | * @return void 34 | */ 35 | protected function commands() 36 | { 37 | require base_path('routes/console.php'); 38 | $this->load(__DIR__ . '/Commands'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Events/Event.php: -------------------------------------------------------------------------------- 1 | friend = $friend; 25 | } 26 | 27 | /** 28 | * Get the channels the event should be broadcast on. 29 | * 30 | * @return array 31 | */ 32 | public function broadcastOn() 33 | { 34 | return []; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | getMessage(), $e); 51 | } 52 | 53 | return parent::render($request, $e); 54 | } 55 | /** 56 | * Convert an authentication exception into an unauthenticated response. 57 | * 58 | * @param \Illuminate\Http\Request $request 59 | * @param \Illuminate\Auth\AuthenticationException $e 60 | * @return \Illuminate\Http\Response 61 | */ 62 | protected function unauthenticated($request, AuthenticationException $e) 63 | { 64 | if ($request->expectsJson()) { 65 | return response()->json(['error' => 'Unauthenticated.'], 401); 66 | } else { 67 | return redirect()->guest('login'); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/Exceptions/ModelNotFoundException.php: -------------------------------------------------------------------------------- 1 | 'boolean', 'introduction' => 'boolean']; 12 | 13 | public function getAvatarAttribute() 14 | { 15 | return $this->tweeter->avatar; 16 | } 17 | 18 | public function getAvatarUrlAttribute() 19 | { 20 | return $this->tweeter->avatar_url; 21 | } 22 | 23 | public function getNameAttribute() 24 | { 25 | return $this->tweeter->name; 26 | } 27 | 28 | public function getLocationAttribute() 29 | { 30 | return $this->tweeter->location; 31 | } 32 | 33 | public function getDescriptionAttribute() 34 | { 35 | return $this->tweeter->description; 36 | } 37 | 38 | public function getUrlAttribute() 39 | { 40 | return $this->tweeter->url; 41 | } 42 | 43 | public function getUrlDisplayAttribute() 44 | { 45 | return $this->tweeter->url_display; 46 | } 47 | 48 | public function markMet() 49 | { 50 | return $this->update(['met' => true]); 51 | } 52 | 53 | public function tweeter() 54 | { 55 | return $this->belongsTo(Tweeter::class, 'username', 'username'); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/Http/Controllers/API/ConferenceNewFriendsController.php: -------------------------------------------------------------------------------- 1 | meetNewFriend($request->input('username')); 15 | } 16 | 17 | public function index(Conference $conference) 18 | { 19 | return $conference->newFriends; 20 | } 21 | 22 | public function delete(Conference $conference, Friend $friend) 23 | { 24 | $friend->delete(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Controllers/API/ConferenceOnlineFriendsController.php: -------------------------------------------------------------------------------- 1 | planToMeetOnlineFriend(request('username')); 15 | } 16 | 17 | public function index(Conference $conference) 18 | { 19 | return $conference->onlineFriends; 20 | } 21 | 22 | public function update(Conference $conference, Friend $friend) 23 | { 24 | foreach (request()->all() as $key => $value) { 25 | $friend->$key = $value; 26 | } 27 | 28 | $friend->save(); 29 | } 30 | 31 | public function show(Conference $conference, Friend $friend) 32 | { 33 | return $friend; 34 | } 35 | 36 | public function delete(Conference $conference, Friend $friend) 37 | { 38 | $friend->delete(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Http/Controllers/API/ConferencesController.php: -------------------------------------------------------------------------------- 1 | validate($request, [ 15 | 'name' => 'required', 16 | 'start_date' => 'required|date_format:Y-m-d', 17 | 'end_date' => 'required|date_format:Y-m-d|after:' . dayBefore($request->start_date), 18 | ]); 19 | 20 | return Auth::user()->addConference($request->only([ 21 | 'name', 22 | 'start_date', 23 | 'end_date', 24 | ])); 25 | } 26 | 27 | public function index() 28 | { 29 | return Auth::user()->conferences()->get(); 30 | } 31 | 32 | public function delete(Conference $conference) 33 | { 34 | abort_if($conference->user_id !== Auth::user()->id, 404); 35 | 36 | $conference->delete(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'logout']); 43 | } 44 | 45 | /** 46 | * Authenticate the user with Twitter. 47 | * 48 | * @return Response 49 | */ 50 | public function authenticate() 51 | { 52 | return Socialite::with('twitter')->redirect(); 53 | } 54 | 55 | /** 56 | * Handle the authentication callback from Twitter. 57 | * 58 | * @return Response 59 | */ 60 | public function handleTwitterCallback() 61 | { 62 | try { 63 | $twitter = Socialite::with('twitter')->user(); 64 | } catch (InvalidArgumentException $e) { 65 | return redirect('/'); 66 | } 67 | 68 | $user = User::updateOrCreate(['twitter_id' => $twitter->id], [ 69 | 'name' => $twitter->name, 70 | 'username' => $twitter->nickname, 71 | ]); 72 | 73 | Auth::login($user, true); 74 | 75 | return redirect('/'); 76 | } 77 | 78 | public function localLogin() 79 | { 80 | if (! App::environment('local')) { 81 | abort(404); 82 | } 83 | 84 | Auth::login(User::first(), true); 85 | 86 | return redirect('/dashboard'); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/AvatarController.php: -------------------------------------------------------------------------------- 1 | first()) { 13 | return $this->defaultAvatarResponse(); 14 | } 15 | 16 | if (! file_exists(public_path($friend->avatar))) { 17 | return $this->defaultAvatarResponse(); 18 | } 19 | 20 | $mimeType = File::mimeType($avatar_path = public_path($friend->avatar)); 21 | 22 | return $this->fileResponse($avatar_path, ['Content-type' => $mimeType]); 23 | } 24 | 25 | private function defaultAvatarResponse() 26 | { 27 | return $this->fileResponse(public_path('assets/img/default_avatar.png'), ['Content-type' => 'image/png']); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Http/Controllers/ConferenceIntroductionController.php: -------------------------------------------------------------------------------- 1 | with('conference', Conference::where('slug', $conferenceSlug)->firstOrFail()); 14 | } 15 | 16 | public function store($conferenceSlug, Request $request) 17 | { 18 | $this->validate($request, ['username' => 'required']); 19 | 20 | return Conference::where('slug', $conferenceSlug) 21 | ->firstOrFail() 22 | ->makeIntroduction($request->input('username')); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Controllers/ConferencesController.php: -------------------------------------------------------------------------------- 1 | with('conference', $conference); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | [ 30 | \App\Http\Middleware\EncryptCookies::class, 31 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 32 | \Illuminate\Session\Middleware\StartSession::class, 33 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 34 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 35 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 36 | //\App\Http\Middleware\VerifyCsrfToken::class, 37 | ], 38 | 39 | 'api' => [ 40 | 'throttle:60,1', 41 | 'bindings', 42 | ], 43 | ]; 44 | 45 | /** 46 | * The application's route middleware. 47 | * 48 | * @var array 49 | */ 50 | protected $routeMiddleware = [ 51 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 52 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 53 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 54 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 55 | 'owns-conference' => \App\Http\Middleware\UserOwnsConference::class, 56 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 57 | ]; 58 | } 59 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/dashboard'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | conference->user_id !== Auth::user()->id, 404); 21 | 22 | return $next($request); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | tweeter = $tweeter; 26 | } 27 | 28 | /** 29 | * Execute the job. 30 | * 31 | * @return void 32 | */ 33 | public function handle(TwitterOAuth $twitter) 34 | { 35 | try { 36 | $details = $twitter->get('users/show', ['screen_name' => $this->tweeter->username]); 37 | 38 | if (isset($details->errors)) { 39 | // @todo: Handle if it's a non-existent tweeter? 40 | Log::error($details->errors[0]->message); 41 | 42 | return false; 43 | } 44 | 45 | $this->tweeter->name = $details->name; 46 | $this->tweeter->location = $details->location; 47 | $this->tweeter->description = $details->description; 48 | 49 | if (array_has($details->entities, 'url')) { 50 | $this->tweeter->url = $details->url; 51 | $this->tweeter->url_display = $details->entities->url->urls[0]->display_url; 52 | } 53 | 54 | $this->tweeter->save(); 55 | Log::info('Synced tweeter details for ' . $this->tweeter->username); 56 | 57 | $avatar_url = str_replace('_normal', '', $details->profile_image_url_https); 58 | 59 | if (@file_put_contents(public_path($this->tweeter->avatar), @file_get_contents($avatar_url))) { 60 | Log::info('Synced avatar for ' . $this->tweeter->username); 61 | 62 | return true; 63 | } 64 | } catch (Exception $e) { 65 | Log::error('Failed syncing avatar/details for ' . $this->tweeter->username . '; exception: ' . $e->getMessage()); 66 | // No big deal, as we have a default avatar 67 | } 68 | 69 | Log::error('Failed syncing avatar for ' . $this->tweeter->username); 70 | 71 | return false; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/Jobs/Job.php: -------------------------------------------------------------------------------- 1 | friend->username); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/OwnsModels.php: -------------------------------------------------------------------------------- 1 | id === $model->{$this->getForeignKey()}; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind(TwitterOAuth::class, function () { 32 | return new TwitterOAuth( 33 | config('services.twitter.consumer_key'), 34 | config('services.twitter.consumer_secret'), 35 | config('services.twitter.access_token'), 36 | config('services.twitter.access_secret') 37 | ); 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 16 | ]; 17 | 18 | /** 19 | * Register any authentication / authorization services. 20 | * 21 | * @return void 22 | */ 23 | public function boot() 24 | { 25 | $this->registerPolicies(); 26 | 27 | // 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\FetchFriendInfo', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | // 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | firstOrFail(); 32 | }); 33 | 34 | Route::model('friend', Friend::class); 35 | } 36 | 37 | /** 38 | * Define the routes for the application. 39 | * 40 | * @return void 41 | */ 42 | public function map() 43 | { 44 | $this->mapApiRoutes(); 45 | 46 | $this->mapWebRoutes(); 47 | 48 | // 49 | } 50 | 51 | /** 52 | * Define the "web" routes for the application. 53 | * 54 | * These routes all receive session state, CSRF protection, etc. 55 | * 56 | * @return void 57 | */ 58 | protected function mapWebRoutes() 59 | { 60 | Route::group([ 61 | 'middleware' => 'web', 62 | 'namespace' => $this->namespace, 63 | ], function ($router) { 64 | require base_path('routes/web.php'); 65 | }); 66 | } 67 | 68 | /** 69 | * Define the "api" routes for the application. 70 | * 71 | * These routes are typically stateless. 72 | * 73 | * @return void 74 | */ 75 | protected function mapApiRoutes() 76 | { 77 | Route::group([ 78 | 'middleware' => 'api', 79 | 'namespace' => $this->namespace, 80 | 'prefix' => 'api', 81 | ], function ($router) { 82 | require base_path('routes/api.php'); 83 | }); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /app/Tweeter.php: -------------------------------------------------------------------------------- 1 | avatar))) { 23 | @unlink($avatar_path); 24 | } 25 | }); 26 | } 27 | 28 | public static function ensureExists($username) 29 | { 30 | \Bus::dispatch(new FetchTwitterInfo(self::firstOrCreate(['username' => $username]))); 31 | } 32 | 33 | public function getAvatarAttribute() 34 | { 35 | return sprintf('assets/img/cache/twitter_profile_pics/%s', sha1($this->username)); 36 | } 37 | 38 | public function getAvatarUrlAttribute() 39 | { 40 | return asset(sprintf('avatar/%s', $this->username)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | 'int']; 40 | 41 | public function conferences() 42 | { 43 | return $this->hasMany(Conference::class); 44 | } 45 | 46 | public function addConference($conference) 47 | { 48 | return $this->conferences()->save(new Conference($conference)); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /bin/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | composer install 4 | cp .env.example .env 5 | php artisan key:generate 6 | npm install 7 | gulp 8 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | =7.4", 12 | "laravel/framework": "5.6.*", 13 | "laravel/socialite": "^3.0", 14 | "abraham/twitteroauth": "^1.0.0", 15 | "pda/pheanstalk": "~3.0", 16 | "bugsnag/bugsnag-laravel": "1.*", 17 | "laravel/tinker": "~1.0" 18 | }, 19 | "require-dev": { 20 | "fzaninotto/faker": "~1.4", 21 | "mockery/mockery": "^1.0.0", 22 | "phpunit/phpunit": "^7.0", 23 | "doctrine/dbal": "^2.5", 24 | "laravel/browser-kit-testing": "4.*", 25 | "filp/whoops": "~2.0" 26 | }, 27 | "autoload": { 28 | "classmap": [ 29 | "database" 30 | ], 31 | "psr-4": { 32 | "App\\": "app/" 33 | }, 34 | "files": [ 35 | "helpers.php" 36 | ] 37 | }, 38 | "autoload-dev": { 39 | "classmap": [ 40 | "tests/TestCase.php", 41 | "tests/BrowserKitTestCase.php" 42 | ] 43 | }, 44 | "scripts": { 45 | "post-install-cmd": [ 46 | "Illuminate\\Foundation\\ComposerScripts::postInstall" 47 | ], 48 | "post-update-cmd": [ 49 | "Illuminate\\Foundation\\ComposerScripts::postUpdate" 50 | ], 51 | "post-root-package-install": [ 52 | "php -r \"copy('.env.example', '.env');\"" 53 | ], 54 | "post-create-project-cmd": [ 55 | "php artisan key:generate" 56 | ], 57 | "post-autoload-dump": [ 58 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 59 | "@php artisan package:discover" 60 | ] 61 | }, 62 | "config": { 63 | "preferred-install": "dist", 64 | "optimize-autoloader": true 65 | }, 66 | "minimum-stability": "dev", 67 | "prefer-stable": true 68 | } 69 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | 'Confomo', 16 | 17 | 'env' => env('APP_ENV', 'production'), 18 | 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Application Debug Mode 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When your application is in debug mode, detailed error messages with 26 | | stack traces will be shown on every error that occurs within your 27 | | application. If disabled, a simple generic error page is shown. 28 | | 29 | */ 30 | 31 | 'debug' => env('APP_DEBUG', false), 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Application URL 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This URL is used by the console to properly generate URLs when using 39 | | the Artisan command line tool. You should set this to the root of 40 | | your application so that it is used when running Artisan tasks. 41 | | 42 | */ 43 | 44 | 'url' => 'http://localhost', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Application Timezone 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may specify the default timezone for your application, which 52 | | will be used by the PHP date and date-time functions. We have gone 53 | | ahead and set this to a sensible default for you out of the box. 54 | | 55 | */ 56 | 57 | 'timezone' => 'UTC', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Application Locale Configuration 62 | |-------------------------------------------------------------------------- 63 | | 64 | | The application locale determines the default locale that will be used 65 | | by the translation service provider. You are free to set this value 66 | | to any of the locales which will be supported by the application. 67 | | 68 | */ 69 | 70 | 'locale' => 'en', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Application Fallback Locale 75 | |-------------------------------------------------------------------------- 76 | | 77 | | The fallback locale determines the locale to use when the current one 78 | | is not available. You may change the value to correspond to any of 79 | | the language folders that are provided through your application. 80 | | 81 | */ 82 | 83 | 'fallback_locale' => 'en', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Encryption Key 88 | |-------------------------------------------------------------------------- 89 | | 90 | | This key is used by the Illuminate encrypter service and should be set 91 | | to a random, 32 character string, otherwise these encrypted strings 92 | | will not be safe. Please do this before deploying an application! 93 | | 94 | */ 95 | 96 | 'key' => env('APP_KEY', 'SomeRandomString'), 97 | 98 | 'cipher' => 'AES-256-CBC', 99 | 100 | /* 101 | |-------------------------------------------------------------------------- 102 | | Logging Configuration 103 | |-------------------------------------------------------------------------- 104 | | 105 | | Here you may configure the log settings for your application. Out of 106 | | the box, Laravel uses the Monolog PHP logging library. This gives 107 | | you a variety of powerful log handlers / formatters to utilize. 108 | | 109 | | Available Settings: "single", "daily", "syslog", "errorlog" 110 | | 111 | */ 112 | 113 | 'log' => 'daily', 114 | 115 | 'log_level' => env('APP_LOG_LEVEL', 'debug'), 116 | 117 | /* 118 | |-------------------------------------------------------------------------- 119 | | Autoloaded Service Providers 120 | |-------------------------------------------------------------------------- 121 | | 122 | | The service providers listed here will be automatically loaded on the 123 | | request to your application. Feel free to add your own services to 124 | | this array to grant expanded functionality to your applications. 125 | | 126 | */ 127 | 128 | 'providers' => [ 129 | 130 | /* 131 | * Laravel Framework Service Providers... 132 | */ 133 | Illuminate\Auth\AuthServiceProvider::class, 134 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 135 | Illuminate\Bus\BusServiceProvider::class, 136 | Illuminate\Cache\CacheServiceProvider::class, 137 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 138 | Illuminate\Cookie\CookieServiceProvider::class, 139 | Illuminate\Database\DatabaseServiceProvider::class, 140 | Illuminate\Encryption\EncryptionServiceProvider::class, 141 | Illuminate\Filesystem\FilesystemServiceProvider::class, 142 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 143 | Illuminate\Hashing\HashServiceProvider::class, 144 | Illuminate\Mail\MailServiceProvider::class, 145 | Illuminate\Notifications\NotificationServiceProvider::class, 146 | Illuminate\Pagination\PaginationServiceProvider::class, 147 | Illuminate\Pipeline\PipelineServiceProvider::class, 148 | Illuminate\Queue\QueueServiceProvider::class, 149 | Illuminate\Redis\RedisServiceProvider::class, 150 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 151 | Illuminate\Session\SessionServiceProvider::class, 152 | Laravel\Tinker\TinkerServiceProvider::class, 153 | Illuminate\Translation\TranslationServiceProvider::class, 154 | Illuminate\Validation\ValidationServiceProvider::class, 155 | Illuminate\View\ViewServiceProvider::class, 156 | 157 | /* 158 | * Application Service Providers... 159 | */ 160 | App\Providers\AppServiceProvider::class, 161 | // App\Providers\BroadcastServiceProvider::class, 162 | App\Providers\AuthServiceProvider::class, 163 | App\Providers\EventServiceProvider::class, 164 | App\Providers\RouteServiceProvider::class, 165 | Laravel\Socialite\SocialiteServiceProvider::class, 166 | Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider::class, 167 | ], 168 | 169 | /* 170 | |-------------------------------------------------------------------------- 171 | | Class Aliases 172 | |-------------------------------------------------------------------------- 173 | | 174 | | This array of class aliases will be registered when this application 175 | | is started. However, feel free to register as many as you wish as 176 | | the aliases are "lazy" loaded so they don't hinder performance. 177 | | 178 | */ 179 | 180 | 'aliases' => [ 181 | 'App' => Illuminate\Support\Facades\App::class, 182 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 183 | 'Auth' => Illuminate\Support\Facades\Auth::class, 184 | 'Blade' => Illuminate\Support\Facades\Blade::class, 185 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 186 | 'Bus' => Illuminate\Support\Facades\Bus::class, 187 | 'Cache' => Illuminate\Support\Facades\Cache::class, 188 | 'Config' => Illuminate\Support\Facades\Config::class, 189 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 190 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 191 | 'DB' => Illuminate\Support\Facades\DB::class, 192 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 193 | 'Event' => Illuminate\Support\Facades\Event::class, 194 | 'File' => Illuminate\Support\Facades\File::class, 195 | 'Gate' => Illuminate\Support\Facades\Gate::class, 196 | 'Hash' => Illuminate\Support\Facades\Hash::class, 197 | 'Inspiring' => Illuminate\Foundation\Inspiring::class, 198 | 'Lang' => Illuminate\Support\Facades\Lang::class, 199 | 'Log' => Illuminate\Support\Facades\Log::class, 200 | 'Mail' => Illuminate\Support\Facades\Mail::class, 201 | 'Notification' => Illuminate\Support\Facades\Notification::class, 202 | 'Password' => Illuminate\Support\Facades\Password::class, 203 | 'Queue' => Illuminate\Support\Facades\Queue::class, 204 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 205 | 'Redis' => Illuminate\Support\Facades\Redis::class, 206 | 'Request' => Illuminate\Support\Facades\Request::class, 207 | 'Response' => Illuminate\Support\Facades\Response::class, 208 | 'Route' => Illuminate\Support\Facades\Route::class, 209 | 'Schema' => Illuminate\Support\Facades\Schema::class, 210 | 'Session' => Illuminate\Support\Facades\Session::class, 211 | 'Storage' => Illuminate\Support\Facades\Storage::class, 212 | 'URL' => Illuminate\Support\Facades\URL::class, 213 | 'Validator' => Illuminate\Support\Facades\Validator::class, 214 | 'View' => Illuminate\Support\Facades\View::class, 215 | 'Socialite' => Laravel\Socialite\Facades\Socialite::class, 216 | 'Bugsnag' => Bugsnag\BugsnagLaravel\BugsnagFacade::class, 217 | ], 218 | 219 | ]; 220 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 44 | 'api' => [ 45 | 'driver' => 'token', 46 | 'provider' => 'users', 47 | ], 48 | ], 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | User Providers 53 | |-------------------------------------------------------------------------- 54 | | 55 | | All authentication drivers have a user provider. This defines how the 56 | | users are actually retrieved out of your database or other storage 57 | | mechanisms used by this application to persist your user's data. 58 | | 59 | | If you have multiple user tables or models you may configure multiple 60 | | sources which represent each model / table. These sources may then 61 | | be assigned to any extra authentication guards you have defined. 62 | | 63 | | Supported: "database", "eloquent" 64 | | 65 | */ 66 | 67 | 'providers' => [ 68 | 'users' => [ 69 | 'driver' => 'eloquent', 70 | 'model' => App\User::class, 71 | ], 72 | 73 | // 'users' => [ 74 | // 'driver' => 'database', 75 | // 'table' => 'users', 76 | // ], 77 | ], 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Resetting Passwords 82 | |-------------------------------------------------------------------------- 83 | | 84 | | You may specify multiple password reset configurations if you have more 85 | | than one user table or model in the application and you want to have 86 | | separate password reset settings based on the specific user types. 87 | | 88 | | The expire time is the number of minutes that the reset token should be 89 | | considered valid. This security feature keeps tokens short-lived so 90 | | they have less time to be guessed. You may change this as needed. 91 | | 92 | */ 93 | 94 | 'passwords' => [ 95 | 'users' => [ 96 | 'provider' => 'users', 97 | 'table' => 'password_resets', 98 | 'expire' => 60, 99 | ], 100 | ], 101 | 102 | ]; 103 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | 'null' => [ 53 | 'driver' => 'null', 54 | ], 55 | 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /config/bugsnag.php: -------------------------------------------------------------------------------- 1 | env('BUGSNAG_API_KEY', ''), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Notify Release Stages 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Set which release stages should send notifications to Bugsnag. 24 | | 25 | | Example: array('development', 'production') 26 | | 27 | */ 28 | 'notify_release_stages' => env('BUGSNAG_NOTIFY_RELEASE_STAGES', null), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Endpoint 33 | |-------------------------------------------------------------------------- 34 | | 35 | | Set what server the Bugsnag notifier should send errors to. By default 36 | | this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise 37 | | this should be the URL to your Bugsnag instance. 38 | | 39 | */ 40 | 'endpoint' => env('BUGSNAG_ENDPOINT', null), 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Filters 45 | |-------------------------------------------------------------------------- 46 | | 47 | | Use this if you want to ensure you don't send sensitive data such as 48 | | passwords, and credit card numbers to our servers. Any keys which 49 | | contain these strings will be filtered. 50 | | 51 | */ 52 | 'filters' => env('BUGSNAG_FILTERS', ['password']), 53 | 54 | /* 55 | |-------------------------------------------------------------------------- 56 | | Proxy 57 | |-------------------------------------------------------------------------- 58 | | 59 | | If your server is behind a proxy server, you can configure this as well. 60 | | Other than the host, none of these settings are mandatory. 61 | | 62 | | Note: Proxy configuration is only possible if the PHP cURL extension 63 | | is installed. 64 | | 65 | | Example: 66 | | 67 | | 'proxy' => array( 68 | | 'host' => 'bugsnag.com', 69 | | 'port' => 42, 70 | | 'user' => 'username', 71 | | 'password' => 'password123' 72 | | ) 73 | | 74 | */ 75 | 'proxy' => env('BUGSNAG_PROXY', null), 76 | 77 | ]; 78 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache/data'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => 'laravel', 90 | 91 | ]; 92 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Database Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here are each of the database connections setup for your application. 24 | | Of course, examples of configuring each database platform that is 25 | | supported by Laravel is shown below to make development simple. 26 | | 27 | | 28 | | All database work in Laravel is done through the PHP PDO facilities 29 | | so make sure you have the driver for your particular database of 30 | | choice installed on your machine before you begin development. 31 | | 32 | */ 33 | 34 | 'connections' => [ 35 | 36 | 'sqlite' => [ 37 | 'driver' => 'sqlite', 38 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 39 | 'prefix' => '', 40 | ], 41 | 42 | 'mysql' => [ 43 | 'driver' => 'mysql', 44 | 'host' => env('DB_HOST', '127.0.0.1'), 45 | 'port' => env('DB_PORT', '3306'), 46 | 'database' => env('DB_DATABASE', 'forge'), 47 | 'username' => env('DB_USERNAME', 'forge'), 48 | 'password' => env('DB_PASSWORD', ''), 49 | 'unix_socket' => env('DB_SOCKET', ''), 50 | 'charset' => 'utf8mb4', 51 | 'collation' => 'utf8mb4_unicode_ci', 52 | 'prefix' => '', 53 | 'strict' => false, 54 | 'engine' => null, 55 | ], 56 | 57 | 'pgsql' => [ 58 | 'driver' => 'pgsql', 59 | 'host' => env('DB_HOST', '127.0.0.1'), 60 | 'port' => env('DB_PORT', '5432'), 61 | 'database' => env('DB_DATABASE', 'forge'), 62 | 'username' => env('DB_USERNAME', 'forge'), 63 | 'password' => env('DB_PASSWORD', ''), 64 | 'charset' => 'utf8', 65 | 'prefix' => '', 66 | 'schema' => 'public', 67 | 'sslmode' => 'prefer', 68 | ], 69 | 70 | 'sqlsrv' => [ 71 | 'driver' => 'sqlsrv', 72 | 'host' => env('DB_HOST', 'localhost'), 73 | 'port' => env('DB_PORT', '1433'), 74 | 'database' => env('DB_DATABASE', 'forge'), 75 | 'username' => env('DB_USERNAME', 'forge'), 76 | 'password' => env('DB_PASSWORD', ''), 77 | 'charset' => 'utf8', 78 | 'prefix' => '', 79 | ], 80 | 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Migration Repository Table 86 | |-------------------------------------------------------------------------- 87 | | 88 | | This table keeps track of all the migrations that have already run for 89 | | your application. Using this information, we can determine which of 90 | | the migrations on disk haven't actually been run in the database. 91 | | 92 | */ 93 | 94 | 'migrations' => 'migrations', 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Redis Databases 99 | |-------------------------------------------------------------------------- 100 | | 101 | | Redis is an open source, fast, and advanced key-value store that also 102 | | provides a richer set of commands than a typical key-value systems 103 | | such as APC or Memcached. Laravel makes it easy to dig right in. 104 | | 105 | */ 106 | 107 | 'redis' => [ 108 | 109 | 'client' => 'predis', 110 | 111 | 'default' => [ 112 | 'host' => env('REDIS_HOST', '127.0.0.1'), 113 | 'password' => env('REDIS_PASSWORD', null), 114 | 'port' => env('REDIS_PORT', 6379), 115 | 'database' => 0, 116 | ], 117 | 118 | ], 119 | 120 | ]; 121 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "s3", "rackspace" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_KEY'), 61 | 'secret' => env('AWS_SECRET'), 62 | 'region' => env('AWS_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | ], 65 | 66 | ], 67 | 68 | ]; 69 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Log Channels 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the log channels for your application. Out of 26 | | the box, Laravel uses the Monolog PHP logging library. This gives 27 | | you a variety of powerful log handlers / formatters to utilize. 28 | | 29 | | Available Drivers: "single", "daily", "slack", "syslog", 30 | | "errorlog", "monolog", 31 | | "custom", "stack" 32 | | 33 | */ 34 | 35 | 'channels' => [ 36 | 'stack' => [ 37 | 'driver' => 'stack', 38 | 'channels' => ['single'], 39 | ], 40 | 41 | 'single' => [ 42 | 'driver' => 'single', 43 | 'path' => storage_path('logs/laravel.log'), 44 | 'level' => 'debug', 45 | ], 46 | 47 | 'daily' => [ 48 | 'driver' => 'daily', 49 | 'path' => storage_path('logs/laravel.log'), 50 | 'level' => 'debug', 51 | 'days' => 7, 52 | ], 53 | 54 | 'slack' => [ 55 | 'driver' => 'slack', 56 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 57 | 'username' => 'Laravel Log', 58 | 'emoji' => ':boom:', 59 | 'level' => 'critical', 60 | ], 61 | 62 | 'stderr' => [ 63 | 'driver' => 'monolog', 64 | 'handler' => StreamHandler::class, 65 | 'with' => [ 66 | 'stream' => 'php://stderr', 67 | ], 68 | ], 69 | 70 | 'syslog' => [ 71 | 'driver' => 'syslog', 72 | 'level' => 'debug', 73 | ], 74 | 75 | 'errorlog' => [ 76 | 'driver' => 'errorlog', 77 | 'level' => 'debug', 78 | ], 79 | ], 80 | 81 | ]; 82 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => [ 59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 60 | 'name' => env('MAIL_FROM_NAME', 'Example'), 61 | ], 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | E-Mail Encryption Protocol 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Here you may specify the encryption protocol that should be used when 69 | | the application send e-mail messages. A sensible default using the 70 | | transport layer security protocol should provide great security. 71 | | 72 | */ 73 | 74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | SMTP Server Username 79 | |-------------------------------------------------------------------------- 80 | | 81 | | If your SMTP server requires a username for authentication, you should 82 | | set it here. This will get used to authenticate with your server on 83 | | connection. You may also set the "password" value below this one. 84 | | 85 | */ 86 | 87 | 'username' => env('MAIL_USERNAME'), 88 | 89 | 'password' => env('MAIL_PASSWORD'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Sendmail System Path 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using the "sendmail" driver to send e-mails, we will need to know 97 | | the path to where Sendmail lives on this server. A default path has 98 | | been provided here, which will work well on most of your systems. 99 | | 100 | */ 101 | 102 | 'sendmail' => '/usr/sbin/sendmail -bs', 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Markdown Mail Settings 107 | |-------------------------------------------------------------------------- 108 | | 109 | | If you are using Markdown based email rendering, you may configure your 110 | | theme and component paths here, allowing you to customize the design 111 | | of the emails. Or, you may simply stick with the Laravel defaults! 112 | | 113 | */ 114 | 115 | 'markdown' => [ 116 | 'theme' => 'default', 117 | 118 | 'paths' => [ 119 | resource_path('views/vendor/mail'), 120 | ], 121 | ], 122 | 123 | ]; 124 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => 'your-public-key', 54 | 'secret' => 'your-secret-key', 55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 56 | 'queue' => 'your-queue-name', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | // @todo: merge these! 19 | // Socialite 20 | 'client_id' => env('TWITTER_CONSUMER_KEY'), 21 | 'client_secret' => env('TWITTER_CONSUMER_SECRET'), 22 | 'redirect' => env('TWITTER_URL'), 23 | 24 | // Other 25 | 'consumer_key' => env('TWITTER_CONSUMER_KEY'), 26 | 'consumer_secret' => env('TWITTER_CONSUMER_SECRET'), 27 | 'access_token' => env('TWITTER_ACCESS_TOKEN'), 28 | 'access_secret' => env('TWITTER_ACCESS_TOKEN_SECRET'), 29 | ], 30 | 31 | 'mailgun' => [ 32 | 'domain' => env('MAILGUN_DOMAIN'), 33 | 'secret' => env('MAILGUN_SECRET'), 34 | ], 35 | 36 | 'mandrill' => [ 37 | 'secret' => env('MANDRILL_SECRET'), 38 | ], 39 | 40 | 'ses' => [ 41 | 'key' => env('SES_KEY'), 42 | 'secret' => env('SES_SECRET'), 43 | 'region' => 'us-east-1', 44 | ], 45 | 46 | 'sparkpost' => [ 47 | 'secret' => env('SPARKPOST_SECRET'), 48 | ], 49 | 50 | 'stripe' => [ 51 | 'model' => App\User::class, 52 | 'key' => env('STRIPE_KEY'), 53 | 'secret' => env('STRIPE_SECRET'), 54 | ], 55 | ]; 56 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path('framework/sessions'), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cache Store 91 | |-------------------------------------------------------------------------- 92 | | 93 | | When using the "apc" or "memcached" session drivers, you may specify a 94 | | cache store that should be used for these sessions. This value must 95 | | correspond with one of the application's configured cache stores. 96 | | 97 | */ 98 | 99 | 'store' => null, 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Sweeping Lottery 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Some session drivers must manually sweep their storage location to get 107 | | rid of old sessions from storage. Here are the chances that it will 108 | | happen on a given request. By default, the odds are 2 out of 100. 109 | | 110 | */ 111 | 112 | 'lottery' => [2, 100], 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Name 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the name of the cookie used to identify a session 120 | | instance by ID. The name specified here will get used every time a 121 | | new session cookie is created by the framework for every driver. 122 | | 123 | */ 124 | 125 | 'cookie' => 'laravel_session', 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Session Cookie Path 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The session cookie path determines the path for which the cookie will 133 | | be regarded as available. Typically, this will be the root path of 134 | | your application but you are free to change this when necessary. 135 | | 136 | */ 137 | 138 | 'path' => '/', 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | Session Cookie Domain 143 | |-------------------------------------------------------------------------- 144 | | 145 | | Here you may change the domain of the cookie used to identify a session 146 | | in your application. This will determine which domains the cookie is 147 | | available to in your application. A sensible default has been set. 148 | | 149 | */ 150 | 151 | 'domain' => env('SESSION_DOMAIN', null), 152 | 153 | /* 154 | |-------------------------------------------------------------------------- 155 | | HTTPS Only Cookies 156 | |-------------------------------------------------------------------------- 157 | | 158 | | By setting this option to true, session cookies will only be sent back 159 | | to the server if the browser has a HTTPS connection. This will keep 160 | | the cookie from being sent to you if it can not be done securely. 161 | | 162 | */ 163 | 164 | 'secure' => env('SESSION_SECURE_COOKIE', false), 165 | 166 | /* 167 | |-------------------------------------------------------------------------- 168 | | HTTP Access Only 169 | |-------------------------------------------------------------------------- 170 | | 171 | | Setting this value to true will prevent JavaScript from accessing the 172 | | value of the cookie and the cookie will only be accessible through 173 | | the HTTP protocol. You are free to modify this option if needed. 174 | | 175 | */ 176 | 177 | 'http_only' => true, 178 | 179 | ]; 180 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /confomo-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tighten/confomo/b4741c174758becae3d1cf323d052fa18ac06b80/confomo-logo.png -------------------------------------------------------------------------------- /contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing to ConFOMO 2 | 3 | This project follows the [PSR-1](http://www.php-fig.org/psr/psr-1/) and [PSR-2](http://www.php-fig.org/psr/psr-2/) coding styles. 4 | 5 | It follows a few conventions in addition to the recommendations set out in these style guides. 6 | 7 | * Logical NOT (!) operators should have a single character of whitespace after them 8 | 9 | ```php 10 | if (! $condition) 11 | // rather than 12 | if (!$condition) 13 | ``` 14 | 15 | * Multi-line arrays should have a trailing comma 16 | 17 | ```php 18 | $array = [ 19 | 'value1', 20 | 'value2', 21 | 'finalvalue', 22 | ]; 23 | ``` 24 | 25 | * Single arrays should not have a trailing comma 26 | 27 | ```php 28 | $array = ['value1', 'value2', 'value3']; 29 | ``` 30 | 31 | * Order use statements alphabetically 32 | * Remove lines between use statements 33 | * Return statements should be preceded by an empty line feed 34 | * PHP arrays should use the PHP 5.4 short-syntax (`[...]` rather than `array(...)`) 35 | * Short scalar casting (use `bool`, `int` rather than `boolean`, `integer` and `float` rather than `double` or `real`) 36 | * Arrays should be formatted like function / method arguments; that is, without leading or trailing whitespace 37 | * Don't align double arrows (in associative arrays) 38 | * Don't align equals symbols 39 | * Remove unused use statements 40 | 41 | A [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) configuration file (`.php_cs`) is included in this repository. 42 | 43 | You can apply the rules manually, or by adding our simple `pre-commit` git hook with the commands below. 44 | 45 | ```bash 46 | chmod +x .githooks/pre-commit 47 | ln -sf ../../.githooks/pre-commit .git/hooks/pre-commit 48 | ``` 49 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 15 | return [ 16 | 'name' => $faker->name, 17 | 'twitter_id' => $faker->randomNumber, 18 | ]; 19 | }); 20 | 21 | $factory->define(App\Conference::class, function (Faker\Generator $faker) { 22 | return [ 23 | 'name' => $faker->sentence, 24 | 'start_date' => $faker->date(), 25 | 'end_date' => $faker->date(), 26 | 'slug' => str_random(16), 27 | ]; 28 | }); 29 | 30 | $factory->define(App\Friend::class, function (Faker\Generator $faker) { 31 | return [ 32 | 'username' => $faker->word, 33 | 'type' => 'new', 34 | 'met' => false, 35 | ]; 36 | }); 37 | 38 | $factory->define(App\Tweeter::class, function (Faker\Generator $faker) { 39 | return [ 40 | 'name' => $faker->name, 41 | 'location' => $faker->address, 42 | 'description' => $faker->sentence, 43 | 'url' => $faker->url, 44 | 'url_display' => $faker->url, 45 | ]; 46 | }); 47 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tighten/confomo/b4741c174758becae3d1cf323d052fa18ac06b80/database/migrations/.gitkeep -------------------------------------------------------------------------------- /database/migrations/2014_03_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name'); 18 | $table->string('twitter_id'); 19 | $table->rememberToken(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('users'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token')->index(); 19 | $table->timestamp('created_at'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2015_10_21_180012_create_conferences_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name'); 18 | $table->integer('user_id')->unsigned(); 19 | $table->string('slug')->unique(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('conferences'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2015_10_21_185419_create_friends_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('conference_id')->unsigned(); 18 | $table->string('username'); 19 | $table->string('type'); 20 | $table->boolean('met')->default(false); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('friends'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2016_07_10_080623_add_dates_to_conferences.php: -------------------------------------------------------------------------------- 1 | date('start_date')->nullable()->default(null)->after('user_id'); 15 | $table->date('end_date')->nullable()->default(null)->after('start_date'); 16 | }); 17 | } 18 | 19 | /** 20 | * Reverse the migrations. 21 | */ 22 | public function down() 23 | { 24 | Schema::table('conferences', function (Blueprint $table) { 25 | $table->dropColumn(['start_date', 'end_date']); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /database/migrations/2016_07_16_115232_add_introduction_to_friends.php: -------------------------------------------------------------------------------- 1 | boolean('introduction')->default(false)->after('met'); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('friends', function (Blueprint $table) { 28 | $table->dropColumn('introduction'); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2016_09_01_125807_add_name_location_url_to_friends.php: -------------------------------------------------------------------------------- 1 | string('name')->nullable(); 17 | $table->string('location')->nullable(); 18 | $table->string('url')->nullable(); 19 | $table->string('url_display')->nullable(); 20 | $table->string('description')->nullable(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::table('friends', function (Blueprint $table) { 32 | $table->dropColumn(['name', 'location', 'url', 'url_display', 'description']); 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2017_06_08_195223_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->text('connection'); 18 | $table->text('queue'); 19 | $table->longText('payload'); 20 | $table->timestamp('failed_at'); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('failed_jobs'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2017_07_07_141355_create_tweeters_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('username'); 18 | $table->string('name')->nullable(); 19 | $table->string('location')->nullable(); 20 | $table->string('url')->nullable(); 21 | $table->string('url_display')->nullable(); 22 | $table->string('description')->nullable(); 23 | $table->timestamps(); 24 | }); 25 | 26 | Schema::table('friends', function (Blueprint $table) { 27 | $table->dropColumn(['name', 'location', 'url', 'url_display', 'description']); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::drop('tweeters'); 39 | 40 | Schema::table('friends', function (Blueprint $table) { 41 | $table->string('name')->nullable(); 42 | $table->string('location')->nullable(); 43 | $table->string('url')->nullable(); 44 | $table->string('url_display')->nullable(); 45 | $table->string('description')->nullable(); 46 | }); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /database/migrations/2017_07_10_150510_shift_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | longText('exception')->nullable(); 18 | }); 19 | 20 | Schema::table('failed_jobs', function (Blueprint $table) { 21 | $table->longText('exception')->nullable(false)->change(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::table('failed_jobs', function (Blueprint $table) { 33 | $table->dropColumn('exception'); 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2017_07_14_152816_change_created_at_to_nullable_on_password_resets_table.php: -------------------------------------------------------------------------------- 1 | timestamp('created_at')->nullable()->change(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('password_resets', function (Blueprint $table) { 29 | $table->timestamp('created_at')->nullable(false)->change(); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2017_07_19_162718_add_username_to_users_table.php: -------------------------------------------------------------------------------- 1 | string('username')->nullable()->default(null)->after('twitter_id'); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | // 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tighten/confomo/b4741c174758becae3d1cf323d052fa18ac06b80/database/seeds/.gitkeep -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | faker = $faker; 13 | } 14 | 15 | /** 16 | * Run the database seeds. 17 | * 18 | * @return void 19 | */ 20 | public function run() 21 | { 22 | Model::unguard(); 23 | 24 | DB::table('users')->insert([ 25 | 'name' => $this->faker->name, 26 | 'twitter_id' => str_random(10), 27 | ]); 28 | 29 | Model::reguard(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var elixir = require('laravel-elixir'); 2 | 3 | require('laravel-elixir-vueify'); 4 | 5 | /* 6 | |-------------------------------------------------------------------------- 7 | | Elixir Asset Management 8 | |-------------------------------------------------------------------------- 9 | | 10 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 11 | | for your Laravel application. By default, we are compiling the Sass 12 | | file for our application, as well as publishing vendor resources. 13 | | 14 | */ 15 | 16 | elixir(function(mix) { 17 | mix.sass('app.scss') 18 | .browserify('app.js'); 19 | }); 20 | -------------------------------------------------------------------------------- /helpers.php: -------------------------------------------------------------------------------- 1 | subDay(); 6 | } 7 | } 8 | 9 | if (! function_exists('abort_if')) { 10 | /** 11 | * Throw an HttpException with the given data if the given condition is true. 12 | * 13 | * @param bool $boolean 14 | * @param int $code 15 | * @param string $message 16 | * @param array $headers 17 | * @return void 18 | * 19 | * @throws \Symfony\Component\HttpKernel\Exception\HttpException 20 | * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException 21 | */ 22 | function abort_if($boolean, $code, $message = '', array $headers = []) 23 | { 24 | if ($boolean) { 25 | abort($code, $message, $headers); 26 | } 27 | } 28 | } 29 | 30 | if (! function_exists('abort_unless')) { 31 | /** 32 | * Throw an HttpException with the given data unless the given condition is true. 33 | * 34 | * @param bool $boolean 35 | * @param int $code 36 | * @param string $message 37 | * @param array $headers 38 | * @return void 39 | * 40 | * @throws \Symfony\Component\HttpKernel\Exception\HttpException 41 | * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException 42 | */ 43 | function abort_unless($boolean, $code, $message = '', array $headers = []) 44 | { 45 | if (! $boolean) { 46 | abort($code, $message, $headers); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /nitpick.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignore": [ 3 | "tests/*", 4 | "database/*" 5 | ] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /notes.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Features 4 | - Mark a new Friend as met 5 | - Mark an old Friend as to-meet 6 | - Suggest a new Friend to mark as met 7 | - Suggest an old friend to mark as to-meet 8 | 9 | Scenarios 10 | - Given that I am at a conference 11 | When I meet a new friend 12 | Then that person is marked as met 13 | - Given that I am at a conference 14 | When I meet an online friend 15 | Then that person is marked as met 16 | - Given that I'm preparing to attend a conference 17 | When I want to meet an online friend 18 | Then that person is added to my list of friends to meet -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "prod": "gulp --production", 5 | "dev": "gulp watch" 6 | }, 7 | "devDependencies": { 8 | "gulp": "^3.9.1" 9 | }, 10 | "dependencies": { 11 | "bootstrap-sass": "^3.4.1", 12 | "laravel-elixir": "^6.0.0-18", 13 | "laravel-elixir-vueify": "^1.0.2", 14 | "sweetalert": "^1.1.3", 15 | "underscore": "^1.12.1", 16 | "vue-resource": "^0.7.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /phpspec.yml: -------------------------------------------------------------------------------- 1 | suites: 2 | main: 3 | namespace: App 4 | psr4_prefix: App 5 | src_path: app -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests 14 | 15 | 16 | 17 | 18 | ./app 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /public/assets/img/cache/twitter_profile_pics/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tighten/confomo/b4741c174758becae3d1cf323d052fa18ac06b80/public/assets/img/cache/twitter_profile_pics/.gitkeep -------------------------------------------------------------------------------- /public/assets/img/confomo-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tighten/confomo/b4741c174758becae3d1cf323d052fa18ac06b80/public/assets/img/confomo-logo.png -------------------------------------------------------------------------------- /public/assets/img/confomo-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tighten/confomo/b4741c174758becae3d1cf323d052fa18ac06b80/public/assets/img/confomo-screenshot.png -------------------------------------------------------------------------------- /public/assets/img/default_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tighten/confomo/b4741c174758becae3d1cf323d052fa18ac06b80/public/assets/img/default_avatar.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tighten/confomo/b4741c174758becae3d1cf323d052fa18ac06b80/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels nice to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ![ConFOMO logo](https://raw.githubusercontent.com/tightenco/confomo/master/confomo-logo.png) 2 | 3 | [![Run tests](https://github.com/tighten/takeout/workflows/Run%20tests/badge.svg?branch=main)](https://github.com/tighten/confomo/actions?query=workflow%3A%22Run+Tests%22) 4 | 5 | ### Connecting your online community with the real world, one conference at a time. 6 | 7 | Built in 4 hours to help me track who I wanted to meet at Laracon 2014, and who I met there who I didn't know yet. 8 | 9 | Updated for Laravel 5.1 and Vue in 2015/2016. @michaeldyrynda did most of the hard work there, and we documented it [on a podcast](http://rebuilding.confomo.com/). 10 | 11 | ### Requirements 12 | 13 | - PHP = 7.4 14 | - Composer 15 | - Node and npm 16 | 17 | ### Installation 18 | 19 | 1. [Fork this repository](https://help.github.com/articles/fork-a-repo/) (optional). 20 | 1. Clone the repository locally. 21 | 1. Install dependencies with `composer install`. 22 | 1. Copy [`.env.example`](https://github.com/tightenco/confomo/blob/master/.env.example) to `.env` and modify its contents to reflect your local environment. 23 | 1. Generate an application key with `php artisan key:generate`. 24 | 1. Migrate the database with `php artisan migrate`. 25 | 1. Install frontend dependencies with `npm install`. 26 | 1. Build and watch frontend assets with `npm run dev`. 27 | 1. Configure a web server, such as the built-in PHP web server, to serve the site using the `public` directory as the document root: `php -S localhost:8080 -t public`. 28 | 1. Run tests with `vendor/bin/phpunit`. 29 | 30 | ### Contributing 31 | 32 | Submit an issue for bugs or feature requests, or submit a PR against the `master` branch. 33 | 34 | ![ConFOMO screenshot](public/assets/img/confomo-screenshot.png) 35 | 36 | ### License 37 | 38 | Not sure. Don't steal it? Let's call it MIT for today. 39 | -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | // Core Application Dependencies... 2 | require('./core/dependencies'); 3 | 4 | Vue.config.debug = true; 5 | 6 | import Dashboard from './components/Dashboard.vue'; 7 | import Conference from './components/Conference.vue'; 8 | import ConferenceIntroduction from './components/ConferenceIntroduction.vue'; 9 | 10 | // Global Errors Component... 11 | Vue.component('form-errors', require('./components/FormErrors.vue')); 12 | 13 | Vue.mixin({ 14 | methods: { 15 | // Flatten errors and set them on the given form 16 | setErrorsOnForm: function (form, errors) { 17 | if (typeof errors === 'object') { 18 | form.errors = _.flatten(_.toArray(errors)); 19 | } else { 20 | form.errors.push('Something went wrong. Please try again.'); 21 | } 22 | } 23 | } 24 | }); 25 | 26 | if (document.getElementById("confomo-app")) { 27 | new Vue({ 28 | el: '#confomo-app', 29 | 30 | components: { 31 | Dashboard, 32 | Conference, 33 | ConferenceIntroduction 34 | } 35 | }); 36 | } 37 | -------------------------------------------------------------------------------- /resources/assets/js/components/Conference.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 26 | -------------------------------------------------------------------------------- /resources/assets/js/components/ConferenceIntroduction.vue: -------------------------------------------------------------------------------- 1 | 45 | 46 | 90 | -------------------------------------------------------------------------------- /resources/assets/js/components/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 91 | 92 | 198 | -------------------------------------------------------------------------------- /resources/assets/js/components/FormErrors.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 22 | -------------------------------------------------------------------------------- /resources/assets/js/components/FriendDetails.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 40 | -------------------------------------------------------------------------------- /resources/assets/js/components/FriendsList.vue: -------------------------------------------------------------------------------- 1 | 93 | 94 | 178 | -------------------------------------------------------------------------------- /resources/assets/js/core/dependencies.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Load Vue & Vue-Resource. 3 | */ 4 | window.Vue = require('vue'); 5 | 6 | Vue.use(require('vue-resource')); 7 | Vue.http.headers.common['X-CSRF-TOKEN'] = Confomo.csrfToken; 8 | 9 | /* 10 | * Load Underscore.js, used for map / reduce on arrays. 11 | */ 12 | window._ = require('underscore'); 13 | 14 | require('sweetalert/lib/sweetalert'); 15 | -------------------------------------------------------------------------------- /resources/assets/js/utils/EventListener.js: -------------------------------------------------------------------------------- 1 | const EventListener = { 2 | /** 3 | * Stolen from Vue-strap. 4 | * 5 | * Listen to DOM events during the bubble phase. 6 | * 7 | * @param {DOMEventTarget} target DOM element to register listener on. 8 | * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. 9 | * @param {function} callback Callback function. 10 | * @return {object} Object with a `remove` method. 11 | */ 12 | listen(target, eventType, callback) { 13 | if (target.addEventListener) { 14 | target.addEventListener(eventType, callback, false) 15 | return { 16 | remove() { 17 | target.removeEventListener(eventType, callback, false) 18 | } 19 | } 20 | } else if (target.attachEvent) { 21 | target.attachEvent('on' + eventType, callback) 22 | return { 23 | remove() { 24 | target.detachEvent('on' + eventType, callback) 25 | } 26 | } 27 | } 28 | } 29 | } 30 | 31 | export default EventListener 32 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | $font-family-sans-serif: 'Lato'; 2 | $navbar-height: 65px; 3 | $navbar-default-bg: #fff; 4 | $navbar-padding-vertical: 3px; 5 | 6 | @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 7 | @import "node_modules/sweetalert/dist/sweetalert"; 8 | 9 | body { 10 | font-weight: 300; 11 | } 12 | 13 | h1, h2 { 14 | margin-bottom: 20px; 15 | text-align: center; 16 | } 17 | 18 | img { 19 | max-width: 100%; 20 | } 21 | 22 | .fa-btn { 23 | margin-right: 5px; 24 | } 25 | 26 | [v-cloak] { 27 | display: none; 28 | } 29 | 30 | /* Temp navbar hack because Bootstrap hates non-hamburger navs */ 31 | .logo { 32 | max-width: 40%; 33 | } 34 | 35 | .nav-buttons { 36 | float: right; 37 | min-width: 200px; 38 | text-align: right; 39 | } 40 | 41 | .nav-action-button { 42 | margin-top: 0.75em; 43 | } 44 | 45 | @media only screen and (min-width: 600px) { 46 | .nav-action-button { 47 | margin-top: 2em; 48 | } 49 | } 50 | 51 | .conference-button { 52 | border: 1px solid #eee; 53 | border-radius: 0.25em; 54 | cursor: pointer; 55 | margin-bottom: 1em; 56 | margin-top: 0; 57 | overflow: auto; 58 | padding: 0.75em; 59 | 60 | &:hover { 61 | background-color: $brand-primary; 62 | color: #fff; 63 | } 64 | } 65 | 66 | .conference-delete-button { 67 | margin-left: 1em; 68 | } 69 | 70 | .friends { 71 | margin-bottom: 20px; 72 | } 73 | 74 | .friend { 75 | border: 1px solid $gray-lighter; 76 | border-radius: $border-radius-base; 77 | display: block; 78 | margin: 5px 0; 79 | } 80 | 81 | .friend__avatar { 82 | background-color: $gray-lighter; 83 | float: left; 84 | padding: 10px; 85 | text-align: center; 86 | width: 25%; 87 | } 88 | 89 | .friend__body { 90 | float: left; 91 | padding: 10px; 92 | width: 75%; 93 | 94 | h4 { 95 | margin-top: 5px; 96 | font-size: 16px; 97 | } 98 | } 99 | 100 | .btn-danger.btn-inverse { 101 | background-color: $btn-default-bg; 102 | color: $brand-danger; 103 | } 104 | 105 | .btn-primary.btn-inverse { 106 | background-color: $btn-default-bg; 107 | color: $brand-primary; 108 | } 109 | 110 | .btn-success.btn-inverse { 111 | background-color: $btn-default-bg; 112 | color: $brand-success; 113 | } 114 | 115 | .landing p { 116 | font-size: 2em; 117 | margin-bottom: 1em; 118 | } 119 | 120 | .screenshot { 121 | border: 0.5em solid #eee; 122 | display: block; 123 | margin: 3em auto 0; 124 | width: 800px; 125 | } 126 | 127 | /* Friend Details Modal */ 128 | .friend-details-modal { 129 | text-align: center; 130 | width: 100%; 131 | 132 | img { 133 | margin-bottom: 20px; 134 | } 135 | 136 | p { 137 | margin-bottom: 10px; 138 | } 139 | 140 | span { 141 | color: #ccc; 142 | font-weight: 300; 143 | } 144 | } 145 | /* End Friend Details Modal */ 146 | 147 | @media screen and (max-width: $screen-sm-max) { 148 | .logo { 149 | margin-top: 5px; 150 | } 151 | 152 | .landing p { 153 | font-size: 1.5em; 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'alpha' => 'The :attribute may only contain letters.', 20 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', 21 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 22 | 'array' => 'The :attribute must be an array.', 23 | 'before' => 'The :attribute must be a date before :date.', 24 | 'between' => [ 25 | 'numeric' => 'The :attribute must be between :min and :max.', 26 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 27 | 'string' => 'The :attribute must be between :min and :max characters.', 28 | 'array' => 'The :attribute must have between :min and :max items.', 29 | ], 30 | 'boolean' => 'The :attribute field must be true or false.', 31 | 'confirmed' => 'The :attribute confirmation does not match.', 32 | 'date' => 'The :attribute is not a valid date.', 33 | 'date_format' => 'The :attribute does not match the format :format.', 34 | 'different' => 'The :attribute and :other must be different.', 35 | 'digits' => 'The :attribute must be :digits digits.', 36 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 37 | 'dimensions' => 'The :attribute has invalid image dimensions.', 38 | 'distinct' => 'The :attribute field has a duplicate value.', 39 | 'email' => 'The :attribute must be a valid email address.', 40 | 'exists' => 'The selected :attribute is invalid.', 41 | 'file' => 'The :attribute must be a file.', 42 | 'filled' => 'The :attribute field is required.', 43 | 'image' => 'The :attribute must be an image.', 44 | 'in' => 'The selected :attribute is invalid.', 45 | 'in_array' => 'The :attribute field does not exist in :other.', 46 | 'integer' => 'The :attribute must be an integer.', 47 | 'ip' => 'The :attribute must be a valid IP address.', 48 | 'json' => 'The :attribute must be a valid JSON string.', 49 | 'max' => [ 50 | 'numeric' => 'The :attribute may not be greater than :max.', 51 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 52 | 'string' => 'The :attribute may not be greater than :max characters.', 53 | 'array' => 'The :attribute may not have more than :max items.', 54 | ], 55 | 'mimes' => 'The :attribute must be a file of type: :values.', 56 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 57 | 'min' => [ 58 | 'numeric' => 'The :attribute must be at least :min.', 59 | 'file' => 'The :attribute must be at least :min kilobytes.', 60 | 'string' => 'The :attribute must be at least :min characters.', 61 | 'array' => 'The :attribute must have at least :min items.', 62 | ], 63 | 'not_in' => 'The selected :attribute is invalid.', 64 | 'numeric' => 'The :attribute must be a number.', 65 | 'present' => 'The :attribute field must be present.', 66 | 'regex' => 'The :attribute format is invalid.', 67 | 'required' => 'The :attribute field is required.', 68 | 'required_if' => 'The :attribute field is required when :other is :value.', 69 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 70 | 'required_with' => 'The :attribute field is required when :values is present.', 71 | 'required_with_all' => 'The :attribute field is required when :values is present.', 72 | 'required_without' => 'The :attribute field is required when :values is not present.', 73 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 74 | 'same' => 'The :attribute and :other must match.', 75 | 'size' => [ 76 | 'numeric' => 'The :attribute must be :size.', 77 | 'file' => 'The :attribute must be :size kilobytes.', 78 | 'string' => 'The :attribute must be :size characters.', 79 | 'array' => 'The :attribute must contain :size items.', 80 | ], 81 | 'string' => 'The :attribute must be a string.', 82 | 'timezone' => 'The :attribute must be a valid zone.', 83 | 'unique' => 'The :attribute has already been taken.', 84 | 'uploaded' => 'The :attribute failed to upload.', 85 | 'url' => 'The :attribute format is invalid.', 86 | 87 | /* 88 | |-------------------------------------------------------------------------- 89 | | Custom Validation Language Lines 90 | |-------------------------------------------------------------------------- 91 | | 92 | | Here you may specify custom validation messages for attributes using the 93 | | convention "attribute.rule" to name the lines. This makes it quick to 94 | | specify a specific custom language line for a given attribute rule. 95 | | 96 | */ 97 | 98 | 'custom' => [ 99 | 'attribute-name' => [ 100 | 'rule-name' => 'custom-message', 101 | ], 102 | ], 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Custom Validation Attributes 107 | |-------------------------------------------------------------------------- 108 | | 109 | | The following language lines are used to swap attribute place-holders 110 | | with something more reader friendly such as E-Mail Address instead 111 | | of "email". This simply helps us make messages a little cleaner. 112 | | 113 | */ 114 | 115 | 'attributes' => [], 116 | 117 | ]; 118 | -------------------------------------------------------------------------------- /resources/views/conferences/introduce.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | 8 |

9 | {{ $conference->user->name }} 10 | 11 | @if($conference->isUpcoming()) 12 | is going to {{ $conference->name }}. Would you like to meet? 13 | @elseif($conference->isInProgress()) 14 | is at {{ $conference->name }}. Have you met? 15 | @elseif($conference->isFinished()) 16 | went to {{ $conference->name }}. Did you meet? 17 | @endif 18 |

19 | 20 | @if (auth()->check()) 21 | @if(auth()->user()->owns($conference)) 22 | <- Back to conference dashboard 23 | @else 24 | <- Back to dashboard 25 | @endif 26 | @endif 27 | 28 |

29 | 30 | 31 |
32 | @endsection 33 | -------------------------------------------------------------------------------- /resources/views/conferences/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | 8 | 9 |

{{ $conference->name }}

10 | @if ($conference->start_date && $conference->end_date) 11 |
{{ $conference->start_date->format('M j, Y') }} - {{ $conference->end_date->format('M j, Y') }}
12 | @endif 13 | 14 | <- Back to dashboard 15 | 16 | @if (auth()->user()->owns($conference)) 17 | 18 | 26 | 27 | 28 | 29 | Public Introduction URL 30 | 31 | @endif 32 | 33 | 34 |
35 | @endsection 36 | -------------------------------------------------------------------------------- /resources/views/dashboard.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | 6 |
7 | @endsection 8 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Welcome to ConFOMO!

8 | 9 |

ConFOMO is a simple tool that makes it easy to track your friends at conferences.

10 | 11 |

With ConFOMO, you don't have to fear missing out; you can make a plan of friends you want to meet at a conference you're going to attend, track people you met at the conference, and even let your friends (new or old) "introduce" themselves to your ConFOMO list.

12 | 13 |

Sign up for free to try it now. Just hit "Login With Twitter" above.

14 | 15 | ConFOMO screenshot 16 |
17 |
18 |
19 | @endsection 20 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ConFOMO - Don't forget to meet your friends 10 | 11 | 12 | 13 | 14 | 15 | 16 | 40 | 41 | 42 | @include('partials.navbar') 43 | 44 | @yield('content') 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /resources/views/partials/navbar.blade.php: -------------------------------------------------------------------------------- 1 | 28 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tighten/confomo/b4741c174758becae3d1cf323d052fa18ac06b80/resources/views/vendor/.gitkeep -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | 'guest', function () { 4 | return view('home'); 5 | }]); 6 | 7 | Route::group(['middleware' => 'auth'], function () { 8 | Route::get('dashboard', function () { 9 | return view('dashboard'); 10 | }); 11 | 12 | Route::get('conferences/{conference}', 'ConferencesController@show'); 13 | }); 14 | 15 | Route::group(['prefix' => 'api', 'namespace' => 'API', 'middleware' => 'auth'], function () { 16 | Route::group(['prefix' => 'conferences'], function () { 17 | Route::get('/', 'ConferencesController@index'); 18 | Route::post('/', 'ConferencesController@store'); 19 | Route::delete('{conference}', 'ConferencesController@delete'); 20 | Route::group(['middleware' => 'owns-conference'], function () { 21 | Route::get('{conference}/new-friends', 'ConferenceNewFriendsController@index'); 22 | Route::post('{conference}/new-friends', 'ConferenceNewFriendsController@store'); 23 | Route::delete('{conference}/new-friends/{friend}', 'ConferenceNewFriendsController@delete'); 24 | Route::get('{conference}/online-friends', 'ConferenceOnlineFriendsController@index'); 25 | Route::get('{conference}/online-friends/{friend}', 'ConferenceOnlineFriendsController@show'); 26 | Route::post('{conference}/online-friends', 'ConferenceOnlineFriendsController@store'); 27 | Route::patch('{conference}/online-friends/{friend}', 'ConferenceOnlineFriendsController@update'); 28 | Route::delete('{conference}/online-friends/{friend}', 'ConferenceOnlineFriendsController@delete'); 29 | }); 30 | }); 31 | }); 32 | 33 | Route::get('local-login', 'Auth\AuthController@localLogin'); 34 | Route::get('auth', 'Auth\AuthController@authenticate'); 35 | Route::get('auth/callback', 'Auth\AuthController@handleTwitterCallback'); 36 | Route::get('auth/logout', 'Auth\AuthController@logout'); 37 | Route::get('avatar/{username}', 'AvatarController@show'); 38 | Route::get('conferences/{conferenceSlug}/introduce', 'ConferenceIntroductionController@index'); 39 | Route::post('api/conferences/{conferenceSlug}/introduction', 'ConferenceIntroductionController@store'); 40 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !public/ 4 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | compiled.php 4 | schedule-* 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/BrowserKitTestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/ConferenceTest.php: -------------------------------------------------------------------------------- 1 | create(); 15 | $conference = factory(Conference::class)->make(); 16 | $user->conferences()->save($conference); 17 | 18 | $conference->meetNewFriend('adamwathan'); 19 | 20 | $this->assertFalse($conference->newFriends->isEmpty()); 21 | $this->assertEquals('adamwathan', $conference->newFriends->first()->username); 22 | } 23 | 24 | public function test_it_can_plan_to_meet_online_friend() 25 | { 26 | $user = factory(User::class)->create(); 27 | $conference = factory(Conference::class)->make(); 28 | $user->conferences()->save($conference); 29 | 30 | $conference->planToMeetOnlineFriend('dead_lugosi'); 31 | 32 | $this->assertFalse($conference->onlineFriends->isEmpty()); 33 | $this->assertEquals('dead_lugosi', $conference->onlineFriends->first()->username); 34 | } 35 | 36 | public function test_it_can_create_a_conference() 37 | { 38 | $user = factory(User::class)->create(); 39 | 40 | $this->be($user); 41 | $this->json('post', '/api/conferences', [ 42 | 'name' => 'MyCon', 43 | 'start_date' => '2016-07-26', 44 | 'end_date' => '2016-07-29', 45 | ]); 46 | 47 | $this->json('get', '/api/conferences'); 48 | 49 | $this->seeJson([ 50 | 'name' => 'MyCon', 51 | 'start_date' => '2016-07-26 00:00:00', 52 | 'end_date' => '2016-07-29 00:00:00', 53 | ]); 54 | } 55 | 56 | public function test_it_can_get_all_conferences() 57 | { 58 | $user = factory(User::class)->create(); 59 | $conference1 = factory(Conference::class)->make(); 60 | $conference2 = factory(Conference::class)->make(); 61 | $user->conferences()->save($conference1); 62 | $user->conferences()->save($conference2); 63 | 64 | $this->be($user); 65 | $this->json('get', '/api/conferences'); 66 | 67 | $this->seeJson(['name' => $conference1->name]); 68 | $this->seeJson(['name' => $conference2->name]); 69 | } 70 | 71 | public function test_it_can_delete_a_conference() 72 | { 73 | $user = factory(User::class)->create(); 74 | $conference = factory(Conference::class)->make(); 75 | $user->conferences()->save($conference); 76 | 77 | $this->be($user); 78 | $this->json('delete', '/api/conferences/' . $conference->slug); 79 | 80 | $this->json('get', '/api/conferences'); 81 | $this->dontSeeJson(['name' => $conference->name]); 82 | } 83 | 84 | public function test_it_only_shows_conferences_for_authenticated_user() 85 | { 86 | $user1 = factory(User::class)->create(); 87 | $user2 = factory(User::class)->create(); 88 | $conference1 = factory(Conference::class)->make(); 89 | $conference2 = factory(Conference::class)->make(); 90 | $user1->conferences()->save($conference1); 91 | $user2->conferences()->save($conference2); 92 | 93 | $this->be($user1); 94 | 95 | $this->json('get', '/api/conferences'); 96 | 97 | $this->dontSeeJson(['name' => $conference2->name]); 98 | } 99 | 100 | public function test_it_doesnt_allow_users_to_delete_other_users_conferences() 101 | { 102 | $user1 = factory(User::class)->create(); 103 | $user2 = factory(User::class)->create(); 104 | $conference1 = factory(Conference::class)->make(); 105 | $conference2 = factory(Conference::class)->make(); 106 | $user1->conferences()->save($conference1); 107 | $user2->conferences()->save($conference2); 108 | 109 | $this->be($user1); 110 | 111 | $this->json('delete', '/api/conferences/'.$conference2->slug); 112 | 113 | $this->seeStatusCode(404); 114 | } 115 | 116 | public function test_conference_can_start_and_end_on_same_day() 117 | { 118 | $user = factory(User::class)->create(); 119 | 120 | $this->be($user); 121 | $this->json('post', '/api/conferences', [ 122 | 'name' => 'MyCon', 123 | 'start_date' => '2016-07-26', 124 | 'end_date' => '2016-07-26', 125 | ]); 126 | 127 | $this->assertResponseStatus(201); 128 | } 129 | 130 | public function test_conference_cannot_end_before_it_starts() 131 | { 132 | $user = factory(User::class)->create(); 133 | 134 | $this->be($user); 135 | $this->json('post', '/api/conferences', [ 136 | 'name' => 'MyCon', 137 | 'start_date' => '2016-07-26', 138 | 'end_date' => '2016-07-01', 139 | ]); 140 | 141 | $this->assertResponseStatus(422); 142 | } 143 | 144 | public function test_conference_can_end_after_it_starts() 145 | { 146 | $user = factory(User::class)->create(); 147 | 148 | $this->be($user); 149 | $this->json('post', '/api/conferences', [ 150 | 'name' => 'MyCon', 151 | 'start_date' => '2016-07-26', 152 | 'end_date' => '2016-07-30', 153 | ]); 154 | 155 | $this->assertResponseStatus(201); 156 | } 157 | 158 | public function test_it_identifies_an_upcoming_conference() 159 | { 160 | $user = factory(User::class)->create(); 161 | $conference = factory(Conference::class)->create([ 162 | 'user_id' => $user->id, 163 | 'start_date' => date('Y-m-d', strtotime('+2 day')), 164 | 'end_date' => date('Y-m-d', strtotime('+2 day')), 165 | ]); 166 | 167 | $this->assertTrue($conference->isUpcoming()); 168 | $this->assertFalse($conference->isInProgress()); 169 | $this->assertFalse($conference->isFinished()); 170 | } 171 | 172 | public function test_it_identifies_an_in_progress_conference() 173 | { 174 | $user = factory(User::class)->create(); 175 | $conference = factory(Conference::class)->create([ 176 | 'user_id' => $user->id, 177 | 'start_date' => date('Y-m-d', strtotime('-1 day')), 178 | 'end_date' => date('Y-m-d', strtotime('+1 day')), 179 | ]); 180 | 181 | $this->assertFalse($conference->isUpcoming()); 182 | $this->assertTrue($conference->isInProgress()); 183 | $this->assertFalse($conference->isFinished()); 184 | } 185 | 186 | public function test_it_identifies_a_finished_conference() 187 | { 188 | $user = factory(User::class)->create(); 189 | $conference = factory(Conference::class)->create([ 190 | 'user_id' => $user->id, 191 | 'end_date' => date('Y-m-d', strtotime('-1 day')), 192 | ]); 193 | 194 | $this->assertFalse($conference->isUpcoming()); 195 | $this->assertFalse($conference->isInProgress()); 196 | $this->assertTrue($conference->isFinished()); 197 | } 198 | 199 | public function test_it_introduces_a_new_online_friend() 200 | { 201 | $user = factory(User::class)->create(); 202 | $conference = factory(Conference::class)->create([ 203 | 'user_id' => $user->id, 204 | 'start_date' => date('Y-m-d', strtotime('+1 day')), 205 | ]); 206 | 207 | $conference->makeIntroduction('michaeldyrynda'); 208 | 209 | $this->seeInDatabase('friends', [ 210 | 'conference_id' => $conference->id, 211 | 'username' => 'michaeldyrynda', 212 | 'type' => 'online', 213 | 'met' => false, 214 | 'introduction' => true, 215 | ]); 216 | } 217 | 218 | public function test_it_introduces_a_new_met_friend_during_a_conference() 219 | { 220 | $user = factory(User::class)->create(); 221 | $conference = factory(Conference::class)->create([ 222 | 'user_id' => $user->id, 223 | 'start_date' => date('Y-m-d', strtotime('-1 day')), 224 | 'end_date' => date('Y-m-d', strtotime('+1 day')), 225 | ]); 226 | 227 | $conference->makeIntroduction('michaeldyrynda'); 228 | 229 | $this->seeInDatabase('friends', [ 230 | 'conference_id' => $conference->id, 231 | 'username' => 'michaeldyrynda', 232 | 'type' => 'new', 233 | 'met' => true, 234 | 'introduction' => true, 235 | ]); 236 | } 237 | 238 | public function test_it_introduces_a_new_met_friend_after_a_conference() 239 | { 240 | $user = factory(User::class)->create(); 241 | $conference = factory(Conference::class)->create([ 242 | 'user_id' => $user->id, 243 | 'start_date' => date('Y-m-d', strtotime('-2 day')), 244 | 'end_date' => date('Y-m-d', strtotime('-1 day')), 245 | ]); 246 | 247 | $conference->makeIntroduction('michaeldyrynda'); 248 | 249 | $this->seeInDatabase('friends', [ 250 | 'conference_id' => $conference->id, 251 | 'username' => 'michaeldyrynda', 252 | 'type' => 'new', 253 | 'met' => true, 254 | 'introduction' => true, 255 | ]); 256 | } 257 | 258 | public function test_it_strips_leading_at_symbol_when_adding_new_online_friend() 259 | { 260 | $user = factory(User::class)->create(); 261 | $conference = factory(Conference::class)->create(['user_id' => $user->id]); 262 | 263 | $conference->planToMeetOnlineFriend('@mattstauffer'); 264 | 265 | $this->seeInDatabase('friends', [ 266 | 'conference_id' => $conference->id, 267 | 'username' => 'mattstauffer', 268 | ]); 269 | } 270 | 271 | public function test_it_strips_leading_at_symbol_when_adding_new_met_friend() 272 | { 273 | $user = factory(User::class)->create(); 274 | $conference = factory(Conference::class)->create(['user_id' => $user->id]); 275 | 276 | $conference->meetNewFriend('@marcusmoore'); 277 | 278 | $this->seeInDatabase('friends', [ 279 | 'conference_id' => $conference->id, 280 | 'username' => 'marcusmoore', 281 | ]); 282 | } 283 | 284 | public function test_it_strips_leading_at_symbol_when_introducing_yourself() 285 | { 286 | $user = factory(User::class)->create(); 287 | $conference = factory(Conference::class)->create(['user_id' => $user->id]); 288 | 289 | $conference->makeIntroduction('@michaeldyrynda'); 290 | 291 | $this->seeInDatabase('friends', [ 292 | 'conference_id' => $conference->id, 293 | 'username' => 'michaeldyrynda', 294 | ]); 295 | } 296 | 297 | public function test_it_does_not_duplicate_a_friend_if_they_are_already_on_your_list_and_introducing_themselves() 298 | { 299 | $user = factory(User::class)->create(); 300 | $conference = factory(Conference::class)->create(['user_id' => $user->id]); 301 | 302 | $conference->planToMeetOnlineFriend('stauffermatt'); 303 | $conference->makeIntroduction('stauffermatt'); 304 | 305 | $this->assertCount(1, Friend::where('username', 'stauffermatt')->where('conference_id', $conference->id)->get()); 306 | $this->seeInDatabase('friends', ['username' => 'stauffermatt', 'conference_id' => $conference->id, 'introduction' => true]); 307 | } 308 | } 309 | -------------------------------------------------------------------------------- /tests/FriendTest.php: -------------------------------------------------------------------------------- 1 | create(); 15 | $conference = factory(Conference::class)->make(); 16 | $user->conferences()->save($conference); 17 | 18 | $friend = factory(Friend::class)->make(); 19 | $conference->onlineFriends()->save($friend); 20 | 21 | $this->assertFalse($friend->met); 22 | 23 | $friend->markMet(); 24 | 25 | $pulledFriend = Friend::find($friend->id); 26 | 27 | $this->assertTrue($pulledFriend->met); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/MeetNewFriendTest.php: -------------------------------------------------------------------------------- 1 | create(); 15 | $conference = factory(Conference::class)->make(); 16 | $user->conferences()->save($conference); 17 | 18 | $this->be($user); 19 | $this->json('post', 'api/conferences/' . $conference->slug . '/new-friends', [ 20 | 'username' => 'adamwathan', 21 | ]); 22 | 23 | $this->json('get', 'api/conferences/' . $conference->slug . '/new-friends'); 24 | 25 | $this->seeJson(['username' => 'adamwathan']); 26 | } 27 | 28 | public function test_when_i_meet_a_new_friend_then_that_person_is_marked_as_met() 29 | { 30 | $user = factory(User::class)->create(); 31 | $conference = factory(Conference::class)->make(); 32 | $user->conferences()->save($conference); 33 | 34 | $this->be($user); 35 | $this->json('post', 'api/conferences/' . $conference->slug . '/new-friends', [ 36 | 'username' => 'adamwathan', 37 | ]); 38 | 39 | $friend = Friend::where('username', 'adamwathan')->first(); 40 | 41 | $this->assertTrue($friend->met); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /tests/MeetOnlineFriendTest.php: -------------------------------------------------------------------------------- 1 | create(); 14 | $conference = factory(Conference::class)->make(); 15 | $user->conferences()->save($conference); 16 | 17 | $friend = $conference->planToMeetOnlineFriend('dead_lugosi'); 18 | 19 | $this->be($user); 20 | $this->json('patch', 'api/conferences/' . $conference->slug . '/online-friends/' . $friend->id, [ 21 | 'met' => true, 22 | ]); 23 | 24 | $this->json('get', 'api/conferences/' . $conference->slug . '/online-friends/' . $friend->id); 25 | 26 | $this->seeJson(['met' => true]); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/NewFriendTest.php: -------------------------------------------------------------------------------- 1 | create(); 14 | $user2 = factory(User::class)->create(); 15 | $conference1 = factory(Conference::class)->make(); 16 | $conference2 = factory(Conference::class)->make(); 17 | $user1->conferences()->save($conference1); 18 | $user2->conferences()->save($conference2); 19 | 20 | $this->be($user1); 21 | 22 | $this->json('get', '/api/conferences/' . $conference2->slug . '/new-friends'); 23 | 24 | $this->seeStatusCode(404); 25 | } 26 | 27 | public function test_it_shows_new_friends_for_my_conference() 28 | { 29 | $user = factory(User::class)->create(); 30 | $conference = factory(Conference::class)->make(); 31 | $user->conferences()->save($conference); 32 | $conference->meetNewFriend('taylorotwell'); 33 | 34 | $this->be($user); 35 | 36 | $this->json('get', 'api/conferences/' . $conference->slug . '/new-friends'); 37 | 38 | $this->seeJson(['username' => 'taylorotwell']); 39 | } 40 | 41 | public function test_it_can_delete_new_friends() 42 | { 43 | $user = factory(User::class)->create(); 44 | $conference = factory(Conference::class)->make(); 45 | $user->conferences()->save($conference); 46 | $friend = $conference->meetNewFriend('jeffrey_way'); 47 | 48 | $this->be($user); 49 | 50 | $this->json('delete', 'api/conferences/' . $conference->slug . '/new-friends/' . $friend->id); 51 | 52 | $this->json('get', 'api/conferences/' . $conference->slug . '/new-friends'); 53 | 54 | $this->dontSeeJson(['username' => 'jeffrey_way']); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /tests/OnlineFriendTest.php: -------------------------------------------------------------------------------- 1 | create(); 14 | $user2 = factory(User::class)->create(); 15 | $conference1 = factory(Conference::class)->make(); 16 | $conference2 = factory(Conference::class)->make(); 17 | $user1->conferences()->save($conference1); 18 | $user2->conferences()->save($conference2); 19 | 20 | $this->be($user1); 21 | 22 | $this->json('get', '/api/conferences/' . $conference2->slug . '/online-friends'); 23 | 24 | $this->seeStatusCode(404); 25 | } 26 | 27 | public function test_it_shows_online_friends_for_my_conference() 28 | { 29 | $user = factory(User::class)->create(); 30 | $conference = factory(Conference::class)->make(); 31 | $user->conferences()->save($conference); 32 | $conference->planToMeetOnlineFriend('ambassadorawsum'); 33 | 34 | $this->be($user); 35 | 36 | $this->json('get', 'api/conferences/' . $conference->slug . '/online-friends'); 37 | 38 | $this->seeJson(['username' => 'ambassadorawsum']); 39 | } 40 | 41 | public function test_it_can_delete_online_friends() 42 | { 43 | $user = factory(User::class)->create(); 44 | $conference = factory(Conference::class)->make(); 45 | $user->conferences()->save($conference); 46 | $friend = $conference->planToMeetOnlineFriend('mattgreen110'); 47 | 48 | $this->be($user); 49 | 50 | $this->json('delete', 'api/conferences/' . $conference->slug . '/online-friends/' . $friend->id); 51 | 52 | $this->json('get', 'api/conferences/' . $conference->slug . '/online-friends'); 53 | 54 | $this->dontSeeJson(['username' => 'mattgreen110']); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /tests/PlanToMeetOnlineFriendTest.php: -------------------------------------------------------------------------------- 1 | create(); 14 | $conference = factory(Conference::class)->make(); 15 | $user->conferences()->save($conference); 16 | 17 | $friend = $conference->planToMeetOnlineFriend('dead_lugosi'); 18 | 19 | $this->be($user); 20 | 21 | $this->json('get', 'api/conferences/' . $conference->slug . '/online-friends'); 22 | 23 | $this->seeJson(['username' => 'dead_lugosi']); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/TweeterTest.php: -------------------------------------------------------------------------------- 1 | twitter = m::mock(TwitterOAuth::class)->shouldIgnoreMissing(); 21 | 22 | app()->instance(TwitterOAuth::class, $this->twitter); 23 | } 24 | 25 | /** @test */ 26 | public function friend_passes_tweeter_details() 27 | { 28 | $user = factory(User::class)->create(); 29 | $conference = factory(Conference::class)->create(['user_id' => $user->id]); 30 | $friend = factory(Friend::class)->create(['conference_id' => $conference]); 31 | 32 | $tweeter = factory(Tweeter::class)->create(['username' => $friend->username]); 33 | 34 | $this->assertEquals($tweeter->name, $friend->name); 35 | $this->assertEquals($tweeter->location, $friend->location); 36 | $this->assertEquals($tweeter->description, $friend->description); 37 | $this->assertEquals($tweeter->url, $friend->url); 38 | $this->assertEquals($tweeter->url_display, $friend->url_display); 39 | } 40 | 41 | /** @test */ 42 | public function adding_a_friend_adds_new_tweeter_if_doesnt_exist() 43 | { 44 | $user = factory(User::class)->create(); 45 | $conference = factory(Conference::class)->create(['user_id' => $user->id]); 46 | 47 | $conference->meetNewFriend('stauffermatt'); 48 | 49 | $this->assertEquals(1, Tweeter::count()); 50 | } 51 | 52 | /** @test */ 53 | public function adding_a_friend_doesnt_create_tweeter_if_one_exists() 54 | { 55 | $user = factory(User::class)->create(); 56 | $conference = factory(Conference::class)->create(['user_id' => $user->id]); 57 | 58 | $conference->meetNewFriend('stauffermatt'); 59 | 60 | $user2 = factory(User::class)->create(); 61 | $conference2 = factory(Conference::class)->create(['user_id' => $user2->id]); 62 | 63 | $conference2->meetNewFriend('stauffermatt'); 64 | 65 | $this->assertEquals(1, Tweeter::count()); 66 | } 67 | 68 | /** @test */ 69 | public function fetcher_syncs_friends_data() 70 | { 71 | $fromTwitter = (object) [ 72 | 'name' => 'Matt Stauffer', 73 | 'location' => 'Gainesville, FL', 74 | 'description' => 'A guy', 75 | 'entities' => [], 76 | 'profile_image_url_https' => 'abcde', 77 | ]; 78 | 79 | $this->twitter->shouldReceive('get')->andReturn($fromTwitter); 80 | 81 | $user = factory(User::class)->create(); 82 | $conference = factory(Conference::class)->create(['user_id' => $user->id]); 83 | $conference->meetNewFriend('stauffermatt'); 84 | 85 | Tweeter::first()->update(['name' => 'Bob', 'updated_at' => Carbon::now()->subYear()]); 86 | 87 | Artisan::call('twitter:fetch-info'); 88 | 89 | $this->assertEquals(Carbon::now()->format('Y-m-d'), Tweeter::first()->updated_at->format('Y-m-d')); 90 | } 91 | } 92 | --------------------------------------------------------------------------------