├── .env.example
├── .env.testing
├── .gitattributes
├── .gitignore
├── .gitmodules
├── .travis.yml
├── Homestead.yaml
├── Vagrantfile
├── after.sh
├── app
├── Console
│ ├── Commands
│ │ ├── CreateUser.php
│ │ └── Inspire.php
│ └── Kernel.php
├── Events
│ ├── Event.php
│ ├── OtherTestEvent.php
│ └── TestEvent.php
├── Exceptions
│ └── Handler.php
├── Http
│ ├── Controllers
│ │ ├── Api
│ │ │ └── PostsController.php
│ │ ├── Auth
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── RegisterController.php
│ │ │ └── ResetPasswordController.php
│ │ ├── Controller.php
│ │ ├── HomeController.php
│ │ ├── PostsController.php
│ │ ├── UsersController.php
│ │ └── WelcomeController.php
│ ├── Kernel.php
│ ├── Middleware
│ │ ├── Authenticate.php
│ │ ├── RedirectIfAuthenticated.php
│ │ └── VerifyCsrfToken.php
│ ├── Requests
│ │ ├── PostStoreRequest.php
│ │ ├── PostUpdateRequest.php
│ │ └── Request.php
│ └── routes.php
├── Jobs
│ └── Job.php
├── Listeners
│ ├── .gitkeep
│ └── TestEventListener.php
├── Post.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── ConfigServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Test
│ ├── Repeat.php
│ ├── StringConverter.php
│ ├── ToLowercase.php
│ └── ToUppercase.php
├── User.php
└── Validation
│ └── CustomValidator.php
├── artisan
├── bootstrap
├── app.php
├── autoload.php
└── cache
│ └── .gitignore
├── codeception.yml
├── composer.json
├── config
├── app.php
├── auth.php
├── cache.php
├── compile.php
├── database.php
├── filesystems.php
├── mail.php
├── queue.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── ModelFactory.php
├── migrations
│ ├── .gitkeep
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ └── 2014_10_25_122420_create_posts_table.php
└── seeds
│ ├── .gitkeep
│ ├── DatabaseSeeder.php
│ └── UserTableSeeder.php
├── gulpfile.js
├── package.json
├── phpspec.yml
├── phpunit.xml
├── public
├── .htaccess
├── css
│ └── app.css
├── favicon.ico
├── index.php
└── robots.txt
├── readme.md
├── resources
├── assets
│ └── less
│ │ ├── app.less
│ │ └── bootstrap
│ │ ├── alerts.less
│ │ ├── badges.less
│ │ ├── bootstrap.less
│ │ ├── breadcrumbs.less
│ │ ├── button-groups.less
│ │ ├── buttons.less
│ │ ├── carousel.less
│ │ ├── close.less
│ │ ├── code.less
│ │ ├── component-animations.less
│ │ ├── dropdowns.less
│ │ ├── forms.less
│ │ ├── glyphicons.less
│ │ ├── grid.less
│ │ ├── input-groups.less
│ │ ├── jumbotron.less
│ │ ├── labels.less
│ │ ├── list-group.less
│ │ ├── media.less
│ │ ├── mixins.less
│ │ ├── mixins
│ │ ├── alerts.less
│ │ ├── background-variant.less
│ │ ├── border-radius.less
│ │ ├── buttons.less
│ │ ├── center-block.less
│ │ ├── clearfix.less
│ │ ├── forms.less
│ │ ├── gradients.less
│ │ ├── grid-framework.less
│ │ ├── grid.less
│ │ ├── hide-text.less
│ │ ├── image.less
│ │ ├── labels.less
│ │ ├── list-group.less
│ │ ├── nav-divider.less
│ │ ├── nav-vertical-align.less
│ │ ├── opacity.less
│ │ ├── pagination.less
│ │ ├── panels.less
│ │ ├── progress-bar.less
│ │ ├── reset-filter.less
│ │ ├── resize.less
│ │ ├── responsive-visibility.less
│ │ ├── size.less
│ │ ├── tab-focus.less
│ │ ├── table-row.less
│ │ ├── text-emphasis.less
│ │ ├── text-overflow.less
│ │ └── vendor-prefixes.less
│ │ ├── modals.less
│ │ ├── navbar.less
│ │ ├── navs.less
│ │ ├── normalize.less
│ │ ├── pager.less
│ │ ├── pagination.less
│ │ ├── panels.less
│ │ ├── popovers.less
│ │ ├── print.less
│ │ ├── progress-bars.less
│ │ ├── responsive-embed.less
│ │ ├── responsive-utilities.less
│ │ ├── scaffolding.less
│ │ ├── tables.less
│ │ ├── theme.less
│ │ ├── thumbnails.less
│ │ ├── tooltip.less
│ │ ├── type.less
│ │ ├── utilities.less
│ │ ├── variables.less
│ │ └── wells.less
├── lang
│ └── en
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
└── views
│ ├── app.blade.php
│ ├── auth
│ ├── emails
│ │ └── password.blade.php
│ ├── login.blade.php
│ ├── password.blade.php
│ ├── register.blade.php
│ └── reset.blade.php
│ ├── errors
│ └── 503.blade.php
│ ├── flash.blade.php
│ ├── form.blade.php
│ ├── hello.blade.php
│ ├── home.blade.php
│ ├── layouts
│ └── scaffold.blade.php
│ ├── posts
│ ├── create.blade.php
│ ├── edit.blade.php
│ ├── index.blade.php
│ └── show.blade.php
│ ├── service-container.blade.php
│ ├── special-characters.blade.php
│ ├── users
│ ├── edit.blade.php
│ └── show.blade.php
│ ├── vendor
│ └── .gitkeep
│ └── welcome.blade.php
├── server.php
├── storage
├── .gitignore
├── app
│ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
└── tests
├── _bootstrap.php
├── _data
├── dump.sql
└── logo.jpg
├── _support
├── ApiTester.php
├── FunctionalTester.php
├── Helper
│ ├── Api.php
│ ├── Functional.php
│ ├── Seeder.php
│ └── Unit.php
├── Page
│ └── Functional
│ │ └── PostsPage.php
├── SeederTester.php
└── UnitTester.php
├── api.suite.yml
├── api
├── PostsResourceCest.php
└── _bootstrap.php
├── functional.suite.yml
├── functional
├── ApplicationHandlerCept.php
├── ArtisanCest.php
├── AuthCest.php
├── BackCept.php
├── CustomValidationCest.php
├── EditProfileCept.php
├── EventsCest.php
├── FlashCept.php
├── FormCept.php
├── FormErrorsCest.php
├── HelpersCest.php
├── IndexCept.php
├── InternalDomainsCest.php
├── LoginCept.php
├── ModelFactoryCest.php
├── PostCrudCest.php
├── RecordCest.php
├── RegisterCept.php
├── RoutesCest.php
├── ServiceContainerCest.php
├── SessionCest.php
├── SpecialCharactersCept.php
├── UploadedFilesCept.php
└── _bootstrap.php
├── seeder.suite.yml
├── seeder
├── DatabaseSeederCest.php
└── _bootstrap.php
├── unit.suite.yml
└── unit
├── UserTest.php
└── _bootstrap.php
/.env.example:
--------------------------------------------------------------------------------
1 | APP_ENV=local
2 | APP_DEBUG=true
3 | APP_KEY=27ceqUDGvdm77abRFSNQbFSVFIz4dGIH
4 | DB_DEFAULT=sqlite
5 |
--------------------------------------------------------------------------------
/.env.testing:
--------------------------------------------------------------------------------
1 | APP_ENV=testing
2 | APP_DEBUG=true
3 | APP_KEY=27ceqUDGvdm77abRFSNQbFSVFIz4dGIH
4 | DB_DEFAULT=sqlite_testing
5 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor
2 | /node_modules
3 | /tests/_output
4 | /tests/_support/_generated
5 | /tests/api/ApiTester.php
6 | /tests/functional/FunctionalTester.php
7 | /tests/unit/UnitTester.php
8 | /storage/*.sqlite
9 | /tags
10 | .env
11 | .idea
12 | .vagrant
13 | composer.lock
14 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "homestead"]
2 | path = homestead
3 | url = https://github.com/laravel/homestead.git
4 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | php:
4 | - 7.1
5 | - 7.0
6 | - 5.6
7 | - hhvm
8 |
9 | matrix:
10 | allow_failures:
11 | - php: hhvm
12 |
13 | before_script:
14 | - composer self-update
15 | - touch storage/testing.sqlite
16 | - composer install -n --prefer-dist
17 | - php artisan migrate --env=testing --database=sqlite_testing --force
18 | - ./vendor/bin/codecept build
19 |
20 | script:
21 | - ./vendor/bin/codecept run
22 |
--------------------------------------------------------------------------------
/Homestead.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | ip: "192.168.10.10"
3 | memory: 2048
4 | cpus: 1
5 | name: "Codeception Laravel 5 Sample"
6 | provider: virtualbox
7 |
8 | folders:
9 | - map: "."
10 | to: "/home/vagrant/code"
11 |
12 | sites:
13 | - map: homestead.app
14 | to: "/home/vagrant/code/public"
15 |
16 | databases:
17 | - homestead
18 |
19 | # blackfire:
20 | # - id: foo
21 | # token: bar
22 | # client-id: foo
23 | # client-token: bar
24 |
25 | # ports:
26 | # - send: 50000
27 | # to: 5000
28 | # - send: 7777
29 | # to: 777
30 | # protocol: udp
31 |
--------------------------------------------------------------------------------
/Vagrantfile:
--------------------------------------------------------------------------------
1 | require 'json'
2 | require 'yaml'
3 |
4 | VAGRANTFILE_API_VERSION ||= "2"
5 | confDir = $confDir ||= File.expand_path("./homestead", File.dirname(__FILE__))
6 |
7 | homesteadYamlPath = "Homestead.yaml"
8 | homesteadJsonPath = "Homestead.json"
9 | afterScriptPath = "after.sh"
10 | aliasesPath = "aliases"
11 |
12 | require File.expand_path(confDir + '/scripts/homestead.rb')
13 |
14 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
15 | if File.exists? aliasesPath then
16 | config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
17 | end
18 |
19 | if File.exists? homesteadYamlPath then
20 | Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
21 | elsif File.exists? homesteadJsonPath then
22 | Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
23 | end
24 |
25 | if File.exists? afterScriptPath then
26 | config.vm.provision "shell", path: afterScriptPath
27 | end
28 | end
29 |
--------------------------------------------------------------------------------
/after.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | cd code
6 |
7 | sudo -u vagrant -H bash -c "cp .env.testing .env; \
8 | composer install -n --prefer-dist; \
9 | if [ ! -f ~/.key_generated ]; then php artisan key:generate; touch ~/.key_generated; fi; \
10 | touch storage/database.sqlite; \
11 | touch storage/testing.sqlite; \
12 | php artisan migrate; \
13 | php artisan migrate --database=sqlite_testing;"
14 |
--------------------------------------------------------------------------------
/app/Console/Commands/CreateUser.php:
--------------------------------------------------------------------------------
1 | email = $this->argument('email');
44 | $user->password = $this->argument('password');
45 | $user->save();
46 |
47 | $this->line('User created!');
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/Console/Commands/Inspire.php:
--------------------------------------------------------------------------------
1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
27 | ->hourly();
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/Events/Event.php:
--------------------------------------------------------------------------------
1 | isHttpException($e)) {
48 | return $this->renderHttpException($e);
49 | } else {
50 | return parent::render($request, $e);
51 | }
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/PostsController.php:
--------------------------------------------------------------------------------
1 | post = $post;
31 | $this->responseFactory = $responseFactory;
32 | }
33 |
34 | /**
35 | * Display a listing of posts.
36 | *
37 | * @return JsonResponse
38 | */
39 | public function index()
40 | {
41 | $posts = $this->post->all();
42 |
43 | return $this->responseFactory->json($posts);
44 | }
45 |
46 | /**
47 | * Store a newly created post.
48 | *
49 | * @param PostStoreRequest $request
50 | * @return JsonResponse
51 | */
52 | public function store(PostStoreRequest $request)
53 | {
54 | $post = $this->post->create($request->all());
55 |
56 | return $this->responseFactory->json($post);
57 | }
58 |
59 |
60 | /**
61 | * Display the specified post.
62 | *
63 | * @param int $id
64 | * @return JsonResponse
65 | */
66 | public function show($id)
67 | {
68 | $post = $this->post->findOrFail($id);
69 |
70 | return $this->responseFactory->json($post);
71 | }
72 |
73 |
74 | /**
75 | * Update the specified post.
76 | *
77 | * @param int $id
78 | * @return JsonResponse
79 | */
80 | public function update(Request $request, $id)
81 | {
82 | $post = $this->post->findOrFail($id);
83 | $post->update($request->all());
84 |
85 | return $this->responseFactory->json($post);
86 | }
87 |
88 |
89 | /**
90 | * Delete the specified post.
91 | *
92 | * @param int $id
93 | * @return JsonResponse
94 | */
95 | public function destroy($id)
96 | {
97 | $this->post->findOrFail($id)->delete();
98 | }
99 |
100 | }
101 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
29 | }
30 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/LoginController.php:
--------------------------------------------------------------------------------
1 | middleware('guest', ['except' => 'logout']);
36 | }
37 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/RegisterController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
38 | }
39 |
40 | /**
41 | * Get a validator for an incoming registration request.
42 | *
43 | * @param array $data
44 | * @return \Illuminate\Contracts\Validation\Validator
45 | */
46 | protected function validator(array $data)
47 | {
48 | return Validator::make($data, [
49 | 'name' => 'required|max:255',
50 | 'email' => 'required|email|max:255|unique:users',
51 | 'password' => 'required|min:6|confirmed',
52 | ]);
53 | }
54 |
55 | /**
56 | * Create a new user instance after a valid registration.
57 | *
58 | * @param array $data
59 | * @return User
60 | */
61 | protected function create(array $data)
62 | {
63 | return User::create([
64 | 'name' => $data['name'],
65 | 'email' => $data['email'],
66 | 'password' => bcrypt($data['password']),
67 | ]);
68 | }
69 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ResetPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
29 | }
30 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | middleware('auth', ['only' => 'secure']);
17 | }
18 |
19 | /**
20 | * @return \Illuminate\View\View
21 | */
22 | public function index()
23 | {
24 | return view('hello');
25 | }
26 |
27 | /**
28 | * @return \Illuminate\View\View
29 | */
30 | public function flash()
31 | {
32 | Session::flash('message', "It's a flash");
33 |
34 | return view('flash');
35 | }
36 |
37 | /**
38 | * @return \Illuminate\Http\RedirectResponse
39 | */
40 | public function back()
41 | {
42 | return redirect()->back();
43 | }
44 |
45 | /**
46 | * @return \Illuminate\Http\RedirectResponse
47 | */
48 | public function redirect()
49 | {
50 | return redirect()->route('homepage');
51 | }
52 |
53 | /**
54 | * @return \Illuminate\View\View
55 | */
56 | public function secure()
57 | {
58 | return view('hello');
59 | }
60 |
61 | /**
62 | * @param Request $request
63 | * @param $message
64 | * @return void
65 | */
66 | public function session(Request $request, $message)
67 | {
68 | $request->session()->put('message', $message);
69 | }
70 |
71 | /**
72 | * @return \Illuminate\View\View
73 | */
74 | public function form(Request $request)
75 | {
76 | $message = $request->get('message', '');
77 |
78 | return view('form', compact('message'));
79 | }
80 |
81 | /**
82 | * @return \Illuminate\View\View
83 | */
84 | public function specialCharacters()
85 | {
86 | return view('special-characters');
87 | }
88 |
89 | /**
90 | * @return string
91 | */
92 | public function fireEvent()
93 | {
94 | event(new TestEvent());
95 | event(new OtherTestEvent());
96 |
97 | return '';
98 | }
99 |
100 | /**
101 | * @param Request $request
102 | * @return string
103 | */
104 | public function validation(Request $request)
105 | {
106 | $this->validate($request, [
107 | 'post_id' => 'required|exists:posts,id',
108 | 'postal_code' => 'required|postal_code'
109 | ]);
110 |
111 | return 'Validation success';
112 | }
113 |
114 | /**
115 | * @return string
116 | */
117 | public function domain()
118 | {
119 | return 'Domain route';
120 | }
121 |
122 | /**
123 | * @return string
124 | */
125 | public function subdomain()
126 | {
127 | return 'Subdomain route';
128 | }
129 |
130 | /**
131 | * @return string
132 | */
133 | public function wildcard()
134 | {
135 | return 'Wildcard route';
136 | }
137 |
138 | /**
139 | * @return string
140 | */
141 | public function multipleWildcards()
142 | {
143 | return 'Multiple wildcards route';
144 | }
145 |
146 | /**
147 | * @return \Illuminate\View\View
148 | */
149 | public function serviceContainer()
150 | {
151 | return view('service-container');
152 | }
153 |
154 | /**
155 | * @return string
156 | */
157 | public function testValue()
158 | {
159 | return 'Test value is ' . config('test_value');
160 | }
161 |
162 | /**
163 | * @param \Illuminate\Http\Request $request
164 | * @return string
165 | */
166 | public function upload(Request $request)
167 | {
168 | $uploadedFile = $request->file('file');
169 |
170 | return $uploadedFile->isValid() ? 'Success' : 'Failure';
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/app/Http/Controllers/PostsController.php:
--------------------------------------------------------------------------------
1 | post = $post;
23 | }
24 |
25 | /**
26 | * Display a listing of posts.
27 | *
28 | * @return \Illuminate\View\View
29 | */
30 | public function index()
31 | {
32 | $posts = $this->post->all();
33 |
34 | return view('posts.index', compact('posts'));
35 | }
36 |
37 | /**
38 | * Show the form for creating a new post.
39 | *
40 | * @return \Illuminate\View\View
41 | */
42 | public function create()
43 | {
44 | return view('posts.create');
45 | }
46 |
47 | /**
48 | * Store a newly create Post.
49 | *
50 | * @param PostStoreRequest $request
51 | * @return \Illuminate\Http\RedirectResponse
52 | */
53 | public function store(PostStoreRequest $request)
54 | {
55 | $this->post->create($request->input());
56 |
57 | return redirect()->route('posts.index');
58 | }
59 |
60 | /**
61 | * Display a post.
62 | *
63 | * @param int $id
64 | * @return \Illuminate\View\View
65 | */
66 | public function show($id)
67 | {
68 | $post = $this->post->findOrFail($id);
69 |
70 | return view('posts.show', compact('post'));
71 | }
72 |
73 | /**
74 | * Show the form for editing a post.
75 | *
76 | * @param int $id
77 | * @return \Illuminate\View\View
78 | */
79 | public function edit($id)
80 | {
81 | $post = $this->post->findOrFail($id);
82 |
83 | return view('posts.edit', compact('post'));
84 | }
85 |
86 | /**
87 | * Update a post.
88 | *
89 | * @param int $id
90 | * @return \Illuminate\Http\RedirectResponse
91 | */
92 | public function update(PostUpdateRequest $request, $id)
93 | {
94 | /** @var Post $post */
95 | $post = $this->post->findOrFail($id);
96 | $post->update($request->all());
97 |
98 | return redirect()->route('posts.show', $id);
99 | }
100 |
101 | /**
102 | * Remove the specified resource from storage.
103 | *
104 | * @param int $id
105 | * @return \Illuminate\Http\RedirectResponse
106 | */
107 | public function destroy($id)
108 | {
109 | $this->post->findOrFail($id)->delete();
110 |
111 | return redirect()->route('posts.index');
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/app/Http/Controllers/UsersController.php:
--------------------------------------------------------------------------------
1 | user = $user;
22 | }
23 |
24 | /**
25 | * Display the specified resource.
26 | *
27 | * @param int $id
28 | * @return Response
29 | */
30 | public function show($id)
31 | {
32 | $user = $this->user->findOrFail($id);
33 |
34 | return view('users.show', compact('user'));
35 | }
36 |
37 | /**
38 | * Show the form for editing the specified resource.
39 | *
40 | * @param int $id
41 | * @return Response
42 | */
43 | public function edit($id)
44 | {
45 | $user = $this->user->findOrFail($id);
46 |
47 | return view('users.edit', compact('user'));
48 | }
49 |
50 | /**
51 | * Update the specified resource in storage.
52 | *
53 | * @param Request $request
54 | * @param int $id
55 | * @return Response
56 | */
57 | public function update(Request $request, $id)
58 | {
59 | $this->validate($request, ['email' => 'required|email']);
60 |
61 | $user = $this->user->findOrFail($id);
62 | $user->update($request->all());
63 | $user->save();
64 |
65 | return redirect()->route('users.show', $id);
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/WelcomeController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
24 | }
25 |
26 | /**
27 | * Show the application welcome screen to the user.
28 | *
29 | * @return Response
30 | */
31 | public function index()
32 | {
33 | return view('welcome');
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | 'App\Http\Middleware\Authenticate',
28 | 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
29 | 'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
30 | ];
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | auth = $auth;
24 | }
25 |
26 | /**
27 | * Handle an incoming request.
28 | *
29 | * @param \Illuminate\Http\Request $request
30 | * @param \Closure $next
31 | * @return mixed
32 | */
33 | public function handle($request, Closure $next)
34 | {
35 | if ($this->auth->guest())
36 | {
37 | if ($request->ajax())
38 | {
39 | return response('Unauthorized.', 401);
40 | }
41 | else
42 | {
43 | return redirect()->guest('login');
44 | }
45 | }
46 |
47 | return $next($request);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | auth = $auth;
25 | }
26 |
27 | /**
28 | * Handle an incoming request.
29 | *
30 | * @param \Illuminate\Http\Request $request
31 | * @param \Closure $next
32 | * @return mixed
33 | */
34 | public function handle($request, Closure $next)
35 | {
36 | if ($this->auth->check())
37 | {
38 | return new RedirectResponse(url('/home'));
39 | }
40 |
41 | return $next($request);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | path()) !== false) {
19 | return $next($request);
20 | }
21 |
22 | return parent::handle($request, $next);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/app/Http/Requests/PostStoreRequest.php:
--------------------------------------------------------------------------------
1 | 'required',
16 | 'body' => 'required'
17 | ];
18 | }
19 |
20 | /**
21 | * Determine if the user is authorized to make this request.
22 | *
23 | * @return bool
24 | */
25 | public function authorize()
26 | {
27 | return true;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/Http/Requests/PostUpdateRequest.php:
--------------------------------------------------------------------------------
1 | 'required',
16 | 'body' => 'required'
17 | ];
18 | }
19 |
20 | /**
21 | * Determine if the user is authorized to make this request.
22 | *
23 | * @return bool
24 | */
25 | public function authorize()
26 | {
27 | return true;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/Http/Requests/Request.php:
--------------------------------------------------------------------------------
1 | 'example.com', 'as' => 'domain', 'uses' => 'HomeController@domain']);
15 | Route::get('', ['domain' => 'subdomain.example.com', 'as' => 'subdomain', 'uses' => 'HomeController@subdomain']);
16 | Route::get('', ['domain' => '{w}.example.com', 'as' => 'wildcard', 'uses' => 'HomeController@wildcard']);
17 | Route::get('', ['domain' => '{w1}.{w2}.example.com', 'as' => 'multiple-wildcards', 'uses' => 'HomeController@multipleWildcards']);
18 |
19 | Route::get('', ['as' => 'homepage', 'uses' => 'HomeController@index']);
20 | Route::get('flash', 'HomeController@flash');
21 | Route::get('back', 'HomeController@back');
22 | Route::get('redirect', 'HomeController@redirect');
23 | Route::get('secure', 'HomeController@secure');
24 | Route::get('session/{message}', 'HomeController@session');
25 | Route::get('special-characters', 'HomeController@specialCharacters');
26 | Route::get('fire-event', 'HomeController@fireEvent');
27 | Route::get('validation', 'HomeController@validation');
28 | Route::get('service-container', 'HomeController@serviceContainer');
29 | Route::get('test-value', 'HomeController@testValue');
30 | Route::post('upload', 'HomeController@upload');
31 | Route::match(['get', 'post'], 'form', 'HomeController@form');
32 |
33 | Route::resource('posts', 'PostsController');
34 | Route::resource('api/posts', 'Api\PostsController', ['as' => 'api']);
35 | Route::resource('users', 'UsersController');
36 | Route::auth();
37 |
--------------------------------------------------------------------------------
/app/Jobs/Job.php:
--------------------------------------------------------------------------------
1 | 'johndoe@example.com', 'password' => bcrypt('password')]);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/app/Post.php:
--------------------------------------------------------------------------------
1 | app->bind(
34 | 'Illuminate\Contracts\Auth\Registrar',
35 | 'App\Services\Registrar'
36 | );
37 |
38 | $this->app->bind('App\Test\StringConverter', 'App\Test\ToLowercase');
39 | $this->app->addContextualBinding('App\Test\Repeat', '$times', 2);
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/app/Providers/ConfigServiceProvider.php:
--------------------------------------------------------------------------------
1 | 5,
20 | ]);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/Providers/EventServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
17 | TestEventListener::class
18 | ]
19 | ];
20 |
21 | /**
22 | * Register any other events for your application.
23 | *
24 | * @return void
25 | */
26 | public function boot()
27 | {
28 | parent::boot();
29 |
30 | //
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | group(['namespace' => $this->namespace], function ($router) {
39 | require app_path('Http/routes.php');
40 | });
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/app/Test/Repeat.php:
--------------------------------------------------------------------------------
1 | times = $times;
16 | }
17 |
18 | /**
19 | * @param $string
20 | * @return string
21 | */
22 | public function convert($string)
23 | {
24 | return str_repeat($string, $this->times);
25 | }
26 | }
--------------------------------------------------------------------------------
/app/Test/StringConverter.php:
--------------------------------------------------------------------------------
1 | make('Illuminate\Contracts\Console\Kernel');
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 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | 'Illuminate\Contracts\Http\Kernel',
31 | 'App\Http\Kernel'
32 | );
33 |
34 | $app->singleton(
35 | 'Illuminate\Contracts\Console\Kernel',
36 | 'App\Console\Kernel'
37 | );
38 |
39 | $app->singleton(
40 | 'Illuminate\Contracts\Debug\ExceptionHandler',
41 | 'App\Exceptions\Handler'
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 | [
15 | 'guard' => 'web',
16 | 'passwords' => 'users',
17 | ],
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Authentication Guards
21 | |--------------------------------------------------------------------------
22 | |
23 | | Next, you may define every authentication guard for your application.
24 | | Of course, a great default configuration has been defined for you
25 | | here which uses session storage and the Eloquent user provider.
26 | |
27 | | All authentication drivers have a user provider. This defines how the
28 | | users are actually retrieved out of your database or other storage
29 | | mechanisms used by this application to persist your user's data.
30 | |
31 | | Supported: "session", "token"
32 | |
33 | */
34 | 'guards' => [
35 | 'web' => [
36 | 'driver' => 'session',
37 | 'provider' => 'users',
38 | ],
39 | 'api' => [
40 | 'driver' => 'token',
41 | 'provider' => 'users',
42 | ],
43 | ],
44 | /*
45 | |--------------------------------------------------------------------------
46 | | User Providers
47 | |--------------------------------------------------------------------------
48 | |
49 | | All authentication drivers have a user provider. This defines how the
50 | | users are actually retrieved out of your database or other storage
51 | | mechanisms used by this application to persist your user's data.
52 | |
53 | | If you have multiple user tables or models you may configure multiple
54 | | sources which represent each model / table. These sources may then
55 | | be assigned to any extra authentication guards you have defined.
56 | |
57 | | Supported: "database", "eloquent"
58 | |
59 | */
60 | 'providers' => [
61 | 'users' => [
62 | 'driver' => 'eloquent',
63 | 'model' => App\User::class,
64 | ],
65 | // 'users' => [
66 | // 'driver' => 'database',
67 | // 'table' => 'users',
68 | // ],
69 | ],
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Resetting Passwords
73 | |--------------------------------------------------------------------------
74 | |
75 | | Here you may set the options for resetting passwords including the view
76 | | that is your password reset e-mail. You may also set the name of the
77 | | table that maintains all of the reset tokens for your application.
78 | |
79 | | You may specify multiple password reset configurations if you have more
80 | | than one user table or model in the application and you want to have
81 | | separate password reset settings based on the specific user types.
82 | |
83 | | The expire time is the number of minutes that the reset token should be
84 | | considered valid. This security feature keeps tokens short-lived so
85 | | they have less time to be guessed. You may change this as needed.
86 | |
87 | */
88 | 'passwords' => [
89 | 'users' => [
90 | 'provider' => 'users',
91 | 'email' => 'auth.emails.password',
92 | 'table' => 'password_resets',
93 | 'expire' => 60,
94 | ],
95 | ],
96 | ];
--------------------------------------------------------------------------------
/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' => '127.0.0.1', 'port' => 11211, 'weight' => 100
55 | ],
56 | ],
57 | ],
58 |
59 | 'redis' => [
60 | 'driver' => 'redis',
61 | 'connection' => 'default',
62 | ],
63 |
64 | ],
65 |
66 | /*
67 | |--------------------------------------------------------------------------
68 | | Cache Key Prefix
69 | |--------------------------------------------------------------------------
70 | |
71 | | When utilizing a RAM based store such as APC or Memcached, there might
72 | | be other applications utilizing the same cache. So, we'll specify a
73 | | value to get prefixed to all our keys so we can avoid collisions.
74 | |
75 | */
76 |
77 | 'prefix' => 'laravel',
78 |
79 | ];
80 |
--------------------------------------------------------------------------------
/config/compile.php:
--------------------------------------------------------------------------------
1 | [
17 |
18 | realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'),
19 | realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'),
20 | realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'),
21 |
22 | ],
23 |
24 | /*
25 | |--------------------------------------------------------------------------
26 | | Compiled File Providers
27 | |--------------------------------------------------------------------------
28 | |
29 | | Here you may list service providers which define a "compiles" function
30 | | that returns additional files that should be compiled, providing an
31 | | easy way to get common files from any packages you are utilizing.
32 | |
33 | */
34 |
35 | 'providers' => [
36 | //
37 | ],
38 |
39 | ];
40 |
--------------------------------------------------------------------------------
/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_DEFAULT', 'sqlite'),
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' => storage_path().'/database.sqlite',
52 | 'prefix' => '',
53 | ],
54 |
55 | 'sqlite_testing' => [
56 | 'driver' => 'sqlite',
57 | 'database' => storage_path().'/testing.sqlite',
58 | 'prefix' => '',
59 | ],
60 |
61 | 'mysql' => [
62 | 'driver' => 'mysql',
63 | 'host' => env('DB_HOST', 'localhost'),
64 | 'database' => env('DB_DATABASE', 'forge'),
65 | 'username' => env('DB_USERNAME', 'forge'),
66 | 'password' => env('DB_PASSWORD', ''),
67 | 'charset' => 'utf8',
68 | 'collation' => 'utf8_unicode_ci',
69 | 'prefix' => '',
70 | 'strict' => false,
71 | ],
72 |
73 | 'pgsql' => [
74 | 'driver' => 'pgsql',
75 | 'host' => env('DB_HOST', 'localhost'),
76 | 'database' => env('DB_DATABASE', 'forge'),
77 | 'username' => env('DB_USERNAME', 'forge'),
78 | 'password' => env('DB_PASSWORD', ''),
79 | 'charset' => 'utf8',
80 | 'prefix' => '',
81 | 'schema' => 'public',
82 | ],
83 |
84 | 'sqlsrv' => [
85 | 'driver' => 'sqlsrv',
86 | 'host' => env('DB_HOST', 'localhost'),
87 | 'database' => env('DB_DATABASE', 'forge'),
88 | 'username' => env('DB_USERNAME', 'forge'),
89 | 'password' => env('DB_PASSWORD', ''),
90 | 'prefix' => '',
91 | ],
92 |
93 | ],
94 |
95 | /*
96 | |--------------------------------------------------------------------------
97 | | Migration Repository Table
98 | |--------------------------------------------------------------------------
99 | |
100 | | This table keeps track of all the migrations that have already run for
101 | | your application. Using this information, we can determine which of
102 | | the migrations on disk haven't actually been run in the database.
103 | |
104 | */
105 |
106 | 'migrations' => 'migrations',
107 |
108 | /*
109 | |--------------------------------------------------------------------------
110 | | Redis Databases
111 | |--------------------------------------------------------------------------
112 | |
113 | | Redis is an open source, fast, and advanced key-value store that also
114 | | provides a richer set of commands than a typical key-value systems
115 | | such as APC or Memcached. Laravel makes it easy to dig right in.
116 | |
117 | */
118 |
119 | 'redis' => [
120 |
121 | 'cluster' => false,
122 |
123 | 'default' => [
124 | 'host' => '127.0.0.1',
125 | 'port' => 6379,
126 | 'database' => 0,
127 | ],
128 |
129 | ],
130 |
131 | ];
132 |
--------------------------------------------------------------------------------
/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 | 's3' => [
52 | 'driver' => 's3',
53 | 'key' => 'your-key',
54 | 'secret' => 'your-secret',
55 | 'region' => 'your-region',
56 | 'bucket' => 'your-bucket',
57 | ],
58 |
59 | 'rackspace' => [
60 | 'driver' => 'rackspace',
61 | 'username' => 'your-username',
62 | 'key' => 'your-key',
63 | 'container' => 'your-container',
64 | 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
65 | 'region' => 'IAD',
66 | ],
67 |
68 | ],
69 |
70 | ];
71 |
--------------------------------------------------------------------------------
/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 | 'queue' => 'your-queue-url',
57 | 'region' => 'us-east-1',
58 | ],
59 |
60 | 'iron' => [
61 | 'driver' => 'iron',
62 | 'host' => 'mq-aws-us-east-1.iron.io',
63 | 'token' => 'your-token',
64 | 'project' => 'your-project-id',
65 | 'queue' => 'your-queue-name',
66 | 'encrypt' => true,
67 | ],
68 |
69 | 'redis' => [
70 | 'driver' => 'redis',
71 | 'queue' => 'default',
72 | 'expire' => 60,
73 | ],
74 |
75 | ],
76 |
77 | /*
78 | |--------------------------------------------------------------------------
79 | | Failed Queue Jobs
80 | |--------------------------------------------------------------------------
81 | |
82 | | These options configure the behavior of failed queue job logging so you
83 | | can control which database and table are used to store the jobs that
84 | | have failed. You may change them to any database / table you wish.
85 | |
86 | */
87 |
88 | 'failed' => [
89 | 'database' => 'mysql', 'table' => 'failed_jobs',
90 | ],
91 |
92 | ];
93 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => '',
19 | 'secret' => '',
20 | ],
21 |
22 | 'mandrill' => [
23 | 'secret' => '',
24 | ],
25 |
26 | 'ses' => [
27 | 'key' => '',
28 | 'secret' => '',
29 | 'region' => 'us-east-1',
30 | ],
31 |
32 | 'stripe' => [
33 | 'model' => 'User',
34 | 'secret' => '',
35 | ],
36 |
37 | ];
38 |
--------------------------------------------------------------------------------
/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:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/database/factories/ModelFactory.php:
--------------------------------------------------------------------------------
1 | define(App\User::class, function (Faker\Generator $faker) {
15 | return [
16 | 'email' => $faker->email,
17 | 'password' => bcrypt(str_random(10)),
18 | 'remember_token' => str_random(10),
19 | ];
20 | });
21 |
22 | $factory->defineAs(App\User::class, 'admin', function (Faker\Generator $faker) {
23 | return [
24 | 'email' => $faker->email,
25 | 'password' => bcrypt(str_random(10)),
26 | 'remember_token' => str_random(10),
27 | ];
28 | });
29 |
--------------------------------------------------------------------------------
/database/migrations/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/janhenkgerritsen/codeception-laravel5-sample/440e02001f59777893b04813dd298155863ccca6/database/migrations/.gitkeep
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('email')->unique();
19 | $table->string('password', 60);
20 | $table->rememberToken();
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::drop('users');
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token')->index();
19 | $table->timestamp('created_at');
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::drop('password_resets');
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_25_122420_create_posts_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('title');
19 | $table->text('body');
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | Schema::drop('posts');
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/database/seeds/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/janhenkgerritsen/codeception-laravel5-sample/440e02001f59777893b04813dd298155863ccca6/database/seeds/.gitkeep
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call('UserTableSeeder');
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/database/seeds/UserTableSeeder.php:
--------------------------------------------------------------------------------
1 | 'johndoe@example.com', 'password' => bcrypt('password')]);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/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 Less
10 | | file for our application, as well as publishing vendor resources.
11 | |
12 | */
13 |
14 | elixir(function(mix) {
15 | mix.less('app.less');
16 | });
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "devDependencies": {
3 | "gulp": "^3.8.8",
4 | "laravel-elixir": "*"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/phpspec.yml:
--------------------------------------------------------------------------------
1 | suites:
2 | main:
3 | namespace: App
4 | psr4_prefix: App
5 | src_path: app
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 | ./tests/
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Redirect Trailing Slashes...
9 | RewriteRule ^(.*)/$ /$1 [L,R=301]
10 |
11 | # Handle Front Controller...
12 | RewriteCond %{REQUEST_FILENAME} !-d
13 | RewriteCond %{REQUEST_FILENAME} !-f
14 | RewriteRule ^ index.php [L]
15 |
16 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/janhenkgerritsen/codeception-laravel5-sample/440e02001f59777893b04813dd298155863ccca6/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 |
7 | */
8 |
9 | /*
10 | |--------------------------------------------------------------------------
11 | | Register The Auto Loader
12 | |--------------------------------------------------------------------------
13 | |
14 | | Composer provides a convenient, automatically generated class loader for
15 | | our application. We just need to utilize it! We'll simply require it
16 | | into the script here so that we don't have to worry about manual
17 | | loading any of our classes later on. It feels nice to relax.
18 | |
19 | */
20 |
21 | require __DIR__.'/../bootstrap/autoload.php';
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Turn On The Lights
26 | |--------------------------------------------------------------------------
27 | |
28 | | We need to illuminate PHP development, so let us turn on the lights.
29 | | This bootstraps the framework and gets it ready for use, then it
30 | | will load up this application so that we can run it and send
31 | | the responses back to the browser and delight our users.
32 | |
33 | */
34 |
35 | $app = require_once __DIR__.'/../bootstrap/app.php';
36 |
37 | /*
38 | |--------------------------------------------------------------------------
39 | | Run The Application
40 | |--------------------------------------------------------------------------
41 | |
42 | | Once we have the application, we can simply call the run method,
43 | | which will execute the request and send the response back to
44 | | the client's browser allowing them to enjoy the creative
45 | | and wonderful application we have prepared for them.
46 | |
47 | */
48 |
49 | $kernel = $app->make('Illuminate\Contracts\Http\Kernel');
50 |
51 | $response = $kernel->handle(
52 | $request = Illuminate\Http\Request::capture()
53 | );
54 |
55 | $response->send();
56 |
57 | $kernel->terminate($request, $response);
58 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # Sample Laravel Application with Codeception tests.
2 |
3 | [](https://travis-ci.org/janhenkgerritsen/codeception-laravel5-sample)
4 |
5 | ### Setup
6 |
7 | You can setup this sample manually or use [Vagrant](https://www.vagrantup.com/) to automatically set up a development environment for you.
8 |
9 | #### Manual
10 | - Clone repo
11 | - Create your .env file from the example file: `cp .env.testing .env`
12 | - Install composer dependencies: `composer install`
13 | - Create databases by creating the following files:
14 | - `storage/database.sqlite`
15 | - `storage/testing.sqlite`
16 | - Run the following commands:
17 | - `php artisan migrate`
18 | - `php artisan migrate --database=sqlite_testing`
19 | - Server: run `php -S localhost:8000 -t public`
20 | - Browse to localhost:8000/posts
21 |
22 | #### Vagrant
23 | - Clone repo
24 | - Cd into the cloned directory
25 | - Install git submodules: `git submodule update --init --recursive`
26 | - you can also add the `--recursive` flag to the `git clone` command to skip this step
27 | - Run `vagrant up`
28 |
29 | To SSH into the machine to run your tests, run `vagrant ssh`. You can access the app on the guest VM under http://192.168.10.10/.
30 |
31 | ### To test
32 |
33 | Run Codeception, installed via Composer
34 |
35 | ```
36 | ./vendor/bin/codecept build
37 | ./vendor/bin/codecept run
38 | ```
39 |
40 | ## Tests
41 |
42 | Please check out some [good test examples](https://github.com/janhenkgerritsen/codeception-laravel5-sample/tree/codeception-2.1/tests) provided.
43 |
44 | ### Functional Tests
45 |
46 | Demonstrates testing of [CRUD application](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests/functional/PostCrudCest.php) with
47 |
48 | * [PageObjects](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests%2Ffunctional%2F_pages%2FPostsPage.php)
49 | * [authentication](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests%2Ffunctional%2FAuthCest.php) (by user, credentials, http auth)
50 | * usage of session variables
51 | * [routes](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests%2Ffunctional%2FRoutesCest.php)
52 | * creating and checking records in database
53 | * testing of form errors
54 |
55 | ### API Tests
56 |
57 | Demonstrates functional [testing of API](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests%2Fapi%2FPostsResourceCest.php) using REST and Laravel5 modules connected, with
58 |
59 | * partial json inclusion in response
60 | * GET/POST/PUT/DELETE requests
61 | * check changes inside database
62 |
--------------------------------------------------------------------------------
/resources/assets/less/app.less:
--------------------------------------------------------------------------------
1 | @import "bootstrap/bootstrap";
2 |
3 | @btn-font-weight: 300;
4 | @font-family-sans-serif: "Roboto", Helvetica, Arial, sans-serif;
5 |
6 | body, label, .checkbox label {
7 | font-weight: 300;
8 | }
9 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/alerts.less:
--------------------------------------------------------------------------------
1 | //
2 | // Alerts
3 | // --------------------------------------------------
4 |
5 |
6 | // Base styles
7 | // -------------------------
8 |
9 | .alert {
10 | padding: @alert-padding;
11 | margin-bottom: @line-height-computed;
12 | border: 1px solid transparent;
13 | border-radius: @alert-border-radius;
14 |
15 | // Headings for larger alerts
16 | h4 {
17 | margin-top: 0;
18 | // Specified for the h4 to prevent conflicts of changing @headings-color
19 | color: inherit;
20 | }
21 | // Provide class for links that match alerts
22 | .alert-link {
23 | font-weight: @alert-link-font-weight;
24 | }
25 |
26 | // Improve alignment and spacing of inner content
27 | > p,
28 | > ul {
29 | margin-bottom: 0;
30 | }
31 | > p + p {
32 | margin-top: 5px;
33 | }
34 | }
35 |
36 | // Dismissible alerts
37 | //
38 | // Expand the right padding and account for the close button's positioning.
39 |
40 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0.
41 | .alert-dismissible {
42 | padding-right: (@alert-padding + 20);
43 |
44 | // Adjust close link position
45 | .close {
46 | position: relative;
47 | top: -2px;
48 | right: -21px;
49 | color: inherit;
50 | }
51 | }
52 |
53 | // Alternate styles
54 | //
55 | // Generate contextual modifier classes for colorizing the alert.
56 |
57 | .alert-success {
58 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text);
59 | }
60 | .alert-info {
61 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text);
62 | }
63 | .alert-warning {
64 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text);
65 | }
66 | .alert-danger {
67 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text);
68 | }
69 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/badges.less:
--------------------------------------------------------------------------------
1 | //
2 | // Badges
3 | // --------------------------------------------------
4 |
5 |
6 | // Base class
7 | .badge {
8 | display: inline-block;
9 | min-width: 10px;
10 | padding: 3px 7px;
11 | font-size: @font-size-small;
12 | font-weight: @badge-font-weight;
13 | color: @badge-color;
14 | line-height: @badge-line-height;
15 | vertical-align: baseline;
16 | white-space: nowrap;
17 | text-align: center;
18 | background-color: @badge-bg;
19 | border-radius: @badge-border-radius;
20 |
21 | // Empty badges collapse automatically (not available in IE8)
22 | &:empty {
23 | display: none;
24 | }
25 |
26 | // Quick fix for badges in buttons
27 | .btn & {
28 | position: relative;
29 | top: -1px;
30 | }
31 | .btn-xs & {
32 | top: 0;
33 | padding: 1px 5px;
34 | }
35 |
36 | // Hover state, but only for links
37 | a& {
38 | &:hover,
39 | &:focus {
40 | color: @badge-link-hover-color;
41 | text-decoration: none;
42 | cursor: pointer;
43 | }
44 | }
45 |
46 | // Account for badges in navs
47 | .list-group-item.active > &,
48 | .nav-pills > .active > a > & {
49 | color: @badge-active-color;
50 | background-color: @badge-active-bg;
51 | }
52 | .list-group-item > & {
53 | float: right;
54 | }
55 | .list-group-item > & + & {
56 | margin-right: 5px;
57 | }
58 | .nav-pills > li > a > & {
59 | margin-left: 3px;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/bootstrap.less:
--------------------------------------------------------------------------------
1 | // Core variables and mixins
2 | @import "variables.less";
3 | @import "mixins.less";
4 |
5 | // Reset and dependencies
6 | @import "normalize.less";
7 | @import "print.less";
8 | @import "glyphicons.less";
9 |
10 | // Core CSS
11 | @import "scaffolding.less";
12 | @import "type.less";
13 | @import "code.less";
14 | @import "grid.less";
15 | @import "tables.less";
16 | @import "forms.less";
17 | @import "buttons.less";
18 |
19 | // Components
20 | @import "component-animations.less";
21 | @import "dropdowns.less";
22 | @import "button-groups.less";
23 | @import "input-groups.less";
24 | @import "navs.less";
25 | @import "navbar.less";
26 | @import "breadcrumbs.less";
27 | @import "pagination.less";
28 | @import "pager.less";
29 | @import "labels.less";
30 | @import "badges.less";
31 | @import "jumbotron.less";
32 | @import "thumbnails.less";
33 | @import "alerts.less";
34 | @import "progress-bars.less";
35 | @import "media.less";
36 | @import "list-group.less";
37 | @import "panels.less";
38 | @import "responsive-embed.less";
39 | @import "wells.less";
40 | @import "close.less";
41 |
42 | // Components w/ JavaScript
43 | @import "modals.less";
44 | @import "tooltip.less";
45 | @import "popovers.less";
46 | @import "carousel.less";
47 |
48 | // Utility classes
49 | @import "utilities.less";
50 | @import "responsive-utilities.less";
51 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/breadcrumbs.less:
--------------------------------------------------------------------------------
1 | //
2 | // Breadcrumbs
3 | // --------------------------------------------------
4 |
5 |
6 | .breadcrumb {
7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal;
8 | margin-bottom: @line-height-computed;
9 | list-style: none;
10 | background-color: @breadcrumb-bg;
11 | border-radius: @border-radius-base;
12 |
13 | > li {
14 | display: inline-block;
15 |
16 | + li:before {
17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space
18 | padding: 0 5px;
19 | color: @breadcrumb-color;
20 | }
21 | }
22 |
23 | > .active {
24 | color: @breadcrumb-active-color;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/buttons.less:
--------------------------------------------------------------------------------
1 | //
2 | // Buttons
3 | // --------------------------------------------------
4 |
5 |
6 | // Base styles
7 | // --------------------------------------------------
8 |
9 | .btn {
10 | display: inline-block;
11 | margin-bottom: 0; // For input.btn
12 | font-weight: @btn-font-weight;
13 | text-align: center;
14 | vertical-align: middle;
15 | touch-action: manipulation;
16 | cursor: pointer;
17 | background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
18 | border: 1px solid transparent;
19 | white-space: nowrap;
20 | .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @border-radius-base);
21 | .user-select(none);
22 |
23 | &,
24 | &:active,
25 | &.active {
26 | &:focus,
27 | &.focus {
28 | .tab-focus();
29 | }
30 | }
31 |
32 | &:hover,
33 | &:focus,
34 | &.focus {
35 | color: @btn-default-color;
36 | text-decoration: none;
37 | }
38 |
39 | &:active,
40 | &.active {
41 | outline: 0;
42 | background-image: none;
43 | .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
44 | }
45 |
46 | &.disabled,
47 | &[disabled],
48 | fieldset[disabled] & {
49 | cursor: @cursor-disabled;
50 | pointer-events: none; // Future-proof disabling of clicks
51 | .opacity(.65);
52 | .box-shadow(none);
53 | }
54 | }
55 |
56 |
57 | // Alternate buttons
58 | // --------------------------------------------------
59 |
60 | .btn-default {
61 | .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);
62 | }
63 | .btn-primary {
64 | .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);
65 | }
66 | // Success appears as green
67 | .btn-success {
68 | .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);
69 | }
70 | // Info appears as blue-green
71 | .btn-info {
72 | .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);
73 | }
74 | // Warning appears as orange
75 | .btn-warning {
76 | .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);
77 | }
78 | // Danger and error appear as red
79 | .btn-danger {
80 | .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);
81 | }
82 |
83 |
84 | // Link buttons
85 | // -------------------------
86 |
87 | // Make a button look and behave like a link
88 | .btn-link {
89 | color: @link-color;
90 | font-weight: normal;
91 | border-radius: 0;
92 |
93 | &,
94 | &:active,
95 | &.active,
96 | &[disabled],
97 | fieldset[disabled] & {
98 | background-color: transparent;
99 | .box-shadow(none);
100 | }
101 | &,
102 | &:hover,
103 | &:focus,
104 | &:active {
105 | border-color: transparent;
106 | }
107 | &:hover,
108 | &:focus {
109 | color: @link-hover-color;
110 | text-decoration: underline;
111 | background-color: transparent;
112 | }
113 | &[disabled],
114 | fieldset[disabled] & {
115 | &:hover,
116 | &:focus {
117 | color: @btn-link-disabled-color;
118 | text-decoration: none;
119 | }
120 | }
121 | }
122 |
123 |
124 | // Button Sizes
125 | // --------------------------------------------------
126 |
127 | .btn-lg {
128 | // line-height: ensure even-numbered height of button next to large input
129 | .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
130 | }
131 | .btn-sm {
132 | // line-height: ensure proper height of button next to small input
133 | .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
134 | }
135 | .btn-xs {
136 | .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @border-radius-small);
137 | }
138 |
139 |
140 | // Block button
141 | // --------------------------------------------------
142 |
143 | .btn-block {
144 | display: block;
145 | width: 100%;
146 | }
147 |
148 | // Vertically space out multiple block buttons
149 | .btn-block + .btn-block {
150 | margin-top: 5px;
151 | }
152 |
153 | // Specificity overrides
154 | input[type="submit"],
155 | input[type="reset"],
156 | input[type="button"] {
157 | &.btn-block {
158 | width: 100%;
159 | }
160 | }
161 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/close.less:
--------------------------------------------------------------------------------
1 | //
2 | // Close icons
3 | // --------------------------------------------------
4 |
5 |
6 | .close {
7 | float: right;
8 | font-size: (@font-size-base * 1.5);
9 | font-weight: @close-font-weight;
10 | line-height: 1;
11 | color: @close-color;
12 | text-shadow: @close-text-shadow;
13 | .opacity(.2);
14 |
15 | &:hover,
16 | &:focus {
17 | color: @close-color;
18 | text-decoration: none;
19 | cursor: pointer;
20 | .opacity(.5);
21 | }
22 |
23 | // Additional properties for button version
24 | // iOS requires the button element instead of an anchor tag.
25 | // If you want the anchor version, it requires `href="#"`.
26 | button& {
27 | padding: 0;
28 | cursor: pointer;
29 | background: transparent;
30 | border: 0;
31 | -webkit-appearance: none;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/code.less:
--------------------------------------------------------------------------------
1 | //
2 | // Code (inline and block)
3 | // --------------------------------------------------
4 |
5 |
6 | // Inline and block code styles
7 | code,
8 | kbd,
9 | pre,
10 | samp {
11 | font-family: @font-family-monospace;
12 | }
13 |
14 | // Inline code
15 | code {
16 | padding: 2px 4px;
17 | font-size: 90%;
18 | color: @code-color;
19 | background-color: @code-bg;
20 | border-radius: @border-radius-base;
21 | }
22 |
23 | // User input typically entered via keyboard
24 | kbd {
25 | padding: 2px 4px;
26 | font-size: 90%;
27 | color: @kbd-color;
28 | background-color: @kbd-bg;
29 | border-radius: @border-radius-small;
30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
31 |
32 | kbd {
33 | padding: 0;
34 | font-size: 100%;
35 | font-weight: bold;
36 | box-shadow: none;
37 | }
38 | }
39 |
40 | // Blocks of code
41 | pre {
42 | display: block;
43 | padding: ((@line-height-computed - 1) / 2);
44 | margin: 0 0 (@line-height-computed / 2);
45 | font-size: (@font-size-base - 1); // 14px to 13px
46 | line-height: @line-height-base;
47 | word-break: break-all;
48 | word-wrap: break-word;
49 | color: @pre-color;
50 | background-color: @pre-bg;
51 | border: 1px solid @pre-border-color;
52 | border-radius: @border-radius-base;
53 |
54 | // Account for some code outputs that place code tags in pre tags
55 | code {
56 | padding: 0;
57 | font-size: inherit;
58 | color: inherit;
59 | white-space: pre-wrap;
60 | background-color: transparent;
61 | border-radius: 0;
62 | }
63 | }
64 |
65 | // Enable scrollable blocks of code
66 | .pre-scrollable {
67 | max-height: @pre-scrollable-max-height;
68 | overflow-y: scroll;
69 | }
70 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/component-animations.less:
--------------------------------------------------------------------------------
1 | //
2 | // Component animations
3 | // --------------------------------------------------
4 |
5 | // Heads up!
6 | //
7 | // We don't use the `.opacity()` mixin here since it causes a bug with text
8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552.
9 |
10 | .fade {
11 | opacity: 0;
12 | .transition(opacity .15s linear);
13 | &.in {
14 | opacity: 1;
15 | }
16 | }
17 |
18 | .collapse {
19 | display: none;
20 | visibility: hidden;
21 |
22 | &.in { display: block; visibility: visible; }
23 | tr&.in { display: table-row; }
24 | tbody&.in { display: table-row-group; }
25 | }
26 |
27 | .collapsing {
28 | position: relative;
29 | height: 0;
30 | overflow: hidden;
31 | .transition-property(~"height, visibility");
32 | .transition-duration(.35s);
33 | .transition-timing-function(ease);
34 | }
35 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/grid.less:
--------------------------------------------------------------------------------
1 | //
2 | // Grid system
3 | // --------------------------------------------------
4 |
5 |
6 | // Container widths
7 | //
8 | // Set the container width, and override it for fixed navbars in media queries.
9 |
10 | .container {
11 | .container-fixed();
12 |
13 | @media (min-width: @screen-sm-min) {
14 | width: @container-sm;
15 | }
16 | @media (min-width: @screen-md-min) {
17 | width: @container-md;
18 | }
19 | @media (min-width: @screen-lg-min) {
20 | width: @container-lg;
21 | }
22 | }
23 |
24 |
25 | // Fluid container
26 | //
27 | // Utilizes the mixin meant for fixed width containers, but without any defined
28 | // width for fluid, full width layouts.
29 |
30 | .container-fluid {
31 | .container-fixed();
32 | }
33 |
34 |
35 | // Row
36 | //
37 | // Rows contain and clear the floats of your columns.
38 |
39 | .row {
40 | .make-row();
41 | }
42 |
43 |
44 | // Columns
45 | //
46 | // Common styles for small and large grid columns
47 |
48 | .make-grid-columns();
49 |
50 |
51 | // Extra small grid
52 | //
53 | // Columns, offsets, pushes, and pulls for extra small devices like
54 | // smartphones.
55 |
56 | .make-grid(xs);
57 |
58 |
59 | // Small grid
60 | //
61 | // Columns, offsets, pushes, and pulls for the small device range, from phones
62 | // to tablets.
63 |
64 | @media (min-width: @screen-sm-min) {
65 | .make-grid(sm);
66 | }
67 |
68 |
69 | // Medium grid
70 | //
71 | // Columns, offsets, pushes, and pulls for the desktop device range.
72 |
73 | @media (min-width: @screen-md-min) {
74 | .make-grid(md);
75 | }
76 |
77 |
78 | // Large grid
79 | //
80 | // Columns, offsets, pushes, and pulls for the large desktop device range.
81 |
82 | @media (min-width: @screen-lg-min) {
83 | .make-grid(lg);
84 | }
85 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/jumbotron.less:
--------------------------------------------------------------------------------
1 | //
2 | // Jumbotron
3 | // --------------------------------------------------
4 |
5 |
6 | .jumbotron {
7 | padding: @jumbotron-padding (@jumbotron-padding / 2);
8 | margin-bottom: @jumbotron-padding;
9 | color: @jumbotron-color;
10 | background-color: @jumbotron-bg;
11 |
12 | h1,
13 | .h1 {
14 | color: @jumbotron-heading-color;
15 | }
16 | p {
17 | margin-bottom: (@jumbotron-padding / 2);
18 | font-size: @jumbotron-font-size;
19 | font-weight: 200;
20 | }
21 |
22 | > hr {
23 | border-top-color: darken(@jumbotron-bg, 10%);
24 | }
25 |
26 | .container &,
27 | .container-fluid & {
28 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container
29 | }
30 |
31 | .container {
32 | max-width: 100%;
33 | }
34 |
35 | @media screen and (min-width: @screen-sm-min) {
36 | padding: (@jumbotron-padding * 1.6) 0;
37 |
38 | .container &,
39 | .container-fluid & {
40 | padding-left: (@jumbotron-padding * 2);
41 | padding-right: (@jumbotron-padding * 2);
42 | }
43 |
44 | h1,
45 | .h1 {
46 | font-size: (@font-size-base * 4.5);
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/labels.less:
--------------------------------------------------------------------------------
1 | //
2 | // Labels
3 | // --------------------------------------------------
4 |
5 | .label {
6 | display: inline;
7 | padding: .2em .6em .3em;
8 | font-size: 75%;
9 | font-weight: bold;
10 | line-height: 1;
11 | color: @label-color;
12 | text-align: center;
13 | white-space: nowrap;
14 | vertical-align: baseline;
15 | border-radius: .25em;
16 |
17 | // Add hover effects, but only for links
18 | a& {
19 | &:hover,
20 | &:focus {
21 | color: @label-link-hover-color;
22 | text-decoration: none;
23 | cursor: pointer;
24 | }
25 | }
26 |
27 | // Empty labels collapse automatically (not available in IE8)
28 | &:empty {
29 | display: none;
30 | }
31 |
32 | // Quick fix for labels in buttons
33 | .btn & {
34 | position: relative;
35 | top: -1px;
36 | }
37 | }
38 |
39 | // Colors
40 | // Contextual variations (linked labels get darker on :hover)
41 |
42 | .label-default {
43 | .label-variant(@label-default-bg);
44 | }
45 |
46 | .label-primary {
47 | .label-variant(@label-primary-bg);
48 | }
49 |
50 | .label-success {
51 | .label-variant(@label-success-bg);
52 | }
53 |
54 | .label-info {
55 | .label-variant(@label-info-bg);
56 | }
57 |
58 | .label-warning {
59 | .label-variant(@label-warning-bg);
60 | }
61 |
62 | .label-danger {
63 | .label-variant(@label-danger-bg);
64 | }
65 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/list-group.less:
--------------------------------------------------------------------------------
1 | //
2 | // List groups
3 | // --------------------------------------------------
4 |
5 |
6 | // Base class
7 | //
8 | // Easily usable on
, , or .
9 |
10 | .list-group {
11 | // No need to set list-style: none; since .list-group-item is block level
12 | margin-bottom: 20px;
13 | padding-left: 0; // reset padding because ul and ol
14 | }
15 |
16 |
17 | // Individual list items
18 | //
19 | // Use on `li`s or `div`s within the `.list-group` parent.
20 |
21 | .list-group-item {
22 | position: relative;
23 | display: block;
24 | padding: 10px 15px;
25 | // Place the border on the list items and negative margin up for better styling
26 | margin-bottom: -1px;
27 | background-color: @list-group-bg;
28 | border: 1px solid @list-group-border;
29 |
30 | // Round the first and last items
31 | &:first-child {
32 | .border-top-radius(@list-group-border-radius);
33 | }
34 | &:last-child {
35 | margin-bottom: 0;
36 | .border-bottom-radius(@list-group-border-radius);
37 | }
38 | }
39 |
40 |
41 | // Linked list items
42 | //
43 | // Use anchor elements instead of `li`s or `div`s to create linked list items.
44 | // Includes an extra `.active` modifier class for showing selected items.
45 |
46 | a.list-group-item {
47 | color: @list-group-link-color;
48 |
49 | .list-group-item-heading {
50 | color: @list-group-link-heading-color;
51 | }
52 |
53 | // Hover state
54 | &:hover,
55 | &:focus {
56 | text-decoration: none;
57 | color: @list-group-link-hover-color;
58 | background-color: @list-group-hover-bg;
59 | }
60 | }
61 |
62 | .list-group-item {
63 | // Disabled state
64 | &.disabled,
65 | &.disabled:hover,
66 | &.disabled:focus {
67 | background-color: @list-group-disabled-bg;
68 | color: @list-group-disabled-color;
69 | cursor: @cursor-disabled;
70 |
71 | // Force color to inherit for custom content
72 | .list-group-item-heading {
73 | color: inherit;
74 | }
75 | .list-group-item-text {
76 | color: @list-group-disabled-text-color;
77 | }
78 | }
79 |
80 | // Active class on item itself, not parent
81 | &.active,
82 | &.active:hover,
83 | &.active:focus {
84 | z-index: 2; // Place active items above their siblings for proper border styling
85 | color: @list-group-active-color;
86 | background-color: @list-group-active-bg;
87 | border-color: @list-group-active-border;
88 |
89 | // Force color to inherit for custom content
90 | .list-group-item-heading,
91 | .list-group-item-heading > small,
92 | .list-group-item-heading > .small {
93 | color: inherit;
94 | }
95 | .list-group-item-text {
96 | color: @list-group-active-text-color;
97 | }
98 | }
99 | }
100 |
101 |
102 | // Contextual variants
103 | //
104 | // Add modifier classes to change text and background color on individual items.
105 | // Organizationally, this must come after the `:hover` states.
106 |
107 | .list-group-item-variant(success; @state-success-bg; @state-success-text);
108 | .list-group-item-variant(info; @state-info-bg; @state-info-text);
109 | .list-group-item-variant(warning; @state-warning-bg; @state-warning-text);
110 | .list-group-item-variant(danger; @state-danger-bg; @state-danger-text);
111 |
112 |
113 | // Custom content options
114 | //
115 | // Extra classes for creating well-formatted content within `.list-group-item`s.
116 |
117 | .list-group-item-heading {
118 | margin-top: 0;
119 | margin-bottom: 5px;
120 | }
121 | .list-group-item-text {
122 | margin-bottom: 0;
123 | line-height: 1.3;
124 | }
125 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/media.less:
--------------------------------------------------------------------------------
1 | .media {
2 | // Proper spacing between instances of .media
3 | margin-top: 15px;
4 |
5 | &:first-child {
6 | margin-top: 0;
7 | }
8 | }
9 |
10 | .media-right,
11 | .media > .pull-right {
12 | padding-left: 10px;
13 | }
14 |
15 | .media-left,
16 | .media > .pull-left {
17 | padding-right: 10px;
18 | }
19 |
20 | .media-left,
21 | .media-right,
22 | .media-body {
23 | display: table-cell;
24 | vertical-align: top;
25 | }
26 |
27 | .media-middle {
28 | vertical-align: middle;
29 | }
30 |
31 | .media-bottom {
32 | vertical-align: bottom;
33 | }
34 |
35 | // Reset margins on headings for tighter default spacing
36 | .media-heading {
37 | margin-top: 0;
38 | margin-bottom: 5px;
39 | }
40 |
41 | // Media list variation
42 | //
43 | // Undo default ul/ol styles
44 | .media-list {
45 | padding-left: 0;
46 | list-style: none;
47 | }
48 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/mixins.less:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------------------------------
3 |
4 | // Utilities
5 | @import "mixins/hide-text.less";
6 | @import "mixins/opacity.less";
7 | @import "mixins/image.less";
8 | @import "mixins/labels.less";
9 | @import "mixins/reset-filter.less";
10 | @import "mixins/resize.less";
11 | @import "mixins/responsive-visibility.less";
12 | @import "mixins/size.less";
13 | @import "mixins/tab-focus.less";
14 | @import "mixins/text-emphasis.less";
15 | @import "mixins/text-overflow.less";
16 | @import "mixins/vendor-prefixes.less";
17 |
18 | // Components
19 | @import "mixins/alerts.less";
20 | @import "mixins/buttons.less";
21 | @import "mixins/panels.less";
22 | @import "mixins/pagination.less";
23 | @import "mixins/list-group.less";
24 | @import "mixins/nav-divider.less";
25 | @import "mixins/forms.less";
26 | @import "mixins/progress-bar.less";
27 | @import "mixins/table-row.less";
28 |
29 | // Skins
30 | @import "mixins/background-variant.less";
31 | @import "mixins/border-radius.less";
32 | @import "mixins/gradients.less";
33 |
34 | // Layout
35 | @import "mixins/clearfix.less";
36 | @import "mixins/center-block.less";
37 | @import "mixins/nav-vertical-align.less";
38 | @import "mixins/grid-framework.less";
39 | @import "mixins/grid.less";
40 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/mixins/alerts.less:
--------------------------------------------------------------------------------
1 | // Alerts
2 |
3 | .alert-variant(@background; @border; @text-color) {
4 | background-color: @background;
5 | border-color: @border;
6 | color: @text-color;
7 |
8 | hr {
9 | border-top-color: darken(@border, 5%);
10 | }
11 | .alert-link {
12 | color: darken(@text-color, 10%);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/mixins/background-variant.less:
--------------------------------------------------------------------------------
1 | // Contextual backgrounds
2 |
3 | .bg-variant(@color) {
4 | background-color: @color;
5 | a&:hover {
6 | background-color: darken(@color, 10%);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/mixins/border-radius.less:
--------------------------------------------------------------------------------
1 | // Single side border-radius
2 |
3 | .border-top-radius(@radius) {
4 | border-top-right-radius: @radius;
5 | border-top-left-radius: @radius;
6 | }
7 | .border-right-radius(@radius) {
8 | border-bottom-right-radius: @radius;
9 | border-top-right-radius: @radius;
10 | }
11 | .border-bottom-radius(@radius) {
12 | border-bottom-right-radius: @radius;
13 | border-bottom-left-radius: @radius;
14 | }
15 | .border-left-radius(@radius) {
16 | border-bottom-left-radius: @radius;
17 | border-top-left-radius: @radius;
18 | }
19 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/mixins/buttons.less:
--------------------------------------------------------------------------------
1 | // Button variants
2 | //
3 | // Easily pump out default styles, as well as :hover, :focus, :active,
4 | // and disabled options for all buttons
5 |
6 | .button-variant(@color; @background; @border) {
7 | color: @color;
8 | background-color: @background;
9 | border-color: @border;
10 |
11 | &:hover,
12 | &:focus,
13 | &.focus,
14 | &:active,
15 | &.active,
16 | .open > .dropdown-toggle& {
17 | color: @color;
18 | background-color: darken(@background, 10%);
19 | border-color: darken(@border, 12%);
20 | }
21 | &:active,
22 | &.active,
23 | .open > .dropdown-toggle& {
24 | background-image: none;
25 | }
26 | &.disabled,
27 | &[disabled],
28 | fieldset[disabled] & {
29 | &,
30 | &:hover,
31 | &:focus,
32 | &.focus,
33 | &:active,
34 | &.active {
35 | background-color: @background;
36 | border-color: @border;
37 | }
38 | }
39 |
40 | .badge {
41 | color: @background;
42 | background-color: @color;
43 | }
44 | }
45 |
46 | // Button sizes
47 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
48 | padding: @padding-vertical @padding-horizontal;
49 | font-size: @font-size;
50 | line-height: @line-height;
51 | border-radius: @border-radius;
52 | }
53 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/mixins/center-block.less:
--------------------------------------------------------------------------------
1 | // Center-align a block level element
2 |
3 | .center-block() {
4 | display: block;
5 | margin-left: auto;
6 | margin-right: auto;
7 | }
8 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/mixins/clearfix.less:
--------------------------------------------------------------------------------
1 | // Clearfix
2 | //
3 | // For modern browsers
4 | // 1. The space content is one way to avoid an Opera bug when the
5 | // contenteditable attribute is included anywhere else in the document.
6 | // Otherwise it causes space to appear at the top and bottom of elements
7 | // that are clearfixed.
8 | // 2. The use of `table` rather than `block` is only necessary if using
9 | // `:before` to contain the top-margins of child elements.
10 | //
11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/
12 |
13 | .clearfix() {
14 | &:before,
15 | &:after {
16 | content: " "; // 1
17 | display: table; // 2
18 | }
19 | &:after {
20 | clear: both;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/mixins/forms.less:
--------------------------------------------------------------------------------
1 | // Form validation states
2 | //
3 | // Used in forms.less to generate the form validation CSS for warnings, errors,
4 | // and successes.
5 |
6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {
7 | // Color the label and help text
8 | .help-block,
9 | .control-label,
10 | .radio,
11 | .checkbox,
12 | .radio-inline,
13 | .checkbox-inline,
14 | &.radio label,
15 | &.checkbox label,
16 | &.radio-inline label,
17 | &.checkbox-inline label {
18 | color: @text-color;
19 | }
20 | // Set the border and box shadow on specific inputs to match
21 | .form-control {
22 | border-color: @border-color;
23 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
24 | &:focus {
25 | border-color: darken(@border-color, 10%);
26 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
27 | .box-shadow(@shadow);
28 | }
29 | }
30 | // Set validation states also for addons
31 | .input-group-addon {
32 | color: @text-color;
33 | border-color: @border-color;
34 | background-color: @background-color;
35 | }
36 | // Optional feedback icon
37 | .form-control-feedback {
38 | color: @text-color;
39 | }
40 | }
41 |
42 |
43 | // Form control focus state
44 | //
45 | // Generate a customized focus state and for any input with the specified color,
46 | // which defaults to the `@input-border-focus` variable.
47 | //
48 | // We highly encourage you to not customize the default value, but instead use
49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on
50 | // WebKit's default styles, but applicable to a wider range of browsers. Its
51 | // usability and accessibility should be taken into account with any change.
52 | //
53 | // Example usage: change the default blue border and shadow to white for better
54 | // contrast against a dark gray background.
55 | .form-control-focus(@color: @input-border-focus) {
56 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
57 | &:focus {
58 | border-color: @color;
59 | outline: 0;
60 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
61 | }
62 | }
63 |
64 | // Form control sizing
65 | //
66 | // Relative text size, padding, and border-radii changes for form controls. For
67 | // horizontal sizing, wrap controls in the predefined grid classes. `