Account Deletion Confirmation
10 |Are you sure you want to delete your account
13 | 14 | 15 | 23 | 24 | 25 | 26 | 27 | 28 |├── .env.example
├── .gitattributes
├── .gitignore
├── LICENSE
├── LICENSE-CODE
├── README.md
├── app.json
├── app
├── Console
│ ├── Commands
│ │ └── Inspire.php
│ └── Kernel.php
├── Events
│ └── Event.php
├── Exceptions
│ └── Handler.php
├── Http
│ ├── Controllers
│ │ ├── AccountController.php
│ │ ├── Auth
│ │ │ ├── AuthController.php
│ │ │ └── PasswordController.php
│ │ ├── AviaryController.php
│ │ ├── ClockworkController.php
│ │ ├── ContactController.php
│ │ ├── Controller.php
│ │ ├── FacebookController.php
│ │ ├── FoursquareController.php
│ │ ├── GithubController.php
│ │ ├── LastFmController.php
│ │ ├── LinkedInController.php
│ │ ├── LobController.php
│ │ ├── NytController.php
│ │ ├── OauthController.php
│ │ ├── PageController.php
│ │ ├── PaypalController.php
│ │ ├── SlackController.php
│ │ ├── SteamController.php
│ │ ├── StripeController.php
│ │ ├── TumblrController.php
│ │ ├── TwilioController.php
│ │ ├── TwitterController.php
│ │ ├── WebScrapingController.php
│ │ └── YahooController.php
│ ├── Kernel.php
│ ├── Middleware
│ │ ├── Authenticate.php
│ │ ├── EncryptCookies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ └── VerifyCsrfToken.php
│ ├── Requests
│ │ └── Request.php
│ ├── helpers.php
│ └── routes.php
├── Jobs
│ └── Job.php
├── Listeners
│ └── .gitkeep
├── Policies
│ └── .gitkeep
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
└── User.php
├── artisan
├── azure-pipelines.yml
├── bootstrap
├── app.php
├── autoload.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── cloudder.php
├── compile.php
├── database.php
├── facebook.php
├── filesystems.php
├── github.php
├── instagram.php
├── mail.php
├── queue.php
├── services.php
├── session.php
├── ttwitter.php
├── twilio.php
└── view.php
├── database
├── .gitignore
├── database.sqlite
├── factories
│ └── ModelFactory.php
├── migrations
│ ├── .gitkeep
│ ├── 2014_10_12_000000_create_users_table.php
│ └── 2014_10_12_100000_create_password_resets_table.php
└── seeds
│ ├── .gitkeep
│ └── DatabaseSeeder.php
├── gulpfile.js
├── package.json
├── phpunit
├── phpunit.xml
├── public
├── .htaccess
├── css
│ └── main.css
├── favicon.ico
├── index.php
├── robots.txt
└── web.config
├── resources
├── assets
│ └── sass
│ │ └── app.scss
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ ├── texts.php
│ │ └── validation.php
└── views
│ ├── account
│ ├── avatar.blade.php
│ ├── changePassword.blade.php
│ ├── confirm.blade.php
│ ├── dashboard.blade.php
│ ├── deleteAccount.blade.php
│ ├── linkedAccount.blade.php
│ └── profileInfo.blade.php
│ ├── api
│ ├── aviary.blade.php
│ ├── clockwork.blade.php
│ ├── facebook.blade.php
│ ├── foursquare.blade.php
│ ├── github.blade.php
│ ├── lastfm.blade.php
│ ├── linkedin.blade.php
│ ├── lob.blade.php
│ ├── nyt.blade.php
│ ├── paypal.blade.php
│ ├── scraping.blade.php
│ ├── slack.blade.php
│ ├── steam.blade.php
│ ├── stripe.blade.php
│ ├── tumblr.blade.php
│ ├── twilio.blade.php
│ ├── twitter.blade.php
│ └── yahoo.blade.php
│ ├── apidashboard.blade.php
│ ├── auth
│ ├── emails
│ │ └── password.blade.php
│ ├── login.blade.php
│ ├── passwords
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ └── register.blade.php
│ ├── contact.blade.php
│ ├── emails
│ └── contact.blade.php
│ ├── errors
│ └── 503.blade.php
│ ├── layouts
│ ├── master.blade.php
│ └── partials
│ │ ├── alerts.blade.php
│ │ └── navbar.blade.php
│ ├── vendor
│ └── .gitkeep
│ └── welcome.blade.php
├── server.php
├── storage
├── app
│ └── .gitignore
├── debugbar
│ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
├── github
│ ├── 8334c0b2788478665cdae391eb08e241
│ ├── 8334c0b2788478665cdae391eb08e241.etag
│ ├── b38a1f48f8dc9fcaa993dc8a009f4e18
│ └── b38a1f48f8dc9fcaa993dc8a009f4e18.etag
└── logs
│ └── .gitignore
└── tests
├── ExampleTest.php
└── TestCase.php
/.env.example:
--------------------------------------------------------------------------------
1 | APP_ENV=local
2 | APP_DEBUG=true
3 | APP_KEY=pJJBl4hGivo0tZZZEUmuooyM3EH23jPH
4 |
5 | DB_CONNECTION=mysql
6 | DB_HOST=127.0.0.1
7 | DB_DATABASE=hackathon
8 | DB_USERNAME=homestead
9 | DB_PASSWORD=secret
10 |
11 | CACHE_DRIVER=file
12 | SESSION_DRIVER=file
13 | QUEUE_DRIVER=sync
14 |
15 | REDIS_HOST=127.0.0.1
16 | REDIS_PASSWORD=null
17 | REDIS_PORT=6379
18 |
19 | MAIL_DRIVER=smtp
20 | MAIL_HOST=smtp.mandrillapp.com
21 | MAIL_PORT=xxx
22 | MAIL_USERNAME=xxxxxxxxx
23 | MAIL_PASSWORD=xxxxxxxxx
24 | MAIL_ENCRYPTION=tls
25 |
26 | FACEBOOK_CLIENT_ID=xxxxxxxxx
27 | FACEBOOK_CLIENT_SECRET=xxxxxxxxx
28 | FACEBOOK_CALLBACK_URL=http://pipelines-php.dev/auth/facebook
29 |
30 | LINKEDIN_CLIENT_ID=xxxxxxxxx
31 | LINKEDIN_CLIENT_SECRET=xxxxxxxxx
32 | LINKEDIN_CALLBACK_URL=http://pipelines-php.dev/auth/linkedin
33 |
34 | GITHUB_CLIENT_ID=xxxxxxxxx
35 | GITHUB_CLIENT_SECRET=xxxxxxxxx
36 | GITHUB_CALLBACK_URL=http://pipelines-php.dev/auth/github
37 |
38 | TWITTER_API_KEY=xxxxxxxxx
39 | TWITTER_APP_SECRET=xxxxxxxxx
40 | TWITTER_CALLBACK_URL=http://pipelines-php.dev/auth/twitter
41 | TWITTER_ACCESS_TOKEN=xxxxxxxxx
42 | TWITTER_ACCESS_TOKEN_SECRET=xxxxxxxxx
43 |
44 | GOOGLE_CLIENT_ID=xxxxxxxxx
45 | GOOGLE_CLIENT_SECRET=xxxxxxxxx
46 | GOOGLE_CALLBACK_URL=http://pipelines-php.dev/auth/google
47 |
48 | INSTAGRAM_CLIENT_ID=xxxxxxxxx
49 | INSTAGRAM_CLIENT_SECRET=xxxxxxxxx
50 | INSTAGRAM_CALLBACK_URL=http://hackathon-start.dev/auth/instagram
51 |
52 | LASTFM_API_KEY=xxxxxxxxx
53 | LASTFM_API_SECRET=xxxxxxxxx
54 | LASTFM_CALLBACK_URL=http://hackathon-start.dev/auth/lastfm
55 |
56 | NYT_ARTICLE_API_KEY=xxxxxxxxx
57 | NYT_BOOKS_API_KEY=xxxxxxxx
58 | NYT_COMMUNITY_API_KEY=xxxxxxxx
59 | NYT_CONGRESS_API_KEY=xxxxxxxxx
60 | NYT_GEO_API_KEY=xxxxxxxx
61 | NYT_MOSTPOPULAR_API_KEY=xxxxxxxxx
62 | NYT_MOVIEREVIEWS_API_KEY=xxxxxxxx
63 | NYT_SEMANTIC_API_KEY=xxxxxxxxx
64 | NYT_TIMESNEWSIRE_API_KEY=xxxxxxxxx
65 | NYT_TIMESTAGS_API_KEY=xxxxxxxxx
66 | NYT_TOPSTORIES_APIS_KEY=xxxxxxxxx
67 |
68 | CLOUDINARY_API_KEY=xxxxxxxxx
69 | CLOUDINARY_API_SECRET=xxxxxxxxx
70 | CLOUDINARY_CLOUD_NAME=suyabay
71 |
72 | TWILIO_FROM=+xxxxxxxxx
73 | TWILIO_SID=xxxxxxxxx
74 | TWILIO_TOKEN=xxxxxxxxx
75 |
76 | CLOCKWORK_API_KEY=xxxxxxxxx
77 | LOB_API_KEY=test_xxxxxxxxx
78 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.less linguist-vendored
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor
2 | /node_modules
3 | Homestead.yaml
4 | Homestead.json
5 | .env
6 |
7 | # barryvdh/laravel-ide-helper generated files
8 | _ide_helper.php
9 |
10 | # Eclipse stuff
11 | .buildpath
12 | .project
13 | .settings/
14 |
15 |
--------------------------------------------------------------------------------
/LICENSE-CODE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | Copyright (c) Microsoft Corporation
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
5 | associated documentation files (the "Software"), to deal in the Software without restriction,
6 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
8 | subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all copies or substantial
11 | portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
14 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
16 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Contributing
3 |
4 | This project welcomes contributions and suggestions. Most contributions require you to agree to a
5 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
6 | the rights to use your contribution. For details, visit https://cla.microsoft.com.
7 |
8 | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
9 | a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
10 | provided by the bot. You will only need to do this once across all repos using our CLA.
11 |
12 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
13 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
14 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
15 |
16 | # Legal Notices
17 |
18 | Microsoft and any contributors grant you a license to the Microsoft documentation and other content
19 | in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode),
20 | see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the
21 | [LICENSE-CODE](LICENSE-CODE) file.
22 |
23 | Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation
24 | may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries.
25 | The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks.
26 | Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.
27 |
28 | Privacy information can be found at https://privacy.microsoft.com/en-us/
29 |
30 | Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents,
31 | or trademarks, whether by implication, estoppel or otherwise.
32 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pipelines-php",
3 | "scripts": {
4 | },
5 | "env": {
6 | "APP_DEBUG": {
7 | "required": true
8 | },
9 | "APP_ENV": {
10 | "required": true
11 | },
12 | "APP_KEY": {
13 | "required": true
14 | },
15 | "BUILDPACK_URL": {
16 | "required": true
17 | },
18 | "CLOCKWORK_API_KEY": {
19 | "required": true
20 | },
21 | "CLOUDINARY_API_KEY": {
22 | "required": true
23 | },
24 | "CLOUDINARY_API_SECRET": {
25 | "required": true
26 | },
27 | "CLOUDINARY_CLOUD_NAME": {
28 | "required": true
29 | },
30 | "DB_DATABASE": {
31 | "required": true
32 | },
33 | "DB_HOST": {
34 | "required": true
35 | },
36 | "DB_PASSWORD": {
37 | "required": true
38 | },
39 | "DB_USERNAME": {
40 | "required": true
41 | },
42 | "FACEBOOK_CALLBACK_URL": {
43 | "required": true
44 | },
45 | "FACEBOOK_CLIENT_ID": {
46 | "required": true
47 | },
48 | "FACEBOOK_CLIENT_SECRET": {
49 | "required": true
50 | },
51 | "FOURSQUARE_CALLBACK_URL": {
52 | "required": true
53 | },
54 | "FOURSQUARE_CLIENT_ID": {
55 | "required": true
56 | },
57 | "FOURSQUARE_CLIENT_SECRET": {
58 | "required": true
59 | },
60 | "GITHUB_CALLBACK_URL": {
61 | "required": true
62 | },
63 | "GITHUB_CLIENT_ID": {
64 | "required": true
65 | },
66 | "GITHUB_CLIENT_SECRET": {
67 | "required": true
68 | },
69 | "LASTFM_API_KEY": {
70 | "required": true
71 | },
72 | "LASTFM_API_SECRET": {
73 | "required": true
74 | },
75 | "LINKEDIN_CALLBACK_URL": {
76 | "required": true
77 | },
78 | "LINKEDIN_CLIENT_ID": {
79 | "required": true
80 | },
81 | "LINKEDIN_CLIENT_SECRET": {
82 | "required": true
83 | },
84 | "LOB_API_KEY": {
85 | "required": true
86 | },
87 | "MAIL_DRIVER": {
88 | "required": true
89 | },
90 | "MAIL_ENCRYPTION": {
91 | "required": true
92 | },
93 | "MAIL_HOST": {
94 | "required": true
95 | },
96 | "MAIL_PASSWORD": {
97 | "required": true
98 | },
99 | "MAIL_PORT": {
100 | "required": true
101 | },
102 | "MAIL_USERNAME": {
103 | "required": true
104 | },
105 | "NYT_BOOKS_API_KEY": {
106 | "required": true
107 | },
108 | "SLACK_TOKEN": {
109 | "required": true
110 | },
111 | "TUMBLR_API_KEY": {
112 | "required": true
113 | },
114 | "TUMBLR_APP_SECRET": {
115 | "required": true
116 | },
117 | "TWILIO_FROM": {
118 | "required": true
119 | },
120 | "TWILIO_SID": {
121 | "required": true
122 | },
123 | "TWILIO_TOKEN": {
124 | "required": true
125 | },
126 | "TWITTER_ACCESS_TOKEN": {
127 | "required": true
128 | },
129 | "TWITTER_ACCESS_TOKEN_SECRET": {
130 | "required": true
131 | },
132 | "TWITTER_API_KEY": {
133 | "required": true
134 | },
135 | "TWITTER_APP_SECRET": {
136 | "required": true
137 | },
138 | "TWITTER_CALLBACK_URL": {
139 | "required": true
140 | }
141 | },
142 | "addons": [
143 | "cleardb"
144 | ]
145 | }
146 |
--------------------------------------------------------------------------------
/app/Console/Commands/Inspire.php:
--------------------------------------------------------------------------------
1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
28 | // ->hourly();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Events/Event.php:
--------------------------------------------------------------------------------
1 | user = Auth::user();
20 | $this->id = $this->user->id;
21 | }
22 |
23 | public function getAccountPage()
24 | {
25 | return view('account.dashboard')->withAccount($this->user);
26 | }
27 |
28 | /**
29 | * Store a newly created resource in storage.
30 | *
31 | * @param Request $request
32 | * @return Response
33 | */
34 | public function updateProfile(Request $request)
35 | {
36 | $this->validate($request, [
37 | 'email' => 'required|email|min:3|unique:users,email,'. $this->id,
38 | 'fullname' => 'required|min:3'
39 | ]);
40 |
41 | $values = $request->all();
42 | $this->user->fill($values)->save();
43 |
44 | return redirect()->back()->with('info','Your Profile has been updated successfully');
45 | }
46 |
47 | public function updateAvatar(Request $request)
48 | {
49 | $this->validate($request, [
50 | 'file_name' => 'required|mimes:jpeg,bmp,png|between:1,7000',
51 | ]);
52 |
53 | $filename = $request->file('file_name')->getRealPath();
54 |
55 | Cloudder::upload($filename, null);
56 | list($width, $height) = getimagesize($filename);
57 |
58 | $fileUrl = Cloudder::show(Cloudder::getPublicId(), ["width" => $width, "height" => $height]);
59 |
60 | $this->user->update(['avatar' => $fileUrl]);
61 |
62 | return redirect()->back()->with('info', 'Your Avatar has been updated Successfully');
63 | }
64 |
65 | public function changePassword(Request $request)
66 | {
67 | $this->validate($request, [
68 | 'password' => 'required|min:6|confirmed',
69 | ]);
70 |
71 | $this->user->password = Hash::make($request->password);
72 | $this->user->save();
73 |
74 | return redirect()->back()->with('info', 'Password successfully updated');
75 | }
76 |
77 | public function redirectToConfirmDeletePage()
78 | {
79 | return view('account.confirm');
80 | }
81 |
82 | public function dontDeleteAccount()
83 | {
84 | return redirect('/account');
85 | }
86 |
87 | public function deleteAccount(Request $request)
88 | {
89 | $this->user->delete();
90 |
91 | $request->session()->flush();
92 |
93 | return redirect("/");
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/AuthController.php:
--------------------------------------------------------------------------------
1 | middleware('guest', ['except' => 'logout']);
41 | }
42 |
43 | /**
44 | * Get a validator for an incoming registration request.
45 | *
46 | * @param array $data
47 | * @return \Illuminate\Contracts\Validation\Validator
48 | */
49 | protected function validator(array $data)
50 | {
51 | return Validator::make($data, [
52 | 'name' => 'required|max:255',
53 | 'email' => 'required|email|max:255|unique:users',
54 | 'password' => 'required|confirmed|min:6',
55 | ]);
56 | }
57 |
58 | /**
59 | * Create a new user instance after a valid registration.
60 | *
61 | * @param array $data
62 | * @return User
63 | */
64 | protected function create(array $data)
65 | {
66 | return User::create([
67 | 'fullname' => $data['name'],
68 | 'email' => $data['email'],
69 | 'password' => bcrypt($data['password']),
70 | ]);
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/PasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Http/Controllers/AviaryController.php:
--------------------------------------------------------------------------------
1 | apiKey = env('CLOCKWORK_API_KEY');
30 | $this->client = new ClockworkClient($this->apiKey);
31 | $this->message = new Message();
32 | $this->message->setNumber(self::MSG_NUMBER);
33 | $this->message->setContent(trans('texts.message.sample_body'));
34 | }
35 |
36 | /**
37 | * Return all data to the Clockwork API dashboard
38 | */
39 | public function getPage()
40 | {
41 | return view('api.clockwork');
42 | }
43 |
44 | /**
45 | * Send a Text Message
46 | *
47 | * @param Request $request
48 | *
49 | * @return \Illuminate\Http\RedirectResponse
50 | */
51 | public function sendTextMessage(Request $request)
52 | {
53 | $this->validate($request, [
54 | 'telephone' => 'required'
55 | ]);
56 |
57 | $response = $this->client->sendMessage($this->message);
58 |
59 | if ($response->getMessageId()) {
60 | return redirect()->back()->with('info', trans('texts.message.sent_success'));
61 | }
62 |
63 | return redirect()->back()->with('errors', trans('texts.message.sent_failed'));
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/Http/Controllers/ContactController.php:
--------------------------------------------------------------------------------
1 | validate($request, [
21 | 'name' => 'required|min:3',
22 | 'email' => 'required|email|max:255',
23 | 'message' => 'required'
24 | ]);
25 |
26 | $name = $request->input('name');
27 | $emailToSendTo = $request->input('email');
28 | $body = $request->input('message');
29 |
30 | Mail::send('emails.contact', ['body' => $body], function ($message) use ($name,$emailToSendTo) {
31 | $message->from('unicodeveloper@pipelines-php.com', "From: {$name}");
32 |
33 | $message->to($emailToSendTo)->subject(trans('texts.contact.subject'));
34 | });
35 |
36 | return redirect()->route('contact')->with('info', trans('texts.contact.sent_success'));
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | getData();
29 |
30 | return view('api.facebook')->withDetails($userDetails);
31 | }
32 |
33 |
34 | /**
35 | * @return mixed
36 | */
37 | private function getData()
38 | {
39 | $data = Facebook::get('/me?fields=id,name,cover,email,gender,first_name,last_name,locale,timezone,link,picture', Auth::user()->getAccessToken());
40 |
41 | return json_decode($data->getGraphUser(),true);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/Http/Controllers/FoursquareController.php:
--------------------------------------------------------------------------------
1 | foursquare = new FoursquareApi(env('FOURSQUARE_CLIENT_ID'), env('FOURSQUARE_CLIENT_SECRET'));
22 | }
23 |
24 | /**
25 | * Search For Venues
26 | * @return array
27 | */
28 | private function getVenues()
29 | {
30 | // Searching for venues nearby e.g Lagos, Nigeria
31 | $endpoint = 'venues/search';
32 |
33 | // Prepare parameters
34 | $params = ['near' => 'Lagos, Nigeria'];
35 |
36 | // Perform a request to a public resource
37 | $response = json_decode($this->foursquare->GetPublic($endpoint,$params),true);
38 |
39 | return $response['response']['venues'];
40 | }
41 |
42 | /**
43 | * Return all data to the Foursquare API dashboard
44 | * @return mixed
45 | */
46 | public function getPage()
47 | {
48 | $venues = $this->getVenues();
49 |
50 | return view('api.foursquare')->withVenues($venues);
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/app/Http/Controllers/GithubController.php:
--------------------------------------------------------------------------------
1 | github = $github;
26 | }
27 |
28 | /**
29 | * @return mixed
30 | */
31 | private function getRepoDetails()
32 | {
33 | return $this->github->connection('alternative')->repos()->show(self::GITHUB_HANDLE, self::REPO_NAME);
34 | }
35 |
36 | /**
37 | * @return mixed
38 | */
39 | public function getPage()
40 | {
41 | $details = $this->getRepoDetails();
42 |
43 | return view('api.github')->withDetails($details);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/Http/Controllers/LastFmController.php:
--------------------------------------------------------------------------------
1 | 'The Pierces'];
14 |
15 | /**
16 | * LastFm Object
17 | * @var object;
18 | */
19 | protected $lastfm;
20 |
21 | /**
22 | * Initialize the Controller with necessary arguments
23 | */
24 | public function __construct()
25 | {
26 | $this->lastfm = new LastFm(env('LASTFM_API_KEY'), env('LASTFM_API_SECRET'));
27 | }
28 |
29 | /**
30 | * Return all tweets to the LastFM API dashboard
31 | * @return mixed
32 | */
33 | public function getPage()
34 | {
35 | $details = $this->getArtistInfo();
36 |
37 | $albums = array_slice($this->getTopAlbums(), 0, 4);
38 |
39 | $tracks = array_slice($this->getTopTracks(), 0, 10);
40 |
41 | return view('api.lastfm')->withDetails($details)
42 | ->withAlbums($albums)
43 | ->withTracks($tracks);
44 | }
45 |
46 | /**
47 | * Get Artist Info
48 | * @return array
49 | */
50 | private function getArtistInfo()
51 | {
52 | $result = (array)$this->lastfm->artist_getInfo($this->sampleArtist);
53 |
54 | return $result['artist'];
55 | }
56 |
57 | /**
58 | * Get Top Albums
59 | * @return array
60 | */
61 | private function getTopAlbums()
62 | {
63 | $result = (array)$this->lastfm->artist_getTopAlbums($this->sampleArtist);
64 |
65 | return $result['topalbums']->album;
66 | }
67 |
68 | /**
69 | * Get Top Tracks
70 | * @return array
71 | */
72 | private function getTopTracks()
73 | {
74 | $result = (array)$this->lastfm->artist_getTopTracks($this->sampleArtist);
75 |
76 | return $result['toptracks']->track;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/app/Http/Controllers/LinkedInController.php:
--------------------------------------------------------------------------------
1 | baseUrl = self::LINKEDIN_API;
38 | $this->client = new Client(['base_uri' => $this->baseUrl]);
39 | }
40 |
41 | /**
42 | * Set options for making the Client request
43 | * @return void
44 | */
45 | private function setRequestOptions()
46 | {
47 | $authBearer = 'Bearer '. Auth::user()->getAccessToken();
48 | $this->client = new Client(['base_uri' => $this->baseUrl,
49 | 'headers' => [
50 | 'Authorization' => $authBearer,
51 | 'Content-Type' => 'application/json',
52 | 'Accept' => 'application/json'
53 | ]]);
54 | }
55 |
56 | /**
57 | * Get the response from New York times API
58 | * @param string $relativeUrl
59 | */
60 | private function setGetResponse($relativeUrl)
61 | {
62 | $this->response = $this->client->get($this->baseUrl . $relativeUrl, []);
63 | }
64 |
65 | /**
66 | * Get the whole response from a get operation
67 | * @return array
68 | */
69 | private function getResponse()
70 | {
71 | return json_decode($this->response->getBody(), true);
72 | }
73 |
74 | /**
75 | * Get the data response from a get operation
76 | * @return array
77 | */
78 | private function getData()
79 | {
80 | return $this->getResponse();
81 | }
82 |
83 | /**
84 | * Return all data to the LinkedIn API dashboard
85 | * @return mixed
86 | */
87 | public function getPage()
88 | {
89 | if (Session::get('provider') !== 'linkedin') {
90 | Auth::logout();
91 |
92 | Session::flush();
93 |
94 | return redirect('/auth/linkedin');
95 | }
96 |
97 | $this->setRequestOptions();
98 |
99 | $relativeUrl = '/people/~:(firstName,lastName,emailAddress,pictureUrl,location,industry,numConnections,numConnectionsCapped,summary,publicProfileUrl)?format=json';
100 |
101 | $this->setGetResponse($relativeUrl);
102 |
103 | $userDetails = $this->getData();
104 |
105 | return view('api.linkedin')->withDetails($userDetails);
106 | }
107 | }
108 |
109 |
--------------------------------------------------------------------------------
/app/Http/Controllers/LobController.php:
--------------------------------------------------------------------------------
1 | apikey = env('LOB_API_KEY');
30 | $this->lob = new Lob($this->apikey);
31 | }
32 |
33 | /**
34 | * Get all delivery routes for this zip code
35 | * @param string $zipcode
36 | * @return array
37 | */
38 | private function getRoutes($zipcode)
39 | {
40 | $results = $this->lob->routes()->all(['zip_codes' => $zipcode]);
41 |
42 | return $results[0]['routes'];
43 | }
44 |
45 | /**
46 | * Return all data to the Lob API dashboard
47 | * @return mixed
48 | */
49 | public function getPage()
50 | {
51 | $routes = $this->getRoutes(self::ZIPCODE);
52 |
53 | return view('api.lob')->withRoutes($routes);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/Http/Controllers/NytController.php:
--------------------------------------------------------------------------------
1 | baseUrl = self::API_URL;
31 | $this->client = new Client(['base_uri' => $this->baseUrl]);
32 | $this->setGetResponse($this->getRelativeUrl());
33 | }
34 |
35 | /**
36 | * Get relative url
37 | *
38 | * @return string
39 | */
40 | public function getRelativeUrl()
41 | {
42 | return str_replace('{apiKey}', env('NYT_BOOKS_API_KEY'), self::RELATIVE_URL);
43 | }
44 |
45 | /**
46 | * Get the response from New York times API
47 | * @param string $relativeUrl
48 | */
49 | private function setGetResponse($relativeUrl)
50 | {
51 | $this->response = $this->client->get($this->baseUrl . $relativeUrl, []);
52 | }
53 |
54 | /**
55 | * Get the whole response from a get operation
56 | * @return array
57 | */
58 | private function getResponse()
59 | {
60 | return json_decode($this->response->getBody(), true);
61 | }
62 |
63 | /**
64 | * Get the data response from a get operation
65 | * @return array
66 | */
67 | private function getData()
68 | {
69 | return $this->getResponse()['results']['lists'][0]['books'];
70 | }
71 |
72 | /**
73 | * Return all the data to the New York times API dashboard
74 | * @return array
75 | */
76 | public function getPage()
77 | {
78 | $data = $this->getData();
79 |
80 | return view('api.nyt')->withData($data);
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/app/Http/Controllers/OauthController.php:
--------------------------------------------------------------------------------
1 | socialite = $socialite;
20 | $this->auth = $auth;
21 | }
22 |
23 | public function authenticate(Request $request, $provider)
24 | {
25 | return $this->execute(($request->has('code') || $request->has('oauth_token')), $provider);
26 | }
27 |
28 | public function execute($request, $provider)
29 | {
30 | if (! $request) {
31 | return $this->getAuthorizationFirst($provider);
32 | }
33 |
34 | $user = $this->findByProviderIdOrCreate($this->getSocialUser($provider), $provider);
35 | $this->auth->loginUsingId($user->id);
36 |
37 | return redirect('/api');
38 | }
39 |
40 | /**
41 | * Find a user by username or create a new user
42 | *
43 | * @param $userData
44 | * @param $provider
45 | *
46 | * @return \App\User
47 | */
48 | public function findByProviderIdOrCreate($userData, $provider)
49 | {
50 | $user = User::where('provider_id', '=', $userData->id)->first();
51 |
52 | Session::put('provider', $provider);
53 |
54 | $email = $this->isEmailExists($userData->getEmail()) ? null : $userData->getEmail();
55 |
56 | $username = $this->isUsernameExists($userData->getNickName()) ? null : $userData->getNickName();
57 |
58 | $tokenSecret = property_exists($userData, "tokenSecret") ? $userData->tokenSecret : null;
59 |
60 | if (empty($user)) {
61 |
62 | $user = User::create([
63 | 'fullname' => $userData->getName(),
64 | 'username' => $username,
65 | 'provider_id' => $userData->getId(),
66 | 'avatar' => $userData->getAvatar(),
67 | 'email' => $email,
68 | 'provider' => $provider,
69 | 'oauth_token' => $userData->token,
70 | 'oauth_token_secret' => $tokenSecret
71 | ]);
72 |
73 | Session::put('provider', $provider);
74 | }
75 |
76 | return $user;
77 | }
78 |
79 | private function isUsernameExists($username = null)
80 | {
81 | $username = User::whereUsername($username)->first()['username'];
82 |
83 | return (! is_null($username)) ? true : false;
84 | }
85 |
86 | private function isEmailExists($email = null)
87 | {
88 | $email = User::whereEmail($email)->first()['email'];
89 |
90 | return (! is_null($email)) ? true : false;
91 | }
92 |
93 | /**
94 | * Check if the user's info needs updating
95 | * @param $userData
96 | * @param $user
97 | */
98 | public function checkIfUserNeedsUpdating($userData, $user)
99 | {
100 | $socialData = [
101 | 'avatar' => $userData->getAvatar(),
102 | 'fullname' => $userData->getName(),
103 | 'username' => $userData->getNickName(),
104 | ];
105 |
106 | $dbData = [
107 | 'avatar' => $user->avatar,
108 | 'fullname' => $user->fullname,
109 | 'username' => $user->username,
110 | ];
111 |
112 | if (! empty(array_diff($dbData, $socialData))) {
113 | $user->avatar = $userData->getAvatar();
114 | $user->fullname = $userData->getName();
115 | $user->username = $userData->getNickName();
116 | $user->save();
117 | }
118 | }
119 |
120 | /**
121 | * Redirect the user to the Social Media Account authentication page
122 | * @param $provider
123 | * @return \Symfony\Component\HttpFoundation\RedirectResponse
124 | */
125 | private function getAuthorizationFirst($provider)
126 | {
127 | return $this->socialite->driver($provider)->redirect();
128 | }
129 |
130 | /**
131 | * Get Data from Social Media Account
132 | * @param string $provider
133 | * @return collection
134 | */
135 | private function getSocialUser($provider)
136 | {
137 | return $this->socialite->driver($provider)->user();
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/app/Http/Controllers/PageController.php:
--------------------------------------------------------------------------------
1 | getAllUsersOnYourTeam(4);
19 |
20 | return view('api.slack')->withMembers($members);
21 | }
22 |
23 | /**
24 | * Get All Users on Your Team
25 | * @return array
26 | */
27 | private function getAllUsersOnYourTeam($count = null)
28 | {
29 | $list = (array)SlackUser::lists();
30 |
31 | if (is_null($count)) {
32 | return $list['members'];
33 | }
34 |
35 | return array_slice($list['members'], 0, $count);
36 | }
37 |
38 | /**
39 | * Send Message to Channel or Group
40 | * @param Request $request
41 | * @return Session
42 | */
43 | public function sendMessageToTeam(Request $request)
44 | {
45 | $this->validate($request, [
46 | 'message' => 'required'
47 | ]);
48 |
49 | $message = $request->input('message') . ' #FromLaravelHackathonStarter :smile:';
50 |
51 | SlackChat::message('#general', $message);
52 |
53 | return redirect()->back()->with('info', trans('texts.message.sent_success'));
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/Http/Controllers/SteamController.php:
--------------------------------------------------------------------------------
1 | tumblr = new Tumblr();
22 |
23 | // Set API key.
24 | $this->tumblr->setApiKey(env('TUMBLR_API_KEY'));
25 | }
26 |
27 | /**
28 | * Get Basic Information about the blog
29 | * @return array
30 | */
31 | private function getBlogInfo($tumblrBlogUrl)
32 | {
33 | $info = $this->tumblr->blogInfo($tumblrBlogUrl);
34 |
35 | return (array)$info;
36 | }
37 |
38 | /**
39 | * Get Posts from the Tumblr blog
40 | * @return array
41 | */
42 | private function getPosts($tumblrBlogUrl)
43 | {
44 | $info = $this->tumblr->posts($tumblrBlogUrl);
45 |
46 | return (array)$info->response->posts;
47 | }
48 |
49 | /**
50 | * Return all data to the Tumblr API dashboard
51 | * @return mixed
52 | */
53 | public function getPage()
54 | {
55 | $posts = $this->getPosts('taylorswift.tumblr.com');
56 |
57 | return view('api.tumblr')->withPosts($posts);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/Http/Controllers/TwilioController.php:
--------------------------------------------------------------------------------
1 | validate($request, [
29 | 'message' => 'required',
30 | 'number' => 'required'
31 | ]);
32 |
33 | $number = $request->input('number');
34 | $message = $request->input('message') . ' #LaravelHackathonStarter';
35 |
36 | Twilio::message($number, $message);
37 |
38 | return redirect()->back()->with('info', trans('texts.message.sent_success'));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/Http/Controllers/TwitterController.php:
--------------------------------------------------------------------------------
1 | searchItem = 'laravel';
25 | }
26 |
27 | /**
28 | * Return all tweets to the Twitter API dashboard
29 | * @return mixed
30 | */
31 | public function getPage()
32 | {
33 | if( Session::get('provider') !== 'twitter') {
34 | Auth::logout();
35 |
36 | Session::flush();
37 |
38 | return redirect('/auth/twitter');
39 | }
40 |
41 | $searchedTweets = json_decode($this->searchForTweets($this->searchItem), true);
42 |
43 | return view('api.twitter')->withTweets($searchedTweets['statuses']);
44 | }
45 |
46 | /**
47 | * Get the latest tweets on a user timeline
48 | * @return Collection
49 | */
50 | private function getLatestTweets()
51 | {
52 | return Twitter::getHomeTimeline(['count' => 2, 'format' => 'json']);
53 | }
54 |
55 | /**
56 | * Search for tweets based on a search query
57 | * @param string $item
58 | * @return Collection
59 | */
60 | private function searchForTweets($item)
61 | {
62 | return Twitter::getSearch(['q' => $item, 'count' => 4, 'format' => 'json']);
63 | }
64 |
65 | /**
66 | * Post a tweet to the timeline
67 | * @param Request $request
68 | * @return string
69 | */
70 | public function sendTweet(Request $request)
71 | {
72 | $this->validate($request, [
73 | 'tweet' => 'required',
74 | ]);
75 |
76 | $tweet = $request->input('tweet') . ' #LaravelHackathonStarter';
77 |
78 | Twitter::reconfig(['token' => Auth::user()->getAccessToken(), 'secret' => Auth::user()->getAccessTokenSecret()]);
79 |
80 | Twitter::postTweet(['status' => $tweet, 'format' => 'json']);
81 |
82 | return redirect()->back()->with('info', trans('texts.twitter.success'));
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/app/Http/Controllers/WebScrapingController.php:
--------------------------------------------------------------------------------
1 | client = new Client();
20 | }
21 |
22 | /**
23 | * Return all data to the Stripe API dashboard
24 | * @return mixed
25 | */
26 | public function getPage()
27 | {
28 | $links = $this->getData(self::NEWS_URL);
29 |
30 | return view('api.scraping')->withLinks($links);
31 | }
32 |
33 | /**
34 | * Scrape the Links
35 | * @param $siteToCrawl
36 | * @return array
37 | */
38 | public function getData($siteToCrawl)
39 | {
40 | $crawler = $this->client->request('GET', $siteToCrawl);
41 |
42 | $arr = $crawler->filter('.title a[href^="http"], a[href^="https"]')->each(function($element) {
43 | $links = [];
44 |
45 | array_push($links, $element->text());
46 |
47 | return $links;
48 | });
49 |
50 | return $arr;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Http/Controllers/YahooController.php:
--------------------------------------------------------------------------------
1 | baseUrl = self::YAHOO_API;
29 | $this->client = new Client(['base_uri' => $this->baseUrl]);
30 |
31 | $query = "SELECT * FROM weather.forecast WHERE (location = 10007)";
32 |
33 | $relativeUrl = '?q=' . $query . '&format=json';
34 | $this->setGetResponse($relativeUrl);
35 | }
36 |
37 | /**
38 | * Get the response from Yahoo API
39 | * @param string $relativeUrl
40 | */
41 | private function setGetResponse($relativeUrl)
42 | {
43 | $this->response = $this->client->get($this->baseUrl . $relativeUrl, []);
44 | }
45 |
46 | /**
47 | * Get the whole response from a get operation
48 | * @return array
49 | */
50 | private function getResponse()
51 | {
52 | return json_decode($this->response->getBody(), true);
53 | }
54 |
55 | /**
56 | * Get the data response from a get operation
57 | * @return array
58 | */
59 | private function getData()
60 | {
61 | return $this->getResponse()['query']['results']['channel'];
62 | }
63 |
64 |
65 | /**
66 | * Return all data to the Yahoo API dashboard
67 | * @return mixed
68 | */
69 | public function getPage()
70 | {
71 | $data = $this->getData();
72 |
73 | return view('api.yahoo')->withData($data);
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
27 | \App\Http\Middleware\EncryptCookies::class,
28 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
29 | \Illuminate\Session\Middleware\StartSession::class,
30 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
31 | \App\Http\Middleware\VerifyCsrfToken::class,
32 | ],
33 |
34 | 'api' => [
35 | 'throttle:60,1',
36 | ],
37 | ];
38 |
39 | /**
40 | * The application's route middleware.
41 | *
42 | * These middleware may be assigned to groups or used individually.
43 | *
44 | * @var array
45 | */
46 | protected $routeMiddleware = [
47 | 'auth' => \App\Http\Middleware\Authenticate::class,
48 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
49 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
50 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
51 | ];
52 | }
53 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | guest()) {
21 | if ($request->ajax() || $request->wantsJson()) {
22 | return response('Unauthorized.', 401);
23 | } else {
24 | return redirect()->guest('login');
25 | }
26 | }
27 |
28 | return $next($request);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | app->environment() )
30 | {
31 | // development env
32 | case 'local':
33 | if( $this->app->runningInConsole() )
34 | {
35 | // Some dev tools to generate some code completion helpers (some fake php files)
36 | $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
37 | }
38 | // A 'in browser' debug bar
39 | $this->app->register(\Barryvdh\Debugbar\ServiceProvider::class);
40 | break;
41 | // testing env
42 | case '':
43 | break;
44 | // production env
45 | case '':
46 | break;
47 | }
48 |
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/Providers/AuthServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any application authentication / authorization services.
21 | *
22 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate
23 | * @return void
24 | */
25 | public function boot(GateContract $gate)
26 | {
27 | $this->registerPolicies($gate);
28 |
29 | //
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Providers/EventServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
17 | 'SocialiteProviders\LinkedIn\LinkedInExtendSocialite@handle',
18 | 'SocialiteProviders\Foursquare\FoursquareExtendSocialite@handle',
19 | 'SocialiteProviders\Instagram\InstagramExtendSocialite@handle',
20 | ],
21 | 'event.name' => [
22 | 'EventListener',
23 | ],
24 | ];
25 |
26 | /**
27 | * Register any other events for your application.
28 | *
29 | * @param \Illuminate\Contracts\Events\Dispatcher $events
30 | * @return void
31 | */
32 | public function boot(DispatcherContract $events)
33 | {
34 | parent::boot($events);
35 |
36 | //
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | group(['namespace' => $this->namespace], function ($router) {
41 | require app_path('Http/routes.php');
42 | });
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/User.php:
--------------------------------------------------------------------------------
1 | avatar)) {
31 | return "http://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))) . "?d=mm&s=40";
32 | }
33 |
34 | return $this->avatar;
35 | }
36 |
37 | public function getAccessToken()
38 | {
39 | return $this->oauth_token;
40 | }
41 |
42 | public function getAccessTokenSecret()
43 | {
44 | return $this->oauth_token_secret;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | # PHP
2 | # Test and package your PHP application.
3 | # Add steps that run tests, save build artifacts, deploy, and more:
4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/php
5 |
6 | pool:
7 | vmImage: 'Ubuntu 16.04'
8 |
9 | variables:
10 | phpVersion: 7.2
11 |
12 | steps:
13 | - script: |
14 | sudo update-alternatives --set php /usr/bin/php$(phpVersion)
15 | sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
16 | sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
17 | sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
18 | sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
19 | php -version
20 | displayName: 'Use PHP version $(phpVersion)'
21 |
22 | - script: composer install --no-interaction --prefer-dist
23 | displayName: 'composer install'
24 |
--------------------------------------------------------------------------------
/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 | =5.5.9",
9 | "laravel/framework": "5.2.*",
10 | "laravel/socialite": "^2.0",
11 | "socialiteproviders/instagram": "^1.1",
12 | "socialiteproviders/linkedin": "^1.1",
13 | "jrm2k6/cloudder": "^0.2.2",
14 | "graham-campbell/github": "^4.2",
15 | "thujohn/twitter": "^2.1",
16 | "aloha/twilio": "^2.0",
17 | "fabpot/goutte": "^3.1",
18 | "mjerwin/clockwork-sms": "^0.9.1",
19 | "lob/lob-php": "^1.6",
20 | "vluzrmos/slack-api": "^0.4.6",
21 | "vinkla/facebook": "^2.0",
22 | "linkedinapi/linkedin": "^1.1",
23 | "socialiteproviders/foursquare": "^1.1",
24 | "hownowstephen/php-foursquare": "1.2.*",
25 | "jaapz/tumblr": "dev-master",
26 | "dandelionmood/lastfm": "^0.6.0"
27 | },
28 | "require-dev": {
29 | "fzaninotto/faker": "~1.4",
30 | "mockery/mockery": "0.9.*",
31 | "phpunit/phpunit": "~4.0",
32 | "symfony/css-selector": "2.8.*|3.0.*",
33 | "symfony/dom-crawler": "2.8.*|3.0.*",
34 | "barryvdh/laravel-debugbar": "^2.3",
35 | "barryvdh/laravel-ide-helper": "^2.2",
36 | "doctrine/dbal": "^2.5"
37 | },
38 | "autoload": {
39 | "classmap": [
40 | "database"
41 | ],
42 | "files": [
43 | "app/Http/helpers.php"
44 | ],
45 | "psr-4": {
46 | "App\\": "app/"
47 | }
48 | },
49 | "autoload-dev": {
50 | "classmap": [
51 | "tests/TestCase.php"
52 | ]
53 | },
54 | "scripts": {
55 | },
56 | "config": {
57 | "preferred-install": "dist"
58 | },
59 | "minimum-stability": "dev",
60 | "prefer-stable": true
61 | }
62 |
--------------------------------------------------------------------------------
/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 | | Here you may set the options for resetting passwords including the view
85 | | that is your password reset e-mail. You may also set the name of the
86 | | table that maintains all of the reset tokens for your application.
87 | |
88 | | You may specify multiple password reset configurations if you have more
89 | | than one user table or model in the application and you want to have
90 | | separate password reset settings based on the specific user types.
91 | |
92 | | The expire time is the number of minutes that the reset token should be
93 | | considered valid. This security feature keeps tokens short-lived so
94 | | they have less time to be guessed. You may change this as needed.
95 | |
96 | */
97 |
98 | 'passwords' => [
99 | 'users' => [
100 | 'provider' => 'users',
101 | 'email' => 'auth.emails.password',
102 | 'table' => 'password_resets',
103 | 'expire' => 60,
104 | ],
105 | ],
106 |
107 | ];
108 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'pusher'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Broadcast Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may define all of the broadcast connections that will be used
24 | | to broadcast events to other systems or over websockets. Samples of
25 | | each available type of connection are provided inside this array.
26 | |
27 | */
28 |
29 | 'connections' => [
30 |
31 | 'pusher' => [
32 | 'driver' => 'pusher',
33 | 'key' => env('PUSHER_KEY'),
34 | 'secret' => env('PUSHER_SECRET'),
35 | 'app_id' => env('PUSHER_APP_ID'),
36 | 'options' => [
37 | //
38 | ],
39 | ],
40 |
41 | 'redis' => [
42 | 'driver' => 'redis',
43 | 'connection' => 'default',
44 | ],
45 |
46 | 'log' => [
47 | 'driver' => 'log',
48 | ],
49 |
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Cache Stores
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may define all of the cache "stores" for your application as
24 | | well as their drivers. You may even define multiple stores for the
25 | | same cache driver to group types of items stored in your caches.
26 | |
27 | */
28 |
29 | 'stores' => [
30 |
31 | 'apc' => [
32 | 'driver' => 'apc',
33 | ],
34 |
35 | 'array' => [
36 | 'driver' => 'array',
37 | ],
38 |
39 | 'database' => [
40 | 'driver' => 'database',
41 | 'table' => 'cache',
42 | 'connection' => null,
43 | ],
44 |
45 | 'file' => [
46 | 'driver' => 'file',
47 | 'path' => storage_path('framework/cache'),
48 | ],
49 |
50 | 'memcached' => [
51 | 'driver' => 'memcached',
52 | 'servers' => [
53 | [
54 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
55 | 'port' => env('MEMCACHED_PORT', 11211),
56 | 'weight' => 100,
57 | ],
58 | ],
59 | ],
60 |
61 | 'redis' => [
62 | 'driver' => 'redis',
63 | 'connection' => 'default',
64 | ],
65 |
66 | ],
67 |
68 | /*
69 | |--------------------------------------------------------------------------
70 | | Cache Key Prefix
71 | |--------------------------------------------------------------------------
72 | |
73 | | When utilizing a RAM based store such as APC or Memcached, there might
74 | | be other applications utilizing the same cache. So, we'll specify a
75 | | value to get prefixed to all our keys so we can avoid collisions.
76 | |
77 | */
78 |
79 | 'prefix' => 'laravel',
80 |
81 | ];
82 |
--------------------------------------------------------------------------------
/config/cloudder.php:
--------------------------------------------------------------------------------
1 | env('CLOUDINARY_CLOUD_NAME'),
16 | 'baseUrl' => env('CLOUDINARY_BASE_URL', 'http://res.cloudinary.com/'.env('CLOUDINARY_CLOUD_NAME')),
17 | 'secureUrl' => env('CLOUDINARY_SECURE_URL', 'https://res.cloudinary.com/'.env('CLOUDINARY_CLOUD_NAME')),
18 | 'apiBaseUrl' => env('CLOUDINARY_API_BASE_URL', 'https://api.cloudinary.com/v1_1/'.env('CLOUDINARY_CLOUD_NAME')),
19 | 'apiKey' => env('CLOUDINARY_API_KEY'),
20 | 'apiSecret' => env('CLOUDINARY_API_SECRET'),
21 |
22 | 'scaling' => array(
23 | 'format' => 'png',
24 | 'width' => 150,
25 | 'height' => 150,
26 | 'crop' => 'fit',
27 | 'effect' => null
28 | )
29 |
30 | );
31 |
--------------------------------------------------------------------------------
/config/compile.php:
--------------------------------------------------------------------------------
1 | [
17 | //
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled File Providers
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may list service providers which define a "compiles" function
26 | | that returns additional files that should be compiled, providing an
27 | | easy way to get common files from any packages you are utilizing.
28 | |
29 | */
30 |
31 | 'providers' => [
32 | //
33 | ],
34 |
35 | ];
36 |
--------------------------------------------------------------------------------
/config/database.php:
--------------------------------------------------------------------------------
1 | PDO::FETCH_CLASS,
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Database Connection Name
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may specify which of the database connections below you wish
24 | | to use as your default connection for all database work. Of course
25 | | you may use many connections at once using the Database library.
26 | |
27 | */
28 |
29 | 'default' => env('DB_CONNECTION', 'pgsql'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Database Connections
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here are each of the database connections setup for your application.
37 | | Of course, examples of configuring each database platform that is
38 | | supported by Laravel is shown below to make development simple.
39 | |
40 | |
41 | | All database work in Laravel is done through the PHP PDO facilities
42 | | so make sure you have the driver for your particular database of
43 | | choice installed on your machine before you begin development.
44 | |
45 | */
46 |
47 | 'connections' => [
48 |
49 | 'sqlite' => [
50 | 'driver' => 'sqlite',
51 | 'database' => database_path('database.sqlite'),
52 | 'prefix' => '',
53 | ],
54 |
55 | 'mysql' => [
56 | 'driver' => 'mysql',
57 | 'host' => env('DB_HOST', 'localhost'),
58 | 'database' => env('DB_DATABASE', 'forge'),
59 | 'username' => env('DB_USERNAME', 'forge'),
60 | 'password' => env('DB_PASSWORD', ''),
61 | 'charset' => 'utf8',
62 | 'collation' => 'utf8_unicode_ci',
63 | 'prefix' => '',
64 | 'strict' => false,
65 | 'engine' => null,
66 | ],
67 |
68 | 'pgsql' => [
69 | 'driver' => 'pgsql',
70 | 'host' => env('DB_HOST', 'localhost'),
71 | 'database' => env('DB_DATABASE', 'forge'),
72 | 'username' => env('DB_USERNAME', 'forge'),
73 | 'password' => env('DB_PASSWORD', ''),
74 | 'charset' => 'utf8',
75 | 'prefix' => '',
76 | 'schema' => 'public',
77 | ],
78 |
79 | 'sqlsrv' => [
80 | 'driver' => 'sqlsrv',
81 | 'host' => env('DB_HOST', 'localhost'),
82 | 'database' => env('DB_DATABASE', 'forge'),
83 | 'username' => env('DB_USERNAME', 'forge'),
84 | 'password' => env('DB_PASSWORD', ''),
85 | 'charset' => 'utf8',
86 | 'prefix' => '',
87 | ],
88 |
89 | ],
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Migration Repository Table
94 | |--------------------------------------------------------------------------
95 | |
96 | | This table keeps track of all the migrations that have already run for
97 | | your application. Using this information, we can determine which of
98 | | the migrations on disk haven't actually been run in the database.
99 | |
100 | */
101 |
102 | 'migrations' => 'migrations',
103 |
104 | /*
105 | |--------------------------------------------------------------------------
106 | | Redis Databases
107 | |--------------------------------------------------------------------------
108 | |
109 | | Redis is an open source, fast, and advanced key-value store that also
110 | | provides a richer set of commands than a typical key-value systems
111 | | such as APC or Memcached. Laravel makes it easy to dig right in.
112 | |
113 | */
114 |
115 | 'redis' => [
116 |
117 | 'cluster' => false,
118 |
119 | 'default' => [
120 | 'host' => env('REDIS_HOST', 'localhost'),
121 | 'password' => env('REDIS_PASSWORD', null),
122 | 'port' => env('REDIS_PORT', 6379),
123 | 'database' => 0,
124 | ],
125 |
126 | ],
127 |
128 | ];
129 |
--------------------------------------------------------------------------------
/config/facebook.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | return [
13 |
14 | /*
15 | |--------------------------------------------------------------------------
16 | | Default Connection Name
17 | |--------------------------------------------------------------------------
18 | |
19 | | Here you may specify which of the connections below you wish to use as
20 | | your default connection for all work. Of course, you may use many
21 | | connections at once using the manager class.
22 | |
23 | */
24 |
25 | 'default' => 'main',
26 |
27 | /*
28 | |--------------------------------------------------------------------------
29 | | Facebook Connections
30 | |--------------------------------------------------------------------------
31 | |
32 | | Here are each of the connections setup for your application. Example
33 | | configuration has been included, but you may add as many connections as
34 | | you would like.
35 | |
36 | */
37 |
38 | 'connections' => [
39 |
40 | 'main' => [
41 | 'app_id' => env('FACEBOOK_CLIENT_ID'),
42 | 'app_secret' => env('FACEBOOK_CLIENT_SECRET'),
43 | 'default_graph_version' => 'v2.4',
44 | //'default_access_token' => null,
45 | ],
46 |
47 | 'alternative' => [
48 | 'app_id' => env('FACEBOOK_CLIENT_ID'),
49 | 'app_secret' => env('FACEBOOK_CLIENT_SECRET'),
50 | 'default_graph_version' => 'v2.4',
51 | //'default_access_token' => null,
52 | ],
53 |
54 | ],
55 |
56 | ];
57 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | 'local',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Default Cloud Filesystem Disk
23 | |--------------------------------------------------------------------------
24 | |
25 | | Many applications store files both locally and in the cloud. For this
26 | | reason, you may specify a default "cloud" driver here. This driver
27 | | will be bound as the Cloud disk implementation in the container.
28 | |
29 | */
30 |
31 | 'cloud' => 's3',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Filesystem Disks
36 | |--------------------------------------------------------------------------
37 | |
38 | | Here you may configure as many filesystem "disks" as you wish, and you
39 | | may even configure multiple disks of the same driver. Defaults have
40 | | been setup for each driver as an example of the required options.
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'ftp' => [
52 | 'driver' => 'ftp',
53 | 'host' => 'ftp.example.com',
54 | 'username' => 'your-username',
55 | 'password' => 'your-password',
56 |
57 | // Optional FTP Settings...
58 | // 'port' => 21,
59 | // 'root' => '',
60 | // 'passive' => true,
61 | // 'ssl' => true,
62 | // 'timeout' => 30,
63 | ],
64 |
65 | 's3' => [
66 | 'driver' => 's3',
67 | 'key' => 'your-key',
68 | 'secret' => 'your-secret',
69 | 'region' => 'your-region',
70 | 'bucket' => 'your-bucket',
71 | ],
72 |
73 | 'rackspace' => [
74 | 'driver' => 'rackspace',
75 | 'username' => 'your-username',
76 | 'key' => 'your-key',
77 | 'container' => 'your-container',
78 | 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
79 | 'region' => 'IAD',
80 | 'url_type' => 'publicURL',
81 | ],
82 |
83 | ],
84 |
85 | ];
86 |
--------------------------------------------------------------------------------
/config/github.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | return [
13 |
14 | /*
15 | |--------------------------------------------------------------------------
16 | | Default Connection Name
17 | |--------------------------------------------------------------------------
18 | |
19 | | Here you may specify which of the connections below you wish to use as
20 | | your default connection for all work. Of course, you may use many
21 | | connections at once using the manager class.
22 | |
23 | */
24 |
25 | 'default' => 'main',
26 |
27 | /*
28 | |--------------------------------------------------------------------------
29 | | GitHub Connections
30 | |--------------------------------------------------------------------------
31 | |
32 | | Here are each of the connections setup for your application. Example
33 | | configuration has been included, but you may add as many connections as
34 | | you would like. Note that the 3 supported authentication methods are:
35 | | "application", "password", and "token".
36 | |
37 | */
38 |
39 | 'connections' => [
40 |
41 | 'main' => [
42 | 'token' => 'your-token',
43 | 'method' => 'token',
44 | // 'baseUrl' => 'https://api.github.com/',
45 | // 'version' => 'v3',
46 | ],
47 |
48 | 'alternative' => [
49 | 'clientId' => env('GITHUB_CLIENT_ID'),
50 | 'clientSecret' => env('GITHUB_CLIENT_SECRET'),
51 | 'method' => 'application',
52 | // 'baseUrl' => 'https://api.github.com/',
53 | // 'version' => 'v3',
54 | ],
55 |
56 | 'other' => [
57 | 'username' => 'your-username',
58 | 'password' => 'your-password',
59 | 'method' => 'password',
60 | // 'baseUrl' => 'https://api.github.com/',
61 | // 'version' => 'v3',
62 | ],
63 |
64 | ],
65 |
66 | ];
67 |
--------------------------------------------------------------------------------
/config/instagram.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | return [
13 |
14 | /*
15 | |--------------------------------------------------------------------------
16 | | Default Connection Name
17 | |--------------------------------------------------------------------------
18 | |
19 | | Here you may specify which of the connections below you wish to use as
20 | | your default connection for all work. Of course, you may use many
21 | | connections at once using the manager class.
22 | |
23 | */
24 |
25 | 'default' => 'main',
26 |
27 | /*
28 | |--------------------------------------------------------------------------
29 | | Instagram Connections
30 | |--------------------------------------------------------------------------
31 | |
32 | | Here are each of the connections setup for your application. Example
33 | | configuration has been included, but you may add as many connections as
34 | | you would like.
35 | |
36 | */
37 |
38 | 'connections' => [
39 |
40 | 'main' => [
41 | 'client_id' => env('INSTAGRAM_CLIENT_ID'),
42 | 'client_secret' => env('INSTAGRAM_CLIENT_SECRET'),
43 | 'callback_url' => env('INSTAGRAM_CALLBACK_URL'),
44 | ],
45 |
46 | 'alternative' => [
47 | 'client_id' => 'your-client-id',
48 | 'client_secret' => null,
49 | 'callback_url' => null,
50 | ],
51 |
52 | ],
53 |
54 | ];
55 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_DRIVER', 'smtp'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | SMTP Host Address
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may provide the host address of the SMTP server used by your
26 | | applications. A default option is provided that is compatible with
27 | | the Mailgun mail service which will provide reliable deliveries.
28 | |
29 | */
30 |
31 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | SMTP Host Port
36 | |--------------------------------------------------------------------------
37 | |
38 | | This is the SMTP port used by your application to deliver e-mails to
39 | | users of the application. Like the host we have set this value to
40 | | stay compatible with the Mailgun e-mail application by default.
41 | |
42 | */
43 |
44 | 'port' => env('MAIL_PORT', 587),
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Global "From" Address
49 | |--------------------------------------------------------------------------
50 | |
51 | | You may wish for all e-mails sent by your application to be sent from
52 | | the same address. Here, you may specify a name and address that is
53 | | used globally for all e-mails that are sent by your application.
54 | |
55 | */
56 |
57 | 'from' => ['address' => 'unicodeveloper@laravel-pipelines-php.com', 'name' => 'Laravel and Azure Pipelines'],
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | E-Mail Encryption Protocol
62 | |--------------------------------------------------------------------------
63 | |
64 | | Here you may specify the encryption protocol that should be used when
65 | | the application send e-mail messages. A sensible default using the
66 | | transport layer security protocol should provide great security.
67 | |
68 | */
69 |
70 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
71 |
72 | /*
73 | |--------------------------------------------------------------------------
74 | | SMTP Server Username
75 | |--------------------------------------------------------------------------
76 | |
77 | | If your SMTP server requires a username for authentication, you should
78 | | set it here. This will get used to authenticate with your server on
79 | | connection. You may also set the "password" value below this one.
80 | |
81 | */
82 |
83 | 'username' => env('MAIL_USERNAME'),
84 |
85 | /*
86 | |--------------------------------------------------------------------------
87 | | SMTP Server Password
88 | |--------------------------------------------------------------------------
89 | |
90 | | Here you may set the password required by your SMTP server to send out
91 | | messages from your application. This will be given to the server on
92 | | connection so that the application will be able to send messages.
93 | |
94 | */
95 |
96 | 'password' => env('MAIL_PASSWORD'),
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Sendmail System Path
101 | |--------------------------------------------------------------------------
102 | |
103 | | When using the "sendmail" driver to send e-mails, we will need to know
104 | | the path to where Sendmail lives on this server. A default path has
105 | | been provided here, which will work well on most of your systems.
106 | |
107 | */
108 |
109 | 'sendmail' => '/usr/sbin/sendmail -bs',
110 |
111 | ];
112 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_DRIVER', 'sync'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Queue Connections
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may configure the connection information for each server that
27 | | is used by your application. A default configuration has been added
28 | | for each back-end shipped with Laravel. You are free to add more.
29 | |
30 | */
31 |
32 | 'connections' => [
33 |
34 | 'sync' => [
35 | 'driver' => 'sync',
36 | ],
37 |
38 | 'database' => [
39 | 'driver' => 'database',
40 | 'table' => 'jobs',
41 | 'queue' => 'default',
42 | 'expire' => 60,
43 | ],
44 |
45 | 'beanstalkd' => [
46 | 'driver' => 'beanstalkd',
47 | 'host' => 'localhost',
48 | 'queue' => 'default',
49 | 'ttr' => 60,
50 | ],
51 |
52 | 'sqs' => [
53 | 'driver' => 'sqs',
54 | 'key' => 'your-public-key',
55 | 'secret' => 'your-secret-key',
56 | 'prefix' => 'https://your-queue-host/your-account-id',
57 | 'queue' => 'your-queue-name',
58 | 'region' => 'us-east-1',
59 | ],
60 |
61 | 'redis' => [
62 | 'driver' => 'redis',
63 | 'connection' => 'default',
64 | 'queue' => 'default',
65 | 'expire' => 60,
66 | ],
67 |
68 | ],
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Failed Queue Jobs
73 | |--------------------------------------------------------------------------
74 | |
75 | | These options configure the behavior of failed queue job logging so you
76 | | can control which database and table are used to store the jobs that
77 | | have failed. You may change them to any database / table you wish.
78 | |
79 | */
80 |
81 | 'failed' => [
82 | 'database' => env('DB_CONNECTION', 'mysql'),
83 | 'table' => 'failed_jobs',
84 | ],
85 |
86 | ];
87 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | ],
21 |
22 | 'mandrill' => [
23 | 'secret' => env('MANDRILL_SECRET'),
24 | ],
25 |
26 | 'ses' => [
27 | 'key' => env('SES_KEY'),
28 | 'secret' => env('SES_SECRET'),
29 | 'region' => 'us-east-1',
30 | ],
31 |
32 | 'stripe' => [
33 | 'model' => App\User::class,
34 | 'key' => env('STRIPE_KEY'),
35 | 'secret' => env('STRIPE_SECRET'),
36 | ],
37 |
38 | 'facebook' => [
39 | 'client_id' => env('FACEBOOK_CLIENT_ID'),
40 | 'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
41 | 'redirect' => env('FACEBOOK_CALLBACK_URL'),
42 | ],
43 |
44 | 'twitter' => [
45 | 'client_id' => env('TWITTER_API_KEY'),
46 | 'client_secret' => env('TWITTER_APP_SECRET'),
47 | 'redirect' => env('TWITTER_CALLBACK_URL')
48 | ],
49 |
50 | 'github' => [
51 | 'client_id' => env('GITHUB_CLIENT_ID'),
52 | 'client_secret' => env('GITHUB_CLIENT_SECRET'),
53 | 'redirect' => env('GITHUB_CALLBACK_URL')
54 | ],
55 |
56 | 'bitbucket' => [
57 | 'client_id' => env('BITBUCKET_CLIENT_ID'),
58 | 'client_secret' => env('BITBUCKET_CLIENT_SECRET'),
59 | 'redirect' => env('BITBUCKET_CALLBACK_URL')
60 | ],
61 |
62 | 'google' => [
63 | 'client_id' => env('GOOGLE_CLIENT_ID'),
64 | 'client_secret' => env('GOOGLE_CLIENT_SECRET'),
65 | 'redirect' => env('GOOGLE_CALLBACK_URL')
66 | ],
67 |
68 | 'instagram' => [
69 | 'client_id' => env('INSTAGRAM_CLIENT_ID'),
70 | 'client_secret' => env('INSTAGRAM_CLIENT_SECRET'),
71 | 'redirect' => env('INSTAGRAM_CALLBACK_URL')
72 | ],
73 |
74 | 'linkedin' => [
75 | 'client_id' => env('LINKEDIN_CLIENT_ID'),
76 | 'client_secret' => env('LINKEDIN_CLIENT_SECRET'),
77 | 'redirect' => env('LINKEDIN_CALLBACK_URL')
78 | ],
79 |
80 | 'foursquare' => [
81 | 'client_id' => env('FOURSQUARE_KEY'),
82 | 'client_secret' => env('FOURSQUARE_SECRET'),
83 | 'redirect' => env('FOURSQUARE_CALLBACK_URL'),
84 | ],
85 |
86 | 'slack' => [
87 | 'token' => env('SLACK_TOKEN')
88 | ]
89 |
90 | ];
91 |
--------------------------------------------------------------------------------
/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 Sweeping Lottery
91 | |--------------------------------------------------------------------------
92 | |
93 | | Some session drivers must manually sweep their storage location to get
94 | | rid of old sessions from storage. Here are the chances that it will
95 | | happen on a given request. By default, the odds are 2 out of 100.
96 | |
97 | */
98 |
99 | 'lottery' => [2, 100],
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Session Cookie Name
104 | |--------------------------------------------------------------------------
105 | |
106 | | Here you may change the name of the cookie used to identify a session
107 | | instance by ID. The name specified here will get used every time a
108 | | new session cookie is created by the framework for every driver.
109 | |
110 | */
111 |
112 | 'cookie' => 'laravel_session',
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Session Cookie Path
117 | |--------------------------------------------------------------------------
118 | |
119 | | The session cookie path determines the path for which the cookie will
120 | | be regarded as available. Typically, this will be the root path of
121 | | your application but you are free to change this when necessary.
122 | |
123 | */
124 |
125 | 'path' => '/',
126 |
127 | /*
128 | |--------------------------------------------------------------------------
129 | | Session Cookie Domain
130 | |--------------------------------------------------------------------------
131 | |
132 | | Here you may change the domain of the cookie used to identify a session
133 | | in your application. This will determine which domains the cookie is
134 | | available to in your application. A sensible default has been set.
135 | |
136 | */
137 |
138 | 'domain' => null,
139 |
140 | /*
141 | |--------------------------------------------------------------------------
142 | | HTTPS Only Cookies
143 | |--------------------------------------------------------------------------
144 | |
145 | | By setting this option to true, session cookies will only be sent back
146 | | to the server if the browser has a HTTPS connection. This will keep
147 | | the cookie from being sent to you if it can not be done securely.
148 | |
149 | */
150 |
151 | 'secure' => false,
152 |
153 | ];
154 |
--------------------------------------------------------------------------------
/config/ttwitter.php:
--------------------------------------------------------------------------------
1 | false,
7 |
8 | 'API_URL' => 'api.twitter.com',
9 | 'UPLOAD_URL' => 'upload.twitter.com',
10 | 'API_VERSION' => '1.1',
11 | 'AUTHENTICATE_URL' => 'https://api.twitter.com/oauth/authenticate',
12 | 'AUTHORIZE_URL' => 'https://api.twitter.com/oauth/authorize',
13 | 'ACCESS_TOKEN_URL' => 'https://api.twitter.com/oauth/access_token',
14 | 'REQUEST_TOKEN_URL' => 'https://api.twitter.com/oauth/request_token',
15 | 'USE_SSL' => true,
16 |
17 | 'CONSUMER_KEY' => function_exists('env') ? env('TWITTER_API_KEY', '') : '',
18 | 'CONSUMER_SECRET' => function_exists('env') ? env('TWITTER_APP_SECRET', '') : '',
19 | 'ACCESS_TOKEN' => function_exists('env') ? env('TWITTER_ACCESS_TOKEN', '') : '',
20 | 'ACCESS_TOKEN_SECRET' => function_exists('env') ? env('TWITTER_ACCESS_TOKEN_SECRET', '') : '',
21 | ];
22 |
--------------------------------------------------------------------------------
/config/twilio.php:
--------------------------------------------------------------------------------
1 | [
6 |
7 | 'default' => 'twilio',
8 |
9 | 'connections' => [
10 |
11 | 'twilio' => [
12 |
13 | /*
14 | |--------------------------------------------------------------------------
15 | | SID
16 | |--------------------------------------------------------------------------
17 | |
18 | | Your Twilio Account SID #
19 | |
20 | */
21 |
22 | 'sid' => env('TWILIO_SID'),
23 |
24 | /*
25 | |--------------------------------------------------------------------------
26 | | Access Token
27 | |--------------------------------------------------------------------------
28 | |
29 | | Access token that can be found in your Twilio dashboard
30 | |
31 | */
32 |
33 | 'token' => env('TWILIO_TOKEN'),
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | From Number
38 | |--------------------------------------------------------------------------
39 | |
40 | | The Phone number registered with Twilio that your SMS & Calls will come from
41 | |
42 | */
43 |
44 | 'from' => env('TWILIO_FROM'),
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Verify Twilio's SSL Certificates
49 | |--------------------------------------------------------------------------
50 | |
51 | | Allows the client to bypass verifiying Twilio's SSL certificates.
52 | | It is STRONGLY advised to leave this set to true for production environments.
53 | |
54 | */
55 |
56 | 'ssl_verify' => true,
57 |
58 | ],
59 | ],
60 | ],
61 | ];
62 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | realpath(base_path('resources/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 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MicrosoftDocs/pipelines-php/3a6985f396c217377a874b30dea2bb185f02e0ec/database/.gitignore
--------------------------------------------------------------------------------
/database/database.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MicrosoftDocs/pipelines-php/3a6985f396c217377a874b30dea2bb185f02e0ec/database/database.sqlite
--------------------------------------------------------------------------------
/database/factories/ModelFactory.php:
--------------------------------------------------------------------------------
1 | define(App\User::class, function (Faker\Generator $faker) {
15 | return [
16 | 'name' => $faker->name,
17 | 'email' => $faker->email,
18 | 'password' => bcrypt(str_random(10)),
19 | 'remember_token' => str_random(10),
20 | ];
21 | });
22 |
--------------------------------------------------------------------------------
/database/migrations/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MicrosoftDocs/pipelines-php/3a6985f396c217377a874b30dea2bb185f02e0ec/database/migrations/.gitkeep
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->string('fullname')->nullable();
18 | $table->string('username')->nullable()->unique();
19 | $table->string('email')->nullable()->unique();
20 | $table->string('password', 60)->nullable();
21 | $table->char('gender')->nullable();
22 | $table->text('location')->nullable();
23 | $table->text('website')->nullable();
24 | $table->string('provider')->nullable();
25 | $table->string('oauth_token')->nullable();
26 | $table->string('oauth_token_secret')->nullable();
27 | $table->string('provider_id')->unique()->nullable();
28 | $table->string('avatar')->nullable();
29 | $table->rememberToken();
30 | $table->timestamps();
31 | });
32 | }
33 |
34 | /**
35 | * Reverse the migrations.
36 | *
37 | * @return void
38 | */
39 | public function down()
40 | {
41 | Schema::drop('users');
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
17 | $table->string('token')->index();
18 | $table->timestamp('created_at');
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::drop('password_resets');
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/database/seeds/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MicrosoftDocs/pipelines-php/3a6985f396c217377a874b30dea2bb185f02e0ec/database/seeds/.gitkeep
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call(UserTableSeeder::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var elixir = require('laravel-elixir');
2 |
3 | /*
4 | |--------------------------------------------------------------------------
5 | | Elixir Asset Management
6 | |--------------------------------------------------------------------------
7 | |
8 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks
9 | | for your Laravel application. By default, we are compiling the Sass
10 | | file for our application, as well as publishing vendor resources.
11 | |
12 | */
13 |
14 | elixir(function(mix) {
15 | mix.sass('app.scss');
16 | });
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "devDependencies": {
4 | "gulp": "^3.8.8"
5 | },
6 | "dependencies": {
7 | "laravel-elixir": "^4.0.0",
8 | "bootstrap-sass": "^3.0.0"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/phpunit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Run project's phpunit version to avoid frameworks conflicts/uncompatibility
4 | #
5 | ./vendor/phpunit/phpunit/phpunit
6 |
7 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
Are you sure you want to delete your account
13 | 14 | 15 | 23 | 24 | 25 | 26 | 27 | 28 |You can delete your account, but keep in mind this action is irreversible.
6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /resources/views/account/linkedAccount.blade.php: -------------------------------------------------------------------------------- 1 |26 | 28 |
29 | 30 |No | 27 |Name | 28 |Geopoints | 29 |
---|---|---|
{{ $kar }} | 37 |{{ $venue['name'] }} | 38 |{{ $venue['location']['lat'] . ',' . $venue['location']['lng'] }} | 39 |
{{ $details['description'] }}
44 |{{ $details->bio->summary }}
34 | 35 |{{ $details['summary'] }}
33 | 34 |Route | 30 |# of Residential Addresses | 31 |# of Business Addresses | 32 |
---|---|---|
{{ $route['route'] }} | 39 |{{ $route['residential'] }} | 40 |{{ $route['business'] }} | 41 |
Rank | 27 |Title | 28 |Description | 29 |Author | 30 |ISBN-13 | 31 |
---|---|---|---|---|
{{ $kar }} | 39 |{{ $info['title'] }} | 40 |{{ $info['description'] }} | 41 |{{ $info['author'] }} | 42 |{{ $info['primary_isbn13'] }} | 43 |
Redirects to PayPal and allows authorizing the sample payment.
27 | 28 | 29 | 30 |No | 26 |Title | 27 |
---|---|
{{ $kar }} | 34 |{{ $link[0] }} | 35 |
No | 29 |Picture | 30 |Full Name | 31 |Slack Handle | 32 |
---|---|---|---|
{{ $kar }} | 40 |{{ $member->profile->real_name }} | 42 |{{ $member->name }} | 43 |
Displaying public information for Steam ID: 76561197982488301.
22 |In test mode, you can use these test cards to simulate a successful transaction:
42 | 43 |Number | 47 |Card type | 48 |
---|---|
4242 4242 4242 4242 | 53 |Visa | 54 |
4012 8888 8888 1881 | 57 |Visa | 58 |
5555 5555 5555 4444 | 61 |MasterCard | 62 |
5105 1051 0510 5100 | 65 |MasterCard | 66 |
3782 822463 10005 | 69 |American Express | 70 |
3714 496353 98431 | 73 |American Express | 74 |
6011 1111 1111 1117 | 77 |Discover | 78 |
6011 0009 9013 9424 | 81 |Discover | 82 |
3056 9309 0259 04 | 85 |Diners Club | 86 |
3852 0000 0232 37 | 89 |Diners Club | 90 |
3530 1113 3330 0000 | 93 |JCB | 94 |
3566 0020 2036 0505 | 97 |JCB | 98 |
This is the response you will get when customer's card has been charged successfully. 106 | You could use some of the data below for logging purposes.
107 |{ id: 'ch_103qzW2eZvKYlo2CiYcKs6Sw', 108 | object: 'charge', 109 | created: 1397510564, 110 | livemode: false, 111 | paid: true, 112 | amount: 395, 113 | currency: 'usd', 114 | refunded: false, 115 | card: 116 | { id: 'card_103qzW2eZvKYlo2CJ2Ss4kwS', 117 | object: 'card', 118 | last4: '4242', 119 | type: 'Visa', 120 | exp_month: 11, 121 | exp_year: 2015, 122 | fingerprint: 'Xt5EWLLDS7FJjR1c', 123 | customer: null, 124 | country: 'US', 125 | name: 'sahat@me.com', 126 | address_line1: null, 127 | address_line2: null, 128 | address_city: null, 129 | address_state: null, 130 | address_zip: null, 131 | address_country: null, 132 | cvc_check: 'pass', 133 | address_line1_check: null, 134 | address_zip_check: null }, 135 | captured: true, 136 | refunds: [], 137 | balance_transaction: 'txn_103qzW2eZvKYlo2CNEcJV8SN', 138 | failure_message: null, 139 | failure_code: null, 140 | amount_refunded: 0, 141 | customer: null, 142 | invoice: null, 143 | description: 'sahat@me.com', 144 | dispute: null, 145 | metadata: {}, 146 | statement_description: null } 147 |148 |
{{ $post->summary }}
31 |{{ $tweet['text'] }}
51 |Weather for ZIP Code: 10007
23 | 24 |It is currently {{ $data['item']['condition']['temp'] }} degrees in New York, NY.
26 |SELECT * FROM weather.forecast WHERE (location = 10007)31 | 32 |
A boilerplate for Laravel web applications.
7 | 8 |Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
14 | 15 |Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
19 | 20 |Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
24 | 25 |Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
28 | 29 |