├── public ├── favicon.ico ├── robots.txt ├── .htaccess ├── web.config └── index.php ├── database ├── seeds │ ├── .gitkeep │ └── DatabaseSeeder.php ├── .gitignore ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2014_10_12_000000_create_users_table.php │ └── 2016_07_10_024050_create_tasks_table.php └── factories │ └── ModelFactory.php ├── routes ├── api.php └── web.php ├── resources ├── views │ ├── vendor │ │ └── .gitkeep │ ├── auth │ │ ├── emails │ │ │ └── password.blade.php │ │ ├── passwords │ │ │ ├── email.blade.php │ │ │ └── reset.blade.php │ │ ├── login.blade.php │ │ └── register.blade.php │ ├── tasks │ │ ├── partials │ │ │ ├── edit-task.blade.php │ │ │ ├── task-tab.blade.php │ │ │ ├── create-task.blade.php │ │ │ └── task-row.blade.php │ │ ├── create.blade.php │ │ ├── index.blade.php │ │ ├── edit.blade.php │ │ └── filtered.blade.php │ ├── home.blade.php │ ├── welcome.blade.php │ ├── common │ │ └── status.blade.php │ ├── errors │ │ └── 503.blade.php │ └── layouts │ │ └── app.blade.php ├── assets │ └── sass │ │ └── app.scss └── lang │ └── en │ ├── pagination.php │ ├── auth.php │ ├── passwords.php │ └── validation.php ├── bootstrap ├── cache │ └── .gitignore ├── autoload.php └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── cache │ └── .gitignore │ ├── views │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── .gitattributes ├── app ├── Http │ ├── Requests │ │ └── Request.php │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── RedirectIfAuthenticated.php │ │ └── Authenticate.php │ ├── routes.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── HomeController.php │ │ ├── Auth │ │ │ ├── PasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── ForgotPasswordController.php │ │ │ ├── ResetPasswordController.php │ │ │ ├── RegisterController.php │ │ │ └── AuthController.php │ │ └── TasksController.php │ └── Kernel.php ├── Task.php ├── Providers │ ├── EventServiceProvider.php │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ └── RouteServiceProvider.php ├── Jobs │ └── Job.php ├── User.php ├── Console │ └── Kernel.php └── Exceptions │ └── Handler.php ├── tests ├── ExampleTest.php └── TestCase.php ├── package.json ├── .gitignore ├── .env.example ├── gulpfile.js ├── server.php ├── .all-contributorsrc ├── license.svg ├── config ├── compile.php ├── view.php ├── services.php ├── broadcasting.php ├── filesystems.php ├── cache.php ├── queue.php ├── auth.php ├── mail.php ├── database.php ├── session.php └── app.php ├── LICENSE ├── phpunit.xml ├── composer.json ├── artisan ├── readme.md └── README.md /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | getEmailForPasswordReset()) }}"> {{ $link }} 2 | -------------------------------------------------------------------------------- /app/Http/Requests/Request.php: -------------------------------------------------------------------------------- 1 | 'PATCH', 'route' => ['projects.update', $project->slug], 'class' => 'form-horizontal', 'role' => 'form')) !!} 2 | @include('projects/partials/_form', array('submit_text' => 'Edit Project', 'submit_icon' => 'pencil')) 3 | {!! Form::close() !!} -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\User'); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/routes.php: -------------------------------------------------------------------------------- 1 | 5 |
6 |
7 |
8 |
Dashboard
9 | 10 |
11 | You are logged in! 12 |
13 |
14 |
15 |
16 | 17 | @endsection 18 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Welcome
9 | 10 |
11 | Your Application's Landing Page. 12 |
13 |
14 |
15 |
16 |
17 | @endsection 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### OSX BOOGERS ### 2 | .DS_Store 3 | *._DS_Store 4 | ._.DS_Store 5 | *._ 6 | ._* 7 | ._.* 8 | 9 | ### WINDOWS BOOGERS ### 10 | Thumbs.db 11 | 12 | ### Sass ### 13 | /.sass-cache/* 14 | .sass-cache 15 | 16 | ### SUBLIMETEXT BOOGERS ### 17 | *.sublime-workspace 18 | 19 | ### PHPSTORM BOOGERS ### 20 | .idea/* 21 | /.idea/* 22 | 23 | ### DIFFERENT TYPE OF MASTER CONFIGS ### 24 | .env 25 | composer.lock 26 | Homestead.yaml 27 | Homestead.json 28 | 29 | ### ASSET EXCLUSIONS ### 30 | /vendor 31 | /node_modules 32 | /public/storage -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 15 | } 16 | 17 | /** 18 | * Show the application dashboard. 19 | * 20 | * @return \Illuminate\Http\Response 21 | */ 22 | public function index() 23 | { 24 | return view('home'); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $uri = urldecode( 9 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 10 | ); 11 | 12 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 13 | // built-in PHP web server. This provides a convenient way to test a Laravel 14 | // application without having installed a "real" web server software here. 15 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 16 | return false; 17 | } 18 | 19 | require_once __DIR__.'/public/index.php'; 20 | -------------------------------------------------------------------------------- /app/Jobs/Job.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 22 | return redirect('/'); 23 | } 24 | 25 | return $next($request); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/views/tasks/partials/task-tab.blade.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | {{ $title }} 4 |

5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | @foreach ($tasks as $task) 16 | @include('tasks.partials.task-row') 17 | @endforeach 18 | 19 |
IDNameDescriptionStatus
20 |
21 |
22 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | hasMany('App\Task'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /resources/views/common/status.blade.php: -------------------------------------------------------------------------------- 1 | @if (Session::has('success')) 2 | 6 | @endif 7 | 8 | @if ($errors->any()) 9 | 17 | @endif -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 15 | return [ 16 | 'name' => $faker->name, 17 | 'email' => $faker->safeEmail, 18 | 'password' => bcrypt(str_random(10)), 19 | 'remember_token' => str_random(10), 20 | ]; 21 | }); 22 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 29 | // ->hourly(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | registerPolicies($gate); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /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')->nullable(); 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 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | guest()) { 22 | if ($request->ajax() || $request->wantsJson()) { 23 | return response('Unauthorized.', 401); 24 | } else { 25 | return redirect()->guest('login'); 26 | } 27 | } 28 | 29 | return $next($request); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name'); 18 | $table->string('email')->unique(); 19 | $table->string('password'); 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 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/views/tasks/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 8 | @include('common.status') 9 | 10 |
11 |
12 | Create New Task 13 |
14 |
15 | 16 | @include('tasks.partials.create-task') 17 | 18 |
19 | 24 |
25 |
26 |
27 | @endsection -------------------------------------------------------------------------------- /license.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | license 16 | license 17 | MIT 18 | MIT 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordController.php: -------------------------------------------------------------------------------- 1 | middleware($this->guestMiddleware()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /database/migrations/2016_07_10_024050_create_tasks_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('user_id')->unsigned(); 18 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); 19 | $table->string('name'); 20 | $table->text('description')->default(''); 21 | $table->boolean('completed')->default(false); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('tasks'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 24 | $this->middleware('auth')->only('logout'); 25 | } 26 | 27 | /** 28 | * Show the application login form. 29 | * 30 | * @return Response 31 | */ 32 | public function show() 33 | { 34 | return view('auth.login', [ 35 | 'socialProviders' => config('auth.social.providers') 36 | ]); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests 14 | 15 | 16 | 17 | 18 | ./app 19 | 20 | ./app/Http/routes.php 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | 2 | {!! Form::model(new App\Task, ['route' => ['tasks.store'], 'class'=>'form-horizontal', 'role' => 'form']) !!} 3 | 4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 |
12 | 13 | 14 |
15 | 16 | 17 |
18 | 19 |
20 |
21 | 22 | 23 |
24 |
25 | {{Form::button(' Create Task', array('type' => 'submit', 'class' => 'btn btn-default'))}} 26 |
27 |
28 | 29 | {!! Form::close() !!} -------------------------------------------------------------------------------- /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 | 'sparkpost' => [ 33 | 'secret' => env('SPARKPOST_SECRET'), 34 | ], 35 | 36 | 'stripe' => [ 37 | 'model' => App\User::class, 38 | 'key' => env('STRIPE_KEY'), 39 | 'secret' => env('STRIPE_SECRET'), 40 | ], 41 | 42 | ]; 43 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 32 | } 33 | 34 | /** 35 | * Get the response for a successful password reset link. 36 | * 37 | * @param \Illuminate\Http\Request $request 38 | * @param string $response 39 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse 40 | */ 41 | protected function sendResetLinkResponse(Request $request, $response) 42 | { 43 | return back()->with('success', trans($response)); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | =7.1.3", 9 | "laravel/framework": "8.*", 10 | "laravel/legacy-factories": "^1.0", 11 | "laravelcollective/html": "6.*", 12 | "laravel/ui": "*", 13 | "imanghafoori/laravel-temp-tag": "^1.0" 14 | }, 15 | "require-dev": { 16 | "fzaninotto/faker": "*", 17 | "mockery/mockery": "*" 18 | }, 19 | "autoload": { 20 | "classmap": [ 21 | "database" 22 | ], 23 | "psr-4": { 24 | "App\\": "app/" 25 | } 26 | }, 27 | "autoload-dev": { 28 | "classmap": [ 29 | "tests/TestCase.php" 30 | ] 31 | }, 32 | "scripts": { 33 | "post-root-package-install": [ 34 | "php -r \"copy('.env.example', '.env');\"" 35 | ], 36 | "post-create-project-cmd": [ 37 | "php artisan key:generate" 38 | ], 39 | "post-install-cmd": [ 40 | "Illuminate\\Foundation\\ComposerScripts::postInstall", 41 | "php artisan optimize" 42 | ], 43 | "post-update-cmd": [ 44 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", 45 | "php artisan optimize" 46 | ] 47 | }, 48 | "config": { 49 | "preferred-install": "dist" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /resources/views/tasks/partials/task-row.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ $task->id }} 6 | 7 | 8 | 9 | 10 | {{ $task->name }} 11 | 12 | 13 | 14 | 15 | {{ $task->description }} 16 | 17 | 18 | 19 | 20 | 21 | @if ($task->completed === 1) 22 | 23 | 24 | Complete 25 | 26 | 27 | @else 28 | 29 | 30 | Incomplete 31 | 32 | 33 | @endif 34 | 35 | 36 | 37 | 38 | 39 | {{-- 40 | {!! Form::model($task, array('action' => array('TasksController@update', $task->id), 'method' => 'PUT', 'class'=>'form-inline', 'role' => 'form')) !!} 41 |
42 | 45 |
46 | {!! Form::close() !!} 47 | --}} 48 | 49 | 50 | 51 | 52 | 53 | 54 | Edit Task 55 | 56 | 57 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'pusher'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_KEY'), 36 | 'secret' => env('PUSHER_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | ], 53 | 54 | ]; 55 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 40 | } 41 | 42 | /** 43 | * Reset the given user's password. 44 | * 45 | * @param \Illuminate\Contracts\Auth\CanResetPassword $user 46 | * @param string $password 47 | * @return void 48 | */ 49 | protected function resetPassword($user, $password) 50 | { 51 | $user->password = $password; 52 | 53 | $user->setRememberToken(Str::random(60)); 54 | 55 | $user->save(); 56 | 57 | event(new PasswordReset($user)); 58 | 59 | $this->guard()->login($user); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 34 | 35 | $this->mapWebRoutes(); 36 | } 37 | 38 | /** 39 | * Define the "web" routes for the application. 40 | * 41 | * These routes all receive session state, CSRF protection, etc. 42 | * 43 | * @return void 44 | */ 45 | protected function mapWebRoutes() 46 | { 47 | Route::middleware('web') 48 | ->namespace($this->namespace) 49 | ->group(base_path('routes/web.php')); 50 | } 51 | 52 | /** 53 | * Define the "api" routes for the application. 54 | * 55 | * These routes are typically stateless. 56 | * 57 | * @return void 58 | */ 59 | protected function mapApiRoutes() 60 | { 61 | Route::prefix('api') 62 | ->middleware('api') 63 | ->namespace($this->namespace) 64 | ->group(base_path('routes/api.php')); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /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 | 'can' => \Illuminate\Foundation\Http\Middleware\Authorize::class, 50 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 51 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 52 | ]; 53 | } 54 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 handle the incoming request 43 | | through the kernel, and send the associated 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::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Illuminate\Http\Request::capture() 53 | ); 54 | 55 | $response->send(); 56 | 57 | $kernel->terminate($request, $response); 58 | -------------------------------------------------------------------------------- /resources/views/tasks/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 8 | @include('common.status') 9 | 10 | @if (count($tasks) > 0) 11 | 12 |
13 | 18 |
19 | 20 | @include('tasks/partials/task-tab', array('tab' => 'all', 'tasks' => $tasks, 'title' => 'All Tasks', 'status' => 'active')) 21 | @include('tasks/partials/task-tab', array('tab' => 'incomplete', 'tasks' => $tasksInComplete, 'title' => 'Incomplete Tasks')) 22 | @include('tasks/partials/task-tab', array('tab' => 'complete', 'tasks' => $tasksComplete, 'title' => 'Complete Tasks')) 23 | 24 |
25 |
26 | @else 27 | 28 |
29 |
30 | Create New Task 31 |
32 |
33 | 34 | @include('tasks.partials.create-task') 35 | 36 |
37 |
38 | 39 | @endif 40 | 41 |
42 |
43 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |
9 |
Reset Password
10 |
11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 |
18 | {{ csrf_field() }} 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @if ($errors->has('email')) 27 | 28 | {{ $errors->first('email') }} 29 | 30 | @endif 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 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', 'string', 'max:255'], 53 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 54 | 'password' => ['required', 'string', 'min:8', 'confirmed'], 55 | ]); 56 | } 57 | 58 | /** 59 | * Create a new user instance after a valid registration. 60 | * 61 | * @param array $data 62 | * @return \App\User 63 | */ 64 | protected function create(array $data) 65 | { 66 | return User::create([ 67 | 'name' => $data['name'], 68 | 'email' => $data['email'], 69 | 'password' => Hash::make($data['password']), 70 | ]); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /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 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'visibility' => 'public', 55 | ], 56 | 57 | 's3' => [ 58 | 'driver' => 's3', 59 | 'key' => 'your-key', 60 | 'secret' => 'your-secret', 61 | 'region' => 'your-region', 62 | 'bucket' => 'your-bucket', 63 | ], 64 | 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthController.php: -------------------------------------------------------------------------------- 1 | middleware($this->guestMiddleware(), ['except' => 'logout']); 41 | } 42 | 43 | /** 44 | * Get a validator for an incoming registration request. 45 | * 46 | * @param array $data 47 | * 48 | * @return \Illuminate\Contracts\Validation\Validator 49 | */ 50 | protected function validator(array $data) 51 | { 52 | return Validator::make($data, [ 53 | 'name' => 'required|max:255', 54 | 'email' => 'required|email|max:255|unique:users', 55 | 'password' => 'required|min:6|confirmed', 56 | ]); 57 | } 58 | 59 | /** 60 | * Create a new user instance after a valid registration. 61 | * 62 | * @param array $data 63 | * 64 | * @return User 65 | */ 66 | protected function create(array $data) 67 | { 68 | return User::create([ 69 | 'name' => $data['name'], 70 | 'email' => $data['email'], 71 | 'password' => bcrypt($data['password']), 72 | ]); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'servers' => [ 55 | [ 56 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 57 | 'port' => env('MEMCACHED_PORT', 11211), 58 | 'weight' => 100, 59 | ], 60 | ], 61 | ], 62 | 63 | 'redis' => [ 64 | 'driver' => 'redis', 65 | 'connection' => 'default', 66 | ], 67 | 68 | ], 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Cache Key Prefix 73 | |-------------------------------------------------------------------------- 74 | | 75 | | When utilizing a RAM based store such as APC or Memcached, there might 76 | | be other applications utilizing the same cache. So, we'll specify a 77 | | value to get prefixed to all our keys so we can avoid collisions. 78 | | 79 | */ 80 | 81 | 'prefix' => 'laravel', 82 | 83 | ]; 84 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'expire' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'ttr' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => 'your-public-key', 54 | 'secret' => 'your-secret-key', 55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 56 | 'queue' => 'your-queue-name', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'expire' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Login
9 |
10 |
11 | {{ csrf_field() }} 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 | @if ($errors->has('email')) 20 | 21 | {{ $errors->first('email') }} 22 | 23 | @endif 24 |
25 |
26 | 27 |
28 | 29 | 30 |
31 | 32 | 33 | @if ($errors->has('password')) 34 | 35 | {{ $errors->first('password') }} 36 | 37 | @endif 38 |
39 |
40 | 41 |
42 |
43 |
44 | 47 |
48 |
49 |
50 | 51 |
52 |
53 | 56 | 57 | Forgot Your Password? 58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | @endsection 67 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 | 10 |
11 |
12 | {{ csrf_field() }} 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @if ($errors->has('email')) 23 | 24 | {{ $errors->first('email') }} 25 | 26 | @endif 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @if ($errors->has('password')) 37 | 38 | {{ $errors->first('password') }} 39 | 40 | @endif 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 | 49 | @if ($errors->has('password_confirmation')) 50 | 51 | {{ $errors->first('password_confirmation') }} 52 | 53 | @endif 54 |
55 |
56 | 57 |
58 |
59 | 62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | @endsection 71 | -------------------------------------------------------------------------------- /resources/views/tasks/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |
8 | 9 | 10 | @include('common.status') 11 | 12 |
13 |
14 | Editing Task {{$task->name}} 15 |
16 |
17 | 18 | {!! Form::model($task, array('action' => array('TasksController@update', $task->id), 'method' => 'PUT')) !!} 19 | 20 |
21 | {!! Form::label('name', 'Task Name', array('class' => 'col-sm-3 col-sm-offset-1 control-label text-right')) !!} 22 |
23 | {!! Form::text('name', null, array('class' => 'form-control')) !!} 24 |
25 |
26 | 27 | 28 |
29 | {!! Form::label('description', 'Task Description', array('class' => 'col-sm-3 col-sm-offset-1 control-label text-right')) !!} 30 |
31 | {!! Form::textarea('description', null, array('class' => 'form-control')) !!} 32 |
33 |
34 | 35 | 36 | 37 | 38 |
39 | 40 |
41 |
42 | 45 |
46 |
47 |
48 | 49 | 50 | 51 |
52 |
53 | {{Form::button(' Save ', array('type' => 'submit', 'class' => 'btn btn-success btn-block'))}} 54 |
55 |
56 | 57 | 58 | {!! Form::close() !!} 59 | 60 |
61 | 72 |
73 |
74 |
75 |
76 | 77 | @endsection -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Register
9 |
10 |
11 | {{ csrf_field() }} 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 | @if ($errors->has('name')) 20 | 21 | {{ $errors->first('name') }} 22 | 23 | @endif 24 |
25 |
26 | 27 |
28 | 29 | 30 |
31 | 32 | 33 | @if ($errors->has('email')) 34 | 35 | {{ $errors->first('email') }} 36 | 37 | @endif 38 |
39 |
40 | 41 |
42 | 43 | 44 |
45 | 46 | 47 | @if ($errors->has('password')) 48 | 49 | {{ $errors->first('password') }} 50 | 51 | @endif 52 |
53 |
54 | 55 |
56 | 57 | 58 |
59 | 60 | 61 | @if ($errors->has('password_confirmation')) 62 | 63 | {{ $errors->first('password_confirmation') }} 64 | 65 | @endif 66 |
67 |
68 | 69 |
70 |
71 | 74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | @endsection 83 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => ['address' => null, 'name' => null], 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | E-Mail Encryption Protocol 63 | |-------------------------------------------------------------------------- 64 | | 65 | | Here you may specify the encryption protocol that should be used when 66 | | the application send e-mail messages. A sensible default using the 67 | | transport layer security protocol should provide great security. 68 | | 69 | */ 70 | 71 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 72 | 73 | /* 74 | |-------------------------------------------------------------------------- 75 | | SMTP Server Username 76 | |-------------------------------------------------------------------------- 77 | | 78 | | If your SMTP server requires a username for authentication, you should 79 | | set it here. This will get used to authenticate with your server on 80 | | connection. You may also set the "password" value below this one. 81 | | 82 | */ 83 | 84 | 'username' => env('MAIL_USERNAME'), 85 | 86 | /* 87 | |-------------------------------------------------------------------------- 88 | | SMTP Server Password 89 | |-------------------------------------------------------------------------- 90 | | 91 | | Here you may set the password required by your SMTP server to send out 92 | | messages from your application. This will be given to the server on 93 | | connection so that the application will be able to send messages. 94 | | 95 | */ 96 | 97 | 'password' => env('MAIL_PASSWORD'), 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Sendmail System Path 102 | |-------------------------------------------------------------------------- 103 | | 104 | | When using the "sendmail" driver to send e-mails, we will need to know 105 | | the path to where Sendmail lives on this server. A default path has 106 | | been provided here, which will work well on most of your systems. 107 | | 108 | */ 109 | 110 | 'sendmail' => '/usr/sbin/sendmail -bs', 111 | 112 | ]; 113 | -------------------------------------------------------------------------------- /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', 'mysql'), 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' => env('DB_DATABASE', database_path('database.sqlite')), 52 | 'prefix' => '', 53 | ], 54 | 55 | 'mysql' => [ 56 | 'driver' => 'mysql', 57 | 'host' => env('DB_HOST', 'localhost'), 58 | 'port' => env('DB_PORT', '3306'), 59 | 'database' => env('DB_DATABASE', 'forge'), 60 | 'username' => env('DB_USERNAME', 'forge'), 61 | 'password' => env('DB_PASSWORD', ''), 62 | 'charset' => 'utf8', 63 | 'collation' => 'utf8_unicode_ci', 64 | 'prefix' => '', 65 | 'strict' => false, 66 | 'engine' => null, 67 | ], 68 | 69 | 'pgsql' => [ 70 | 'driver' => 'pgsql', 71 | 'host' => env('DB_HOST', 'localhost'), 72 | 'port' => env('DB_PORT', '5432'), 73 | 'database' => env('DB_DATABASE', 'forge'), 74 | 'username' => env('DB_USERNAME', 'forge'), 75 | 'password' => env('DB_PASSWORD', ''), 76 | 'charset' => 'utf8', 77 | 'prefix' => '', 78 | 'schema' => 'public', 79 | ], 80 | 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Migration Repository Table 86 | |-------------------------------------------------------------------------- 87 | | 88 | | This table keeps track of all the migrations that have already run for 89 | | your application. Using this information, we can determine which of 90 | | the migrations on disk haven't actually been run in the database. 91 | | 92 | */ 93 | 94 | 'migrations' => 'migrations', 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Redis Databases 99 | |-------------------------------------------------------------------------- 100 | | 101 | | Redis is an open source, fast, and advanced key-value store that also 102 | | provides a richer set of commands than a typical key-value systems 103 | | such as APC or Memcached. Laravel makes it easy to dig right in. 104 | | 105 | */ 106 | 107 | 'redis' => [ 108 | 109 | 'cluster' => false, 110 | 111 | 'default' => [ 112 | 'host' => env('REDIS_HOST', 'localhost'), 113 | 'password' => env('REDIS_PASSWORD', null), 114 | 'port' => env('REDIS_PORT', 6379), 115 | 'database' => 0, 116 | ], 117 | 118 | ], 119 | 120 | ]; 121 | -------------------------------------------------------------------------------- /resources/views/tasks/filtered.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 | 7 | 8 | @include('common.status') 9 | 10 | 11 | @if (count($tasks) > 0) 12 | 13 |
14 |
15 |
16 |
17 | 18 | @if (Request::is('tasks-all')) 19 | All Tasks 20 | @elseif (Request::is('tasks-incomplete')) 21 | Incomplete Tasks 22 | @elseif (Request::is('tasks-complete')) 23 | Complete Tasks 24 | @else 25 | No Tasks 26 | @endif 27 | 28 | 41 | 42 |
43 |
44 |
45 |
46 |
47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | @foreach ($tasks as $task) 56 | @include('tasks.partials.task-row') 57 | @endforeach 58 | 59 |
IDNameDescriptionStatus
60 |
61 |
62 | 63 | 72 | 73 |
74 | 75 | @else 76 | 77 |
78 |
79 | Create New Task 80 |
81 |
82 | 83 | @include('tasks.partials.create-task') 84 | 85 |
86 |
87 | 88 | @endif 89 | 90 |
91 |
92 | @endsection 93 | 94 | @section('scripts') 95 | 100 | 101 | 102 | 107 | 108 | @endsection -------------------------------------------------------------------------------- /app/Http/Controllers/TasksController.php: -------------------------------------------------------------------------------- 1 | 'required|max:60', 14 | 'description' => 'max:155', 15 | 'completed' => 'numeric', 16 | 17 | ]; 18 | 19 | /** 20 | * Create a new controller instance. 21 | * 22 | * @return void 23 | */ 24 | public function __construct() 25 | { 26 | $this->middleware('auth'); 27 | } 28 | 29 | /** 30 | * Display a listing of the resource. 31 | * 32 | * @return \Illuminate\Http\Response 33 | */ 34 | public function index() 35 | { 36 | $user = Auth::user(); 37 | 38 | return view('tasks.index', [ 39 | 'tasks' => Task::orderBy('created_at', 'asc')->where('user_id', $user->id)->get(), 40 | 'tasksInComplete' => Task::orderBy('created_at', 'asc')->where('user_id', $user->id)->where('completed', '0')->get(), 41 | 'tasksComplete' => Task::orderBy('created_at', 'asc')->where('user_id', $user->id)->where('completed', '1')->get(), 42 | ]); 43 | } 44 | 45 | /** 46 | * Display a listing of the resource. 47 | * 48 | * @return \Illuminate\Http\Response 49 | */ 50 | public function index_all() 51 | { 52 | $user = Auth::user(); 53 | 54 | return view('tasks.filtered', [ 55 | 'tasks' => Task::orderBy('created_at', 'asc')->where('user_id', $user->id)->get(), 56 | ]); 57 | } 58 | 59 | /** 60 | * Display a listing of the resource. 61 | * 62 | * @return \Illuminate\Http\Response 63 | */ 64 | public function index_incomplete() 65 | { 66 | $user = Auth::user(); 67 | 68 | return view('tasks.filtered', [ 69 | 'tasks' => Task::orderBy('created_at', 'asc')->where('user_id', $user->id)->where('completed', '0')->get(), 70 | ]); 71 | } 72 | 73 | /** 74 | * Display a listing of the resource. 75 | * 76 | * @return \Illuminate\Http\Response 77 | */ 78 | public function index_complete() 79 | { 80 | $user = Auth::user(); 81 | 82 | return view('tasks.filtered', [ 83 | 'tasks' => Task::orderBy('created_at', 'asc')->where('user_id', $user->id)->where('completed', '1')->get(), 84 | ]); 85 | } 86 | 87 | /** 88 | * Show the form for creating a new resource. 89 | * 90 | * @return \Illuminate\Http\Response 91 | */ 92 | public function create() 93 | { 94 | return view('tasks.create'); 95 | } 96 | 97 | /** 98 | * Store a newly created resource in storage. 99 | * 100 | * @param \Illuminate\Http\Request $request 101 | * 102 | * @return \Illuminate\Http\Response 103 | */ 104 | public function store(Request $request) 105 | { 106 | $this->validate($request, $this->rules); 107 | $user = Auth::user(); 108 | $task = $request->all(); 109 | $task['user_id'] = $user->id; 110 | Task::create($task); 111 | 112 | return redirect('/tasks')->with('success', 'Task created'); 113 | } 114 | 115 | /** 116 | * Show the form for editing the specified resource. 117 | * 118 | * @param int $id 119 | * 120 | * @return \Illuminate\Http\Response 121 | */ 122 | public function edit($id) 123 | { 124 | $task = Task::query()->findOrFail($id); 125 | 126 | return view('tasks.edit', compact('task')); 127 | } 128 | 129 | /** 130 | * Update the specified resource in storage. 131 | * 132 | * @param \Illuminate\Http\Request $request 133 | * @param int $id 134 | * 135 | * @return \Illuminate\Http\Response 136 | */ 137 | public function update(Task $task, Request $request, $id) 138 | { 139 | $this->validate($request, $this->rules); 140 | 141 | $task = Task::findOrFail($id); 142 | $task->name = $request->input('name'); 143 | $task->description = $request->input('description'); 144 | $task->completed = $request->input('completed'); 145 | $task->save(); 146 | 147 | return redirect('tasks')->with('success', 'Task Updated'); 148 | } 149 | 150 | /** 151 | * Remove the specified resource from storage. 152 | * 153 | * @param int $id 154 | * 155 | * @return \Illuminate\Http\Response 156 | */ 157 | public function destroy($id) 158 | { 159 | Task::findOrFail($id)->delete(); 160 | 161 | return redirect('/tasks')->with('success', 'Task Deleted'); 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Laravel 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | {{-- --}} 20 | 21 | 30 | 31 | 32 | 90 | 91 | @yield('content') 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | {{-- --}} 100 | 101 | @yield('scripts') 102 | 103 | 104 | -------------------------------------------------------------------------------- /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' => env('SESSION_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 | |-------------------------------------------------------------------------- 155 | | HTTP Access Only 156 | |-------------------------------------------------------------------------- 157 | | 158 | | Setting this value to true will prevent JavaScript from accessing the 159 | | value of the cookie and the cookie will only be accessible through 160 | | the HTTP protocol. You are free to modify this option if needed. 161 | | 162 | */ 163 | 164 | 'http_only' => true, 165 | 166 | ]; 167 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'alpha' => 'The :attribute may only contain letters.', 20 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', 21 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 22 | 'array' => 'The :attribute must be an array.', 23 | 'before' => 'The :attribute must be a date before :date.', 24 | 'between' => [ 25 | 'numeric' => 'The :attribute must be between :min and :max.', 26 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 27 | 'string' => 'The :attribute must be between :min and :max characters.', 28 | 'array' => 'The :attribute must have between :min and :max items.', 29 | ], 30 | 'boolean' => 'The :attribute field must be true or false.', 31 | 'confirmed' => 'The :attribute confirmation does not match.', 32 | 'date' => 'The :attribute is not a valid date.', 33 | 'date_format' => 'The :attribute does not match the format :format.', 34 | 'different' => 'The :attribute and :other must be different.', 35 | 'digits' => 'The :attribute must be :digits digits.', 36 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 37 | 'dimensions' => 'The :attribute has invalid image dimensions.', 38 | 'distinct' => 'The :attribute field has a duplicate value.', 39 | 'email' => 'The :attribute must be a valid email address.', 40 | 'exists' => 'The selected :attribute is invalid.', 41 | 'file' => 'The :attribute must be a file.', 42 | 'filled' => 'The :attribute field is required.', 43 | 'image' => 'The :attribute must be an image.', 44 | 'in' => 'The selected :attribute is invalid.', 45 | 'in_array' => 'The :attribute field does not exist in :other.', 46 | 'integer' => 'The :attribute must be an integer.', 47 | 'ip' => 'The :attribute must be a valid IP address.', 48 | 'json' => 'The :attribute must be a valid JSON string.', 49 | 'max' => [ 50 | 'numeric' => 'The :attribute may not be greater than :max.', 51 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 52 | 'string' => 'The :attribute may not be greater than :max characters.', 53 | 'array' => 'The :attribute may not have more than :max items.', 54 | ], 55 | 'mimes' => 'The :attribute must be a file of type: :values.', 56 | 'min' => [ 57 | 'numeric' => 'The :attribute must be at least :min.', 58 | 'file' => 'The :attribute must be at least :min kilobytes.', 59 | 'string' => 'The :attribute must be at least :min characters.', 60 | 'array' => 'The :attribute must have at least :min items.', 61 | ], 62 | 'not_in' => 'The selected :attribute is invalid.', 63 | 'numeric' => 'The :attribute must be a number.', 64 | 'present' => 'The :attribute field must be present.', 65 | 'regex' => 'The :attribute format is invalid.', 66 | 'required' => 'The :attribute field is required.', 67 | 'required_if' => 'The :attribute field is required when :other is :value.', 68 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 69 | 'required_with' => 'The :attribute field is required when :values is present.', 70 | 'required_with_all' => 'The :attribute field is required when :values is present.', 71 | 'required_without' => 'The :attribute field is required when :values is not present.', 72 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 73 | 'same' => 'The :attribute and :other must match.', 74 | 'size' => [ 75 | 'numeric' => 'The :attribute must be :size.', 76 | 'file' => 'The :attribute must be :size kilobytes.', 77 | 'string' => 'The :attribute must be :size characters.', 78 | 'array' => 'The :attribute must contain :size items.', 79 | ], 80 | 'string' => 'The :attribute must be a string.', 81 | 'timezone' => 'The :attribute must be a valid zone.', 82 | 'unique' => 'The :attribute has already been taken.', 83 | 'url' => 'The :attribute format is invalid.', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Custom Validation Language Lines 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may specify custom validation messages for attributes using the 91 | | convention "attribute.rule" to name the lines. This makes it quick to 92 | | specify a specific custom language line for a given attribute rule. 93 | | 94 | */ 95 | 96 | 'custom' => [ 97 | 'attribute-name' => [ 98 | 'rule-name' => 'custom-message', 99 | ], 100 | ], 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Custom Validation Attributes 105 | |-------------------------------------------------------------------------- 106 | | 107 | | The following language lines are used to swap attribute place-holders 108 | | with something more reader friendly such as E-Mail Address instead 109 | | of "email". This simply helps us make messages a little cleaner. 110 | | 111 | */ 112 | 113 | 'attributes' => [], 114 | 115 | ]; 116 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | env('APP_ENV', 'production'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Application Debug Mode 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When your application is in debug mode, detailed error messages with 26 | | stack traces will be shown on every error that occurs within your 27 | | application. If disabled, a simple generic error page is shown. 28 | | 29 | */ 30 | 31 | 'debug' => env('APP_DEBUG', false), 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Application URL 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This URL is used by the console to properly generate URLs when using 39 | | the Artisan command line tool. You should set this to the root of 40 | | your application so that it is used when running Artisan tasks. 41 | | 42 | */ 43 | 44 | 'url' => env('APP_URL', 'http://localhost'), 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Application Timezone 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may specify the default timezone for your application, which 52 | | will be used by the PHP date and date-time functions. We have gone 53 | | ahead and set this to a sensible default for you out of the box. 54 | | 55 | */ 56 | 57 | 'timezone' => 'UTC', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Application Locale Configuration 62 | |-------------------------------------------------------------------------- 63 | | 64 | | The application locale determines the default locale that will be used 65 | | by the translation service provider. You are free to set this value 66 | | to any of the locales which will be supported by the application. 67 | | 68 | */ 69 | 70 | 'locale' => 'en', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Application Fallback Locale 75 | |-------------------------------------------------------------------------- 76 | | 77 | | The fallback locale determines the locale to use when the current one 78 | | is not available. You may change the value to correspond to any of 79 | | the language folders that are provided through your application. 80 | | 81 | */ 82 | 83 | 'fallback_locale' => 'en', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Encryption Key 88 | |-------------------------------------------------------------------------- 89 | | 90 | | This key is used by the Illuminate encrypter service and should be set 91 | | to a random, 32 character string, otherwise these encrypted strings 92 | | will not be safe. Please do this before deploying an application! 93 | | 94 | */ 95 | 96 | 'key' => env('APP_KEY'), 97 | 98 | 'cipher' => 'AES-256-CBC', 99 | 100 | /* 101 | |-------------------------------------------------------------------------- 102 | | Logging Configuration 103 | |-------------------------------------------------------------------------- 104 | | 105 | | Here you may configure the log settings for your application. Out of 106 | | the box, Laravel uses the Monolog PHP logging library. This gives 107 | | you a variety of powerful log handlers / formatters to utilize. 108 | | 109 | | Available Settings: "single", "daily", "syslog", "errorlog" 110 | | 111 | */ 112 | 113 | 'log' => env('APP_LOG', 'single'), 114 | 115 | 'log_level' => env('APP_LOG_LEVEL', 'debug'), 116 | 117 | /* 118 | |-------------------------------------------------------------------------- 119 | | Autoloaded Service Providers 120 | |-------------------------------------------------------------------------- 121 | | 122 | | The service providers listed here will be automatically loaded on the 123 | | request to your application. Feel free to add your own services to 124 | | this array to grant expanded functionality to your applications. 125 | | 126 | */ 127 | 128 | 'providers' => [ 129 | 130 | /* 131 | * Laravel Framework Service Providers... 132 | */ 133 | Illuminate\Auth\AuthServiceProvider::class, 134 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 135 | Illuminate\Bus\BusServiceProvider::class, 136 | Illuminate\Cache\CacheServiceProvider::class, 137 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 138 | Illuminate\Cookie\CookieServiceProvider::class, 139 | Illuminate\Database\DatabaseServiceProvider::class, 140 | Illuminate\Encryption\EncryptionServiceProvider::class, 141 | Illuminate\Filesystem\FilesystemServiceProvider::class, 142 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 143 | Illuminate\Hashing\HashServiceProvider::class, 144 | Illuminate\Mail\MailServiceProvider::class, 145 | Illuminate\Pagination\PaginationServiceProvider::class, 146 | Illuminate\Pipeline\PipelineServiceProvider::class, 147 | Illuminate\Queue\QueueServiceProvider::class, 148 | Illuminate\Redis\RedisServiceProvider::class, 149 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 150 | Illuminate\Session\SessionServiceProvider::class, 151 | Illuminate\Translation\TranslationServiceProvider::class, 152 | Illuminate\Validation\ValidationServiceProvider::class, 153 | Illuminate\Notifications\NotificationServiceProvider::class, 154 | Illuminate\View\ViewServiceProvider::class, 155 | 156 | /* 157 | * Application Service Providers... 158 | */ 159 | App\Providers\AppServiceProvider::class, 160 | App\Providers\AuthServiceProvider::class, 161 | App\Providers\EventServiceProvider::class, 162 | App\Providers\RouteServiceProvider::class, 163 | Collective\Html\HtmlServiceProvider::class, 164 | 165 | ], 166 | 167 | /* 168 | |-------------------------------------------------------------------------- 169 | | Class Aliases 170 | |-------------------------------------------------------------------------- 171 | | 172 | | This array of class aliases will be registered when this application 173 | | is started. However, feel free to register as many as you wish as 174 | | the aliases are "lazy" loaded so they don't hinder performance. 175 | | 176 | */ 177 | 178 | 'aliases' => [ 179 | 180 | 'App' => Illuminate\Support\Facades\App::class, 181 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 182 | 'Auth' => Illuminate\Support\Facades\Auth::class, 183 | 'Blade' => Illuminate\Support\Facades\Blade::class, 184 | 'Cache' => Illuminate\Support\Facades\Cache::class, 185 | 'Config' => Illuminate\Support\Facades\Config::class, 186 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 187 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 188 | 'DB' => Illuminate\Support\Facades\DB::class, 189 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 190 | 'Event' => Illuminate\Support\Facades\Event::class, 191 | 'File' => Illuminate\Support\Facades\File::class, 192 | 'Gate' => Illuminate\Support\Facades\Gate::class, 193 | 'Hash' => Illuminate\Support\Facades\Hash::class, 194 | 'Lang' => Illuminate\Support\Facades\Lang::class, 195 | 'Log' => Illuminate\Support\Facades\Log::class, 196 | 'Mail' => Illuminate\Support\Facades\Mail::class, 197 | 'Password' => Illuminate\Support\Facades\Password::class, 198 | 'Queue' => Illuminate\Support\Facades\Queue::class, 199 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 200 | 'Redis' => Illuminate\Support\Facades\Redis::class, 201 | 'Request' => Illuminate\Support\Facades\Request::class, 202 | 'Response' => Illuminate\Support\Facades\Response::class, 203 | 'Route' => Illuminate\Support\Facades\Route::class, 204 | 'Schema' => Illuminate\Support\Facades\Schema::class, 205 | 'Session' => Illuminate\Support\Facades\Session::class, 206 | 'Storage' => Illuminate\Support\Facades\Storage::class, 207 | 'URL' => Illuminate\Support\Facades\URL::class, 208 | 'Validator' => Illuminate\Support\Facades\Validator::class, 209 | 'View' => Illuminate\Support\Facades\View::class, 210 | 'Form' => Collective\Html\FormFacade::class, 211 | 'Notification' => Illuminate\Support\Facades\Notification::class, 212 | 'Html' => Collective\Html\HtmlFacade::class, 213 | 214 | ], 215 | 216 | ]; 217 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # laravel-tasks 2 | 3 | ### Laravel-Tasks is a Complete Build of Laravel 7 with Individual User Task Lists 4 | 5 | ##### COMPLETE WORKING BUILD - R2R. 6 | 7 | Laravel 7 with user authentication, password recovery, and individual user tasks lists. This also makes full use of Controllers for the routes, templates for the views, and makes use of middleware for routing. Uses laravel ORM modeling and has CRUD (Create Read Update Delete) functionality for all tasks. 8 | 9 | This has robust verbose examples using Laravel best practices. The task list is a build out of https://laravel.com/docs/7/quickstart. 10 | 11 | Super easy setup, can be done in 5 minutes or less. 12 | 13 | ###### A [Laravel](http://laravel.com/) 7.x with minimal [Bootstrap](http://getbootstrap.com) 3.5.x project. 14 | | Laravel-Tasks Features | 15 | | :------------ | 16 | |Built on [Laravel](http://laravel.com/) 5.2| 17 | |Dependencies are managed with [COMPOSER](https://getcomposer.org/)| 18 | |CRUD (Create, Read, Update, Delete) Tasks Management| 19 | |User Registration with password reset via Email| 20 | |User Login with remember password| 21 | 22 | ### Quick Project Setup 23 | ###### (Not including the dev environment) 24 | 1. Run `sudo git clone https://github.com/jeremykenedy/laravel-tasks.git laravel-tasks` 25 | 2. Create a MySQL database for the project 26 | * ```mysql -u root -p```, if using Vagrant: ```mysql -u homestead -psecret``` 27 | * ```create database laravelTasks;``` 28 | * ```\q``` 29 | 3. From the projects root run `cp .env.example .env` 30 | 4. Configure your `.env` 31 | 5. Run `sudo composer update` from the projects root folder 32 | 6. From the projects root folder run `sudo chmod -R 755 ../laravel-tasks` 33 | 7. From the projects root folder run `php artisan key:generate` 34 | 8. From the projects root folder run `php artisan migrate` 35 | 9. From the projects root folder run `composer dump-autoload` 36 | 37 | And thats it with the caveat of setting up and configuring your development environemnt. I recommend [VAGRANT](https://docs.vagrantup.com/v2/getting-started/) or the Laravel configured instance of Vagrant called [HOMESTEAD](http://laravel.com/docs/7/homestead). 38 | 39 | #### View the Project in Browser 40 | 1. From the projects root folder run `php artisan serve` 41 | 2. Open your web browser and go to `http://localhost` 42 | 43 | 44 | ### Laravel-Tasks Authentication URL's (routes) 45 | * ```/``` 46 | * ```/auth/login``` 47 | * ```/auth/logout``` 48 | * ```/auth/register``` 49 | * ```/password/reset``` 50 | 51 | ### Laravel-Tasks URL's (routes) 52 | * ```/home``` 53 | * ```/tasks``` 54 | * ```/tasks/create``` 55 | * ```/tasks/{id}/edit``` 56 | * ```/tasks-all``` 57 | * ```/tasks-complete``` 58 | * ```/tasks-incomplete``` 59 | 60 | --- 61 | 62 | ## [Laravel](http://laravel.com/) PHP Framework 63 | 64 | [![Build Status](https://travis-ci.org/laravel/framework.png)](https://travis-ci.org/laravel/framework) [![Latest Stable Version](https://poser.pugx.org/laravel/framework/version.png)](https://packagist.org/packages/laravel/framework) [![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.png)](https://packagist.org/packages/laravel/framework) [![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) 65 | 66 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching. 67 | 68 | Laravel aims to make the development process a pleasing one for the developer without sacrificing application functionality. Happy developers make the best code. To this end, we've attempted to combine the very best of what we have seen in other web frameworks, including frameworks implemented in other languages, such as Ruby on Rails, ASP.NET MVC, and Sinatra. 69 | 70 | Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. 71 | 72 | ### Official Laravel Documentation 73 | 74 | Documentation for the entire framework can be found on the [Laravel website](http://laravel.com/docs). 75 | 76 | ### Contributing To Laravel 77 | 78 | **All Laravel Framework related issues and pull requests should be filed on the [laravel/framework](http://github.com/laravel/framework) repository.** 79 | 80 | ### Laravel License 81 | 82 | The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) 83 | 84 | ## [Bootstrap](http://getbootstrap.com) Front-End Framework 85 | 86 | [![Build Status](https://img.shields.io/travis/twbs/bootstrap/master.svg)](https://travis-ci.org/twbs/bootstrap) ![Bower version](https://img.shields.io/bower/v/bootstrap.svg) [![npm version](https://img.shields.io/npm/v/bootstrap.svg)](https://www.npmjs.com/package/bootstrap) [![devDependency Status](https://img.shields.io/david/dev/twbs/bootstrap.svg)](https://david-dm.org/twbs/bootstrap#info=devDependencies) [![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) 87 | 88 | Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thornton](https://twitter.com/fat), and maintained by the [core team](https://github.com/orgs/twbs/people) with the massive support and involvement of the community. 89 | 90 | [Bootstrap](http://getbootstrap.com)'s documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at [](http://getbootstrap.com). 91 | 92 | --- 93 | 94 | ## Development Environement References and help 95 | 96 | #### VAGRANT Dev Environment References 97 | 98 | ###### VAGRANT Virtual Machine Details 99 | |Item |Value: 100 | |:------------- |:-------------| 101 | |Hostname|homestead| 102 | |IP Address|192.168.10.10| 103 | |Username|vagrant| 104 | |SU Password|vagrant| 105 | |Database Host|127.0.0.1| 106 | |Database Port|33060| 107 | |Database Username|homestead| 108 | |Database Password|secret| 109 | ###### Start VAGRANT 110 | |Command |Action 111 | |:------------- |:-------------| 112 | | `vagrant up` | Start Vagrant VM | 113 | | `vagrant up --provision` | Start Vagrant VM if vagrantfile updated | 114 | | `vagrant halt` | Stop Vagrant VM | 115 | 116 | ###### Access VAGRANT SSH and MySQL 117 | |Command |Action | 118 | |------------- |:------------- |:-------------| 119 | | ```sudo ssh vagrant@127.0.0.1 -p 222``` | Access Vagrant VM via SSH. Password is ``` vagrant ``` | 120 | | ```mysql -u homestead -psecret``` | Access Vagrant VM MySQL. Password is ``` vagrant ``` | 121 | 122 | If you do not have Bower, it can be installed using Node Package Manager (NPM). 123 | If you do not have NPM, it can be installed using NODE JS. 124 | 125 | ###Install NODE JS 126 | ####Node JS can be installed muliple ways: 127 | Mac GUI Installer, easiest way (Simply [Download](https://nodejs.org/en/) and Install) 128 | 129 | ####Node JS can also be installed using Homebrew Package Manager with the following command: 130 | ``` 131 | brew install node 132 | ``` 133 | 134 | ###Install Node Package Manager (NPM) 135 | ####NPM can be installed using the following command: 136 | ``` 137 | npm install -g bower 138 | ``` 139 | 140 | ###Install Bower 141 | ####Bower can be installed with the following command: 142 | ``` 143 | sudo npm install -g bower 144 | ``` 145 | 146 | ###Install GULP 147 | ####GULP can be installed using the following command: 148 | ``` 149 | npm install -g gulp 150 | ``` 151 | 152 | ###Install COMPOSER 153 | 154 | ####COMPOSER can be installed using the following commands: 155 | ``` 156 | sudo curl -sS https://getcomposer.org/installer | php 157 | sudo mv composer.phar /usr/local/bin/composer 158 | ``` 159 | 160 | ####COMPOSER on MAC OS X can be installed using the following commands: 161 | ``` 162 | sudo brew update 163 | sudo brew tap homebrew/dupes 164 | sudo brew tap homebrew/php 165 | sudo brew install composer 166 | ``` 167 | 168 | #### Very Helpful Aliases 169 | You can edit/or create your systems (MAC OS X) alias file with the follwing command: 170 | ``` 171 | sudo vim ~/.bash_profile 172 | ``` 173 | 174 | To update TERMINAL CLI to be able to use the the added aliases run the following command: 175 | ``` 176 | . ~/.bash_profile 177 | ``` 178 | 179 | ##### *You can choose all or some of the following aliases to add to your `.bash_profile`:* 180 | 181 | ###### Vagrant/Homestead Aliases 182 | ``` 183 | alias machost='sudo vim /etc/hosts' 184 | alias edithost='sudo vim /etc/hosts' 185 | alias sshlara='sudo ssh vagrant@127.0.0.1 -p 2222' 186 | alias laraedit='vim ~/.homestead/Homestead.yaml ' 187 | alias aliaslara='vim ~/.homestead/aliases' 188 | alias laraalias='vim ~/.homestead/aliases' 189 | alias sql='mysql -u homestead -psecret' 190 | alias larasql='mysql -u homestead -psecret' 191 | alias updatecomposer='sudo composer self-update' 192 | alias rollbackcomposer='sudo composer self-update --rollback' 193 | ``` 194 | 195 | A helpful bashfile alias function to **start VAGRANT** instance: 196 | ``` 197 | function laraup { 198 | _pwd=$(pwd) 199 | startVM(){ 200 | vagrant up --provision 201 | } 202 | echo "==============================================================================" 203 | echo "****** STARTING LARAVEL VAGRANT INSTANCE " 204 | echo "==============================================================================" 205 | cd ~/Homestead/ 206 | if startVM ; then 207 | echo "==============================================================================" 208 | echo "****** SUCCESS - LARAVEL VAGRANT STARTED :)~" 209 | echo "==============================================================================" 210 | else 211 | echo "==============================================================================" 212 | echo "****** ERROR - LARAVEL VAGRANT DID NOT START :(" 213 | echo "==============================================================================" 214 | fi 215 | cd $_originalDir 216 | } 217 | ``` 218 | 219 | A helpful bashfile alias function to **shutdown/halt/stop VAGRANT** instance: 220 | ``` 221 | function laradown { 222 | _pwd=$(pwd) 223 | stopVM(){ 224 | vagrant halt 225 | } 226 | echo "==============================================================================" 227 | echo "****** STOPPING LARAVEL VAGRANT INSTANCE " 228 | echo "==============================================================================" 229 | cd ~/Homestead/ 230 | if stopVM ; then 231 | echo "==============================================================================" 232 | echo "****** SUCCESS - LARAVEL VAGRANT SHUTDOWN :)~" 233 | echo "==============================================================================" 234 | else 235 | echo "==============================================================================" 236 | echo "****** ERROR - LARAVEL VAGRANT DID SHUTDOWN :(" 237 | echo "==============================================================================" 238 | fi 239 | cd $_originalDir 240 | } 241 | ``` 242 | 243 | A helpful bashfile alias function to **remove VAGRANT** instance: 244 | ``` 245 | function larakill { 246 | _pwd=$(pwd) 247 | killVM(){ 248 | vagrant destroy 249 | } 250 | echo "==============================================================================" 251 | echo "****** DESTROYING LARAVEL VAGRANT INSTANCE " 252 | echo "==============================================================================" 253 | cd ~/Homestead/ 254 | if killVM ; then 255 | echo "==============================================================================" 256 | echo "****** SUCCESS - LARAVEL VAGRANT DESTROYING :)~" 257 | echo "==============================================================================" 258 | else 259 | echo "==============================================================================" 260 | echo "****** ERROR - LARAVEL VAGRANT WAS NOT DESTROYING :(" 261 | echo "==============================================================================" 262 | fi 263 | cd $_originalDir 264 | } 265 | ``` 266 | 267 | ##### General Very Helpful Aliases 268 | ###### Cleanup 269 | A nice alias to **list all** the MAC and OSX filesystem booger: 270 | ``` 271 | alias cleanprint=' 272 | find . -name "*.DS_Store" -print; 273 | find . -name "*.DS_Store" -print; 274 | find . -name "*._DS_Store" -print; 275 | find . -name "._.DS_Store" -print; 276 | find . -name ".DS_Store" -print; 277 | find . -name "Thumbs.db" -print; 278 | find . -name "._.*" -print; 279 | find . -name "._*" -print ; 280 | ' 281 | ``` 282 | 283 | A nice alias to **delete all** the MAC and OSX filesystem booger: 284 | ``` 285 | alias cleanrm=' 286 | find . -name "*.DS_Store" -delete; 287 | find . -name "*.DS_Store" -delete; 288 | find . -name "*._DS_Store" -delete; 289 | find . -name "._.DS_Store" -delete; 290 | find . -name ".DS_Store" -delete; 291 | find . -name "Thumbs.db" -delete; 292 | find . -name "._.*" -delete; 293 | find . -name "._*" -delete ; 294 | ' 295 | ``` 296 | 297 | A nice alias to **list and delete all** the MAC and OSX filesystem boogers: 298 | ``` 299 | alias cleanboth=' 300 | find . -name "*.DS_Store" -print; 301 | find . -name "*.DS_Store" -print; 302 | find . -name "*._DS_Store" -print; 303 | find . -name "._.DS_Store" -print; 304 | find . -name ".DS_Store" -print; 305 | find . -name "Thumbs.db" -print; 306 | find . -name "._.*" -print; 307 | find . -name "._*" -print ; 308 | find . -name "*.DS_Store" -delete; 309 | find . -name "*.DS_Store" -delete; 310 | find . -name "*._DS_Store" -delete; 311 | find . -name "._.DS_Store" -delete; 312 | find . -name ".DS_Store" -delete; 313 | find . -name "Thumbs.db" -delete; 314 | find . -name "._.*" -delete; 315 | find . -name "._*" -delete ; 316 | ' 317 | ``` 318 | ###### Show MAC OS X files 319 | Alias to **show all hidden files** on MAC OS X filesystem: 320 | ``` 321 | alias showfiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app' 322 | ``` 323 | 324 | Alias to **hide all hidden files** on MAC OS X filesystem: 325 | ``` 326 | alias hidefiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app' 327 | ``` 328 | 329 | ##### GIT CLI Quick alias functions 330 | ###### Quick GIT PUSH 331 | ``` 332 | function quickpush { 333 | _currentBranch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') 334 | sudo git add -A 335 | sudo git commit -m "quick push" 336 | sudo git push $_currentBranch 337 | } 338 | ``` 339 | 340 | ###### Another flavor of Quick GIT PUSH 341 | ``` 342 | function push { 343 | _currentBranch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') 344 | sudo git add -A 345 | sudo git commit -m "quick push" 346 | sudo git push $_currentBranch 347 | } 348 | ``` 349 | 350 | ###### Quick GIT PULL 351 | ``` 352 | function quickpull { 353 | _currentBranch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') 354 | sudo git pull $_currentBranch 355 | } 356 | ``` 357 | 358 | ###### Another flavor of Quick GIT PULL 359 | ``` 360 | function pull { 361 | _currentBranch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') 362 | sudo git pull $_currentBranch 363 | } 364 | ``` 365 | 366 | ##### My keyboard hates me GIT helper aliases: 367 | ``` 368 | alias gut='git' 369 | alias got='git' 370 | alias car='cat' 371 | alias commut='commit' 372 | alias commmit='commit' 373 | alias comit='commit' 374 | alias commot='commit' 375 | ``` 376 | 377 | ##### Typing `clear` takes too many keystrokes alias helper: 378 | ``` 379 | alias cl='clear' 380 | ``` 381 | 382 | ###### Helpful quick filesystem `ls` alias helpers: 383 | ``` 384 | alias la='ls -la' 385 | alias ll='ls -la' 386 | ``` 387 | 388 | ##### **Alias** and **`.bash_profile management`** aliases: 389 | ###### **Show** Aliases helpers: 390 | ``` 391 | alias listalias='cat ~/.bash_profile' 392 | alias aliaslist='cat ~/.bash_profile' 393 | alias list='cat ~/.bash_profile' 394 | alias text='cat ~/.bash_profile' 395 | alias aliasshow='cat ~/.bash_profile' 396 | ``` 397 | 398 | ###### **Edit** Aliases helpers: 399 | ``` 400 | alias aliasedit='sudo vim ~/.bash_profile' 401 | alias editalias='sudo vim ~/.bash_profile' 402 | ``` 403 | 404 | #### **Restart/Enable** Aliases helpers: 405 | ``` 406 | alias aliasreset='. ~/.bash_profile' 407 | alias aliasr='. ~/.bash_profile' 408 | alias alr='. ~/.bash_profile' 409 | alias alsr='. ~/.bash_profile' 410 | alias aliasrestart='. ~/.bash_profile' 411 | ``` 412 | 413 | #### Things not working (Troubleshooting)? 414 | 415 | ##### Issue: Cannot access project through web browser after running vagrant up / homestead up 416 | 417 | ###### Error Message from Browser: 418 | ``` 419 | This webpage is not available 420 | ERR_NAME_NOT_RESOLVED 421 | ``` 422 | 423 | ##### 1. Check Vagrant/Homestead configuration 424 | ###### a. Open configuration with the following command: 425 | 426 | vim ~/.homestead/Homestead.yaml or laraedit 427 | 428 | ###### b. Check to make sure your folders are mapped (See example A1.): 429 | Note: 430 | map: Is the path to the your files on your local machine 431 | to: Is the virtual file path to your projects that vagrant will create 432 | ###### Example A1 433 | ``` 434 | folders: 435 | - map: /Users/yourLocalUserName/Sites/project1 436 | to: /home/vagrant/Sites/project1/public 437 | 438 | - map: /Users/yourLocalUserName/Sites/project2 439 | to: /home/vagrant/Sites/project2/public 440 | ``` 441 | ##### c. Check to make sure your projects URI and SYMLINK is mapped (See example A2): 442 | map: Is the local URI of your project 443 | to: Is the virtual symlink to your projects virtual file path 444 | ###### Example A2 445 | ``` 446 | sites: 447 | - map: project1.local 448 | to: /home/vagrant/Sites/project1/public 449 | 450 | - map: project2.app 451 | to: /home/vagrant/Sites/project2/public 452 | ``` 453 | #### 2. Check your local hosts file for local pointer redirect: 454 | ##### a. Open your hosts file (See example B1): 455 | Note: Instructions are for Mac OS X 456 | ###### Example B1 457 | `sudo vim /etc/hosts` or `edithost` 458 | 459 | ##### b. Edit your hosts file (See example B2): 460 | Note: Replace examples URI used in Vargrant/Homestead configuration file and use the IP address of your local Vargrant/Homestead virtual machine instance 461 | 462 | ###### Example B2 - The last line is the important part of the example 463 | ``` 464 | ## 465 | # Host Database 466 | # 467 | # localhost is used to configure the loopback interface 468 | # when the system is booting. Do not change this entry. 469 | ## 470 | 127.0.0.1 localhost 471 | 255.255.255.255 broadcasthost 472 | 192.168.10.10 laravel-authentication.local 473 | ``` 474 | 475 | --- 476 | 477 | ## Enjoy 478 | 479 | ###### ~ **Jeremy** 480 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # laravel-tasks [![License](http://jeremykenedy.com/license-mit.svg)]() 2 | [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors) 3 | 4 | ### Laravel-Tasks is a Complete Build of Laravel 5.2 with Individual User Task Lists 5 | 6 | ##### COMPLETE WORKING BUILD - R2R. 7 | 8 | Laravel 5.2 with user authentication, password recovery, and individual user tasks lists. This also makes full use of Controllers for the routes, templates for the views, and makes use of middleware for routing. Uses laravel ORM modeling and has CRUD (Create Read Update Delete) functionality for all tasks. 9 | 10 | This has robust verbose examples using Laravel best practices. The task list is a build out of https://laravel.com/docs/5.2/quickstart. 11 | 12 | ### Super easy setup, can be done in 5 minutes or less. 13 | 14 | ###### A [Laravel](http://laravel.com/) 5.2.x with minimal [Bootstrap](http://getbootstrap.com) 3.5.x project. 15 | | Laravel-Tasks Features | 16 | | :------------ | 17 | |Built on [Laravel](http://laravel.com/) 5.2| 18 | |Uses [MySQL](https://github.com/mysql) Database| 19 | |Uses [Artisan](http://laravel.com/docs/5.2/artisan) to manage database migration, schema creations, and create/publish page controller templates| 20 | |Dependencies are managed with [COMPOSER](https://getcomposer.org/)| 21 | |CRUD (Create, Read, Update, Delete) Tasks Management| 22 | |User Registration with password reset via Email| 23 | |User Login with remember password| 24 | 25 | ### Quick Project Setup 26 | ###### (Not including the dev environment) 27 | 1. Run `sudo git clone https://github.com/jeremykenedy/laravel-tasks.git laravel-tasks` 28 | 2. Create a MySQL database for the project 29 | * ```mysql -u root -p```, if using Vagrant: ```mysql -u homestead -psecret``` 30 | * ```create database laravelTasks;``` 31 | * ```\q``` 32 | 3. From the projects root run `cp .env.example .env` 33 | 4. Configure your `.env` 34 | 5. Run `sudo composer update` from the projects root folder 35 | 6. From the projects root folder run `sudo chmod -R 755 ../laravel-tasks` 36 | 7. From the projects root folder run `php artisan key:generate` 37 | 8. From the projects root folder run `php artisan migrate` 38 | 9. From the projects root folder run `composer dump-autoload` 39 | 40 | And thats it with the caveat of setting up and configuring your development environemnt. I recommend [VAGRANT](https://docs.vagrantup.com/v2/getting-started/) or the Laravel configured instance of Vagrant called [HOMESTEAD](http://laravel.com/docs/5.2/homestead). 41 | 42 | #### View the Project in Browser 43 | 1. From the projects root folder run `php artisan serve` 44 | 2. Open your web browser and go to `http://localhost` 45 | 46 | 47 | ### Laravel-Tasks Authentication URL's (routes) 48 | * ```/``` 49 | * ```/auth/login``` 50 | * ```/auth/logout``` 51 | * ```/auth/register``` 52 | * ```/password/reset``` 53 | 54 | ### Laravel-Tasks URL's (routes) 55 | * ```/home``` 56 | * ```/tasks``` 57 | * ```/tasks/create``` 58 | * ```/tasks/{id}/edit``` 59 | * ```/tasks-all``` 60 | * ```/tasks-complete``` 61 | * ```/tasks-incomplete``` 62 | 63 | #### Laravel Developement Packages Used References 64 | * https://laravelcollective.com/docs/5.2/html 65 | * https://laravel.com/docs/5.2/authentication 66 | * https://laravel.com/docs/5.2/authorization 67 | * https://laravel.com/docs/5.2/quickstart 68 | * https://laravel.com/docs/5.2/routing 69 | * https://laravel.com/docs/5.0/schema 70 | 71 | --- 72 | 73 | ## [Laravel](http://laravel.com/) PHP Framework 74 | 75 | [![Build Status](https://travis-ci.org/laravel/framework.png)](https://travis-ci.org/laravel/framework) [![Latest Stable Version](https://poser.pugx.org/laravel/framework/version.png)](https://packagist.org/packages/laravel/framework) [![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.png)](https://packagist.org/packages/laravel/framework) [![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) 76 | 77 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching. 78 | 79 | Laravel aims to make the development process a pleasing one for the developer without sacrificing application functionality. Happy developers make the best code. To this end, we've attempted to combine the very best of what we have seen in other web frameworks, including frameworks implemented in other languages, such as Ruby on Rails, ASP.NET MVC, and Sinatra. 80 | 81 | Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. 82 | 83 | ### Official Laravel Documentation 84 | 85 | Documentation for the entire framework can be found on the [Laravel website](http://laravel.com/docs). 86 | 87 | ### Contributing To Laravel 88 | 89 | **All Laravel Framework related issues and pull requests should be filed on the [laravel/framework](http://github.com/laravel/framework) repository.** 90 | 91 | ### Laravel License 92 | 93 | The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) 94 | 95 | ## [Bootstrap](http://getbootstrap.com) Front-End Framework 96 | 97 | [![Build Status](https://img.shields.io/travis/twbs/bootstrap/master.svg)](https://travis-ci.org/twbs/bootstrap) ![Bower version](https://img.shields.io/bower/v/bootstrap.svg) [![npm version](https://img.shields.io/npm/v/bootstrap.svg)](https://www.npmjs.com/package/bootstrap) [![devDependency Status](https://img.shields.io/david/dev/twbs/bootstrap.svg)](https://david-dm.org/twbs/bootstrap#info=devDependencies) [![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) 98 | 99 | Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thornton](https://twitter.com/fat), and maintained by the [core team](https://github.com/orgs/twbs/people) with the massive support and involvement of the community. 100 | 101 | [Bootstrap](http://getbootstrap.com)'s documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at [](http://getbootstrap.com). 102 | 103 | --- 104 | 105 | ## Development Environement References and help 106 | 107 | #### VAGRANT Dev Environment References 108 | 109 | ###### VAGRANT Virtual Machine Details 110 | |Item |Value: 111 | |:------------- |:-------------| 112 | |Hostname|homestead| 113 | |IP Address|192.168.10.10| 114 | |Username|vagrant| 115 | |SU Password|vagrant| 116 | |Database Host|127.0.0.1| 117 | |Database Port|33060| 118 | |Database Username|homestead| 119 | |Database Password|secret| 120 | ###### Start VAGRANT 121 | |Command |Action 122 | |:------------- |:-------------| 123 | | `vagrant up` | Start Vagrant VM | 124 | | `vagrant up --provision` | Start Vagrant VM if vagrantfile updated | 125 | | `vagrant halt` | Stop Vagrant VM | 126 | 127 | ###### Access VAGRANT SSH and MySQL 128 | |Command |Action | 129 | |------------- |:------------- |:-------------| 130 | | ```sudo ssh vagrant@127.0.0.1 -p 222``` | Access Vagrant VM via SSH. Password is ``` vagrant ``` | 131 | | ```mysql -u homestead -psecret``` | Access Vagrant VM MySQL. Password is ``` vagrant ``` | 132 | 133 | If you do not have Bower, it can be installed using Node Package Manager (NPM). 134 | If you do not have NPM, it can be installed using NODE JS. 135 | 136 | ###Install NODE JS 137 | ####Node JS can be installed muliple ways: 138 | Mac GUI Installer, easiest way (Simply [Download](https://nodejs.org/en/) and Install) 139 | 140 | ####Node JS can also be installed using Homebrew Package Manager with the following command: 141 | ``` 142 | brew install node 143 | ``` 144 | 145 | ###Install Node Package Manager (NPM) 146 | ####NPM can be installed using the following command: 147 | ``` 148 | npm install -g bower 149 | ``` 150 | 151 | ###Install Bower 152 | ####Bower can be installed with the following command: 153 | ``` 154 | sudo npm install -g bower 155 | ``` 156 | 157 | ###Install GULP 158 | ####GULP can be installed using the following command: 159 | ``` 160 | npm install -g gulp 161 | ``` 162 | 163 | ###Install COMPOSER 164 | 165 | ####COMPOSER can be installed using the following commands: 166 | ``` 167 | sudo curl -sS https://getcomposer.org/installer | php 168 | sudo mv composer.phar /usr/local/bin/composer 169 | ``` 170 | 171 | ####COMPOSER on MAC OS X can be installed using the following commands: 172 | ``` 173 | sudo brew update 174 | sudo brew tap homebrew/dupes 175 | sudo brew tap homebrew/php 176 | sudo brew install composer 177 | ``` 178 | 179 | #### Very Helpful Aliases 180 | You can edit/or create your systems (MAC OS X) alias file with the follwing command: 181 | ``` 182 | sudo vim ~/.bash_profile 183 | ``` 184 | 185 | To update TERMINAL CLI to be able to use the the added aliases run the following command: 186 | ``` 187 | . ~/.bash_profile 188 | ``` 189 | 190 | ##### *You can choose all or some of the following aliases to add to your `.bash_profile`:* 191 | 192 | ###### Vagrant/Homestead Aliases 193 | ``` 194 | alias machost='sudo vim /etc/hosts' 195 | alias edithost='sudo vim /etc/hosts' 196 | alias sshlara='sudo ssh vagrant@127.0.0.1 -p 2222' 197 | alias laraedit='vim ~/.homestead/Homestead.yaml ' 198 | alias aliaslara='vim ~/.homestead/aliases' 199 | alias laraalias='vim ~/.homestead/aliases' 200 | alias sql='mysql -u homestead -psecret' 201 | alias larasql='mysql -u homestead -psecret' 202 | alias updatecomposer='sudo composer self-update' 203 | alias rollbackcomposer='sudo composer self-update --rollback' 204 | ``` 205 | 206 | A helpful bashfile alias function to **start VAGRANT** instance: 207 | ``` 208 | function laraup { 209 | _pwd=$(pwd) 210 | startVM(){ 211 | vagrant up --provision 212 | } 213 | echo "==============================================================================" 214 | echo "****** STARTING LARAVEL VAGRANT INSTANCE " 215 | echo "==============================================================================" 216 | cd ~/Homestead/ 217 | if startVM ; then 218 | echo "==============================================================================" 219 | echo "****** SUCCESS - LARAVEL VAGRANT STARTED :)~" 220 | echo "==============================================================================" 221 | else 222 | echo "==============================================================================" 223 | echo "****** ERROR - LARAVEL VAGRANT DID NOT START :(" 224 | echo "==============================================================================" 225 | fi 226 | cd $_originalDir 227 | } 228 | ``` 229 | 230 | A helpful bashfile alias function to **shutdown/halt/stop VAGRANT** instance: 231 | ``` 232 | function laradown { 233 | _pwd=$(pwd) 234 | stopVM(){ 235 | vagrant halt 236 | } 237 | echo "==============================================================================" 238 | echo "****** STOPPING LARAVEL VAGRANT INSTANCE " 239 | echo "==============================================================================" 240 | cd ~/Homestead/ 241 | if stopVM ; then 242 | echo "==============================================================================" 243 | echo "****** SUCCESS - LARAVEL VAGRANT SHUTDOWN :)~" 244 | echo "==============================================================================" 245 | else 246 | echo "==============================================================================" 247 | echo "****** ERROR - LARAVEL VAGRANT DID SHUTDOWN :(" 248 | echo "==============================================================================" 249 | fi 250 | cd $_originalDir 251 | } 252 | ``` 253 | 254 | A helpful bashfile alias function to **remove VAGRANT** instance: 255 | ``` 256 | function larakill { 257 | _pwd=$(pwd) 258 | killVM(){ 259 | vagrant destroy 260 | } 261 | echo "==============================================================================" 262 | echo "****** DESTROYING LARAVEL VAGRANT INSTANCE " 263 | echo "==============================================================================" 264 | cd ~/Homestead/ 265 | if killVM ; then 266 | echo "==============================================================================" 267 | echo "****** SUCCESS - LARAVEL VAGRANT DESTROYING :)~" 268 | echo "==============================================================================" 269 | else 270 | echo "==============================================================================" 271 | echo "****** ERROR - LARAVEL VAGRANT WAS NOT DESTROYING :(" 272 | echo "==============================================================================" 273 | fi 274 | cd $_originalDir 275 | } 276 | ``` 277 | 278 | ##### General Very Helpful Aliases 279 | ###### Cleanup 280 | A nice alias to **list all** the MAC and OSX filesystem booger: 281 | ``` 282 | alias cleanprint=' 283 | find . -name "*.DS_Store" -print; 284 | find . -name "*.DS_Store" -print; 285 | find . -name "*._DS_Store" -print; 286 | find . -name "._.DS_Store" -print; 287 | find . -name ".DS_Store" -print; 288 | find . -name "Thumbs.db" -print; 289 | find . -name "._.*" -print; 290 | find . -name "._*" -print ; 291 | ' 292 | ``` 293 | 294 | A nice alias to **delete all** the MAC and OSX filesystem booger: 295 | ``` 296 | alias cleanrm=' 297 | find . -name "*.DS_Store" -delete; 298 | find . -name "*.DS_Store" -delete; 299 | find . -name "*._DS_Store" -delete; 300 | find . -name "._.DS_Store" -delete; 301 | find . -name ".DS_Store" -delete; 302 | find . -name "Thumbs.db" -delete; 303 | find . -name "._.*" -delete; 304 | find . -name "._*" -delete ; 305 | ' 306 | ``` 307 | 308 | A nice alias to **list and delete all** the MAC and OSX filesystem boogers: 309 | ``` 310 | alias cleanboth=' 311 | find . -name "*.DS_Store" -print; 312 | find . -name "*.DS_Store" -print; 313 | find . -name "*._DS_Store" -print; 314 | find . -name "._.DS_Store" -print; 315 | find . -name ".DS_Store" -print; 316 | find . -name "Thumbs.db" -print; 317 | find . -name "._.*" -print; 318 | find . -name "._*" -print ; 319 | find . -name "*.DS_Store" -delete; 320 | find . -name "*.DS_Store" -delete; 321 | find . -name "*._DS_Store" -delete; 322 | find . -name "._.DS_Store" -delete; 323 | find . -name ".DS_Store" -delete; 324 | find . -name "Thumbs.db" -delete; 325 | find . -name "._.*" -delete; 326 | find . -name "._*" -delete ; 327 | ' 328 | ``` 329 | ###### Show MAC OS X files 330 | Alias to **show all hidden files** on MAC OS X filesystem: 331 | ``` 332 | alias showfiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app' 333 | ``` 334 | 335 | Alias to **hide all hidden files** on MAC OS X filesystem: 336 | ``` 337 | alias hidefiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app' 338 | ``` 339 | 340 | ##### GIT CLI Quick alias functions 341 | ###### Quick GIT PUSH 342 | ``` 343 | function quickpush { 344 | _currentBranch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') 345 | sudo git add -A 346 | sudo git commit -m "quick push" 347 | sudo git push $_currentBranch 348 | } 349 | ``` 350 | 351 | ###### Another flavor of Quick GIT PUSH 352 | ``` 353 | function push { 354 | _currentBranch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') 355 | sudo git add -A 356 | sudo git commit -m "quick push" 357 | sudo git push $_currentBranch 358 | } 359 | ``` 360 | 361 | ###### Quick GIT PULL 362 | ``` 363 | function quickpull { 364 | _currentBranch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') 365 | sudo git pull $_currentBranch 366 | } 367 | ``` 368 | 369 | ###### Another flavor of Quick GIT PULL 370 | ``` 371 | function pull { 372 | _currentBranch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') 373 | sudo git pull $_currentBranch 374 | } 375 | ``` 376 | 377 | ##### My keyboard hates me GIT helper aliases: 378 | ``` 379 | alias gut='git' 380 | alias got='git' 381 | alias car='cat' 382 | alias commut='commit' 383 | alias commmit='commit' 384 | alias comit='commit' 385 | alias commot='commit' 386 | ``` 387 | 388 | ##### Typing `clear` takes too many keystrokes alias helper: 389 | ``` 390 | alias cl='clear' 391 | ``` 392 | 393 | ###### Helpful quick filesystem `ls` alias helpers: 394 | ``` 395 | alias la='ls -la' 396 | alias ll='ls -la' 397 | ``` 398 | 399 | ##### **Alias** and **`.bash_profile management`** aliases: 400 | ###### **Show** Aliases helpers: 401 | ``` 402 | alias listalias='cat ~/.bash_profile' 403 | alias aliaslist='cat ~/.bash_profile' 404 | alias list='cat ~/.bash_profile' 405 | alias text='cat ~/.bash_profile' 406 | alias aliasshow='cat ~/.bash_profile' 407 | ``` 408 | 409 | ###### **Edit** Aliases helpers: 410 | ``` 411 | alias aliasedit='sudo vim ~/.bash_profile' 412 | alias editalias='sudo vim ~/.bash_profile' 413 | ``` 414 | 415 | #### **Restart/Enable** Aliases helpers: 416 | ``` 417 | alias aliasreset='. ~/.bash_profile' 418 | alias aliasr='. ~/.bash_profile' 419 | alias alr='. ~/.bash_profile' 420 | alias alsr='. ~/.bash_profile' 421 | alias aliasrestart='. ~/.bash_profile' 422 | ``` 423 | 424 | #### Things not working (Troubleshooting)? 425 | 426 | ##### Issue: Cannot access project through web browser after running vagrant up / homestead up 427 | 428 | ###### Error Message from Browser: 429 | ``` 430 | This webpage is not available 431 | ERR_NAME_NOT_RESOLVED 432 | ``` 433 | 434 | ##### 1. Check Vagrant/Homestead configuration 435 | ###### a. Open configuration with the following command: 436 | 437 | vim ~/.homestead/Homestead.yaml or laraedit 438 | 439 | ###### b. Check to make sure your folders are mapped (See example A1.): 440 | Note: 441 | map: Is the path to the your files on your local machine 442 | to: Is the virtual file path to your projects that vagrant will create 443 | ###### Example A1 444 | ``` 445 | folders: 446 | - map: /Users/yourLocalUserName/Sites/project1 447 | to: /home/vagrant/Sites/project1/public 448 | 449 | - map: /Users/yourLocalUserName/Sites/project2 450 | to: /home/vagrant/Sites/project2/public 451 | ``` 452 | ##### c. Check to make sure your projects URI and SYMLINK is mapped (See example A2): 453 | map: Is the local URI of your project 454 | to: Is the virtual symlink to your projects virtual file path 455 | ###### Example A2 456 | ``` 457 | sites: 458 | - map: project1.local 459 | to: /home/vagrant/Sites/project1/public 460 | 461 | - map: project2.app 462 | to: /home/vagrant/Sites/project2/public 463 | ``` 464 | #### 2. Check your local hosts file for local pointer redirect: 465 | ##### a. Open your hosts file (See example B1): 466 | Note: Instructions are for Mac OS X 467 | ###### Example B1 468 | `sudo vim /etc/hosts` or `edithost` 469 | 470 | ##### b. Edit your hosts file (See example B2): 471 | Note: Replace examples URI used in Vargrant/Homestead configuration file and use the IP address of your local Vargrant/Homestead virtual machine instance 472 | 473 | ###### Example B2 - The last line is the important part of the example 474 | ``` 475 | ## 476 | # Host Database 477 | # 478 | # localhost is used to configure the loopback interface 479 | # when the system is booting. Do not change this entry. 480 | ## 481 | 127.0.0.1 localhost 482 | 255.255.255.255 broadcasthost 483 | 192.168.10.10 laravel-authentication.local 484 | ``` 485 | 486 | --- 487 | 488 | ## Enjoy 489 | 490 | ###### ~ **Jeremy** 491 | 492 | ## Contributors 493 | 494 | Thanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)): 495 | 496 | 497 | 498 | | [Jeremy Kenedy
Jeremy Kenedy](http://jeremykenedy.github.io/)
[💻](https://github.com/jeremykenedy/laravel-tasks/commits?author=jeremykenedy "Code") [🎨](#design-jeremykenedy "Design") | 499 | | :---: | 500 | 501 | 502 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! --------------------------------------------------------------------------------