├── .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 | Just getting started? Add the name of the next conference you're planning to attend. You can then add your "online friends"—friends you know online and plan to meet at the conference. Then, at the conference, you can take a look at that list, and mark them when they're met—like a todo list for friends. These conferences aren't connected to anyone else in this system. It's just for you, to track your friends. So get started! Add your next conference below. Name: {{ friend.name }} Location: {{ friend.location }} {{ friend.description }}
5 | (New friends are people you met at this conference.)
6 |
8 | (Online friends are people you know online prior to the conference and want to meet at the conference.)
9 | You don't have any {{ descriptor }} Friends added yet.Conferences
5 |
15 | {{ conference.name }}
16 |
17 |
27 |
28 |
29 |
6 |
7 |
8 |
12 |
7 |
{{ descriptor }} Friends
4 |
12 |
19 |
22 |
23 |
24 | {{ friend.name }} (@{{ friend.username }})
25 |
26 |
27 | @{{ friend.username }}
28 |
29 |
30 |
31 |
32 |
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 |