Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .env.example
100644 → 100755
Empty file.
Empty file modified .gitattributes
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
96 changes: 52 additions & 44 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,58 +1,66 @@
# DO NOT PUSH ANYTHING TO MASTER. ALL WORK SHOULD BE DONE ON A SEPARATE BRANCH AND MERGED IN
# THERE HAS BEEN TOO MUCH BROKEN CODE PUSHED TO MASTER

# Project Information

## About Project
Taskr is task sourcing platform for people to outsource tasks to others who wants to make a quick living from it. Taskr is built on Laravel framework using PHP 7.1 and currently developed by a group of five developers.

Taskr is task sourcing platform for people to outsource tasks to others who wants to make a quick living from it. Taskr is currently

## Setting Your Dev Environment
> ###### As this project is not meant to be production ready, it is advisable to perform the same steps below when deploying the application for production.

#### Follow the steps below to replicate the environment required for development. There are two ways to setup _Taskr_ where one involves in running the environment in a virtual machine while the other in your local machine. It is up to your discretion in the choice made.

### Using Homestead (Recommended)
1. Install and Configure Homestead by following this [guide](https://laravel.com/docs/5.4/homestead).
1. When configuring the `sites` in `homestead.yaml`, use the code block below and replace the folder path with the actual path
```
sites:
- map: homestead.app
to: {folder_path}/public
```
2. Start Homestead by `vagrant up` and SSH into Homestead using `vagrant ssh`.
3. Navigate into the project folder within the SSH session and run `composer install` to get PHP dependencies.
4. Run `yarn` to install Javascript dependencies (e.g. jQuery, Bootstrap, etc.).
5. Run `cp .env.example .env` and modify the .env file using your favourite editor e.g. `nano`, `vim`, `sublime`
6. From [Laravel Homestead](https://laravel.com/docs/5.4/homestead) guide, put in the username and password of the PostgreSQL into .env. defaults: `username: homestead, password: secret`
7. Login to PostgreSQL database by running `psql -U homestead -h localhost` and create database using `CREATE DATABASE taskr` within `psql` shell.
8. Generate an application key for laravel by running the command `php artisan key:generate`.
9. Run database migrations to setup the database tables automatically using `php artisan migrate`.
1. You can also execute database setup code using the SQL file provided `psql -U homestead -h localhost example.sql`.
10. If configured properly in the guide found in step 1, your application should be accessible from your local machine through the domain you have configured.

### Using XAMP (LAMP, MAMP, WAMP) Stack
1. Installing the pre-requisites using one-click installers provided by Bitnami below. Choose your stack based on your host operating system.
1. https://bitnami.com/stack/lamp (Linux)
2. https://bitnami.com/stack/wamp (Windows)
3. https://bitnami.com/stack/mamp (MacOS)
2. Install `composer` onto your machine from https://getcomposer.org/.
3. Navigate to the project folder and run `composer install` to install PHP dependencies.
4. In the same folder, run `yarn` to install Javascript dependencies (e.g. jQuery, Bootstrap, etc.).
5. Create `.env` file and copy `.env.example` content into it. Configure `.env` information with respect to your host configuration.
6. Access your `postgreSQL` database using `phpPgAdmin` and create a new database called `taskr`.
7. Run database migrations to setup the database tables automatically using `php artisan migrate`.
1. You can also execute database setup code using the SQL file provided `psql -U {your_username} -h localhost example.sql`.
8. Ensure that your project folder is in your Apache folder (e.g. Linux - /var/www/html) and it has writable permissions.
9. Navigate to the site based on your Apache settings using your browser.
1. Configure Homestead by following this [guide](https://laravel.com/docs/5.4/homestead).
2. Start Homestead by `vagrant up` and SSH into it using `vagrant ssh`.
3. Navigate into the project folder within the SSH session and run `composer install` to get dependencies.
4. Run `yarn` to get javascript dependencies (e.g. jquery, bootstrap, etc.).
5. Execute `cp .env.example .env` and modify the .env file using your favourite editor e.g. `nano`, `vim`
6. From [Laravel Homestead](https://laravel.com/docs/5.4/homestead) guide, put in the username and password of the PostgreSQL into .env.
7. Login to PostgreSQL database using shell commands or Datagrip and create database called `taskr`.
8. To generate an application key, run the command `php artisan key:generate`.
9. Run database migrations to setup the tables using `php artisan migrate:reset`.
10. If configured properly in step 1, your application should be accessible from your machine through the domain you configured.

## Database Models and Manipulation
Due to the restrictions against ORMs (Eloquent), the project requires the execution of raw queries instead. To understand how to do that in Laravel, take a look at their [documentation](https://laravel.com/docs/5.4/database#running-queries) to learn more.
Due to the restrictions against ORMs (Eloquent), the project requires the execution of raw queries instead. To understand how to do that in Laravel, take a look at their [documentation](https://laravel.com/docs/5.4/database#running-queries) to learn more.

# Laravel Information
---
<p align="center"><img src="https://laravel.com/assets/img/components/logo-laravel.svg"></p>

<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a>
</p>

## About Laravel

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:

- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).

## Populate the database with fake data
Run the SQL queries in database/beta-taskr.sql
User with credentials u/test@gmail.com p/123456 has all data needed to explore all of taskr's functionality.
Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb combination of simplicity, elegance, and innovation give you tools you need to build any application with which you are tasked.

## Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework. The [Laravel documentation](https://laravel.com/docs) is thorough, complete, and makes it a breeze to get started learning the framework.

If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 900 video tutorials on a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.

## Developer Announcement
Due to too many broken code pushed directly into the master branch, everyone should be developing within their branches and making pull request when trying to merge back into master.
## Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions).

## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.

## License

The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
10 changes: 10 additions & 0 deletions app/Bid.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@ class Bid extends Model
| methods for code readability and reuse.
|
*/

public function task()
{
return $this->belongsTo(Task::class);
}

public function user()
{
return $this->belongsTo(User::class);
}
}
Empty file modified app/Console/Kernel.php
100644 → 100755
Empty file.
Empty file modified app/Exceptions/Handler.php
100644 → 100755
Empty file.
32 changes: 32 additions & 0 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Taskr\Http\Controllers\Auth;

use Taskr\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;

class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/

use SendsPasswordResetEmails;

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
39 changes: 39 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace Taskr\Http\Controllers\Auth;

use Taskr\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/

use AuthenticatesUsers;

/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/';

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
}
}
81 changes: 81 additions & 0 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php

namespace Taskr\Http\Controllers\Auth;

use Taskr\User;
use Taskr\Mail\Welcome;
use Taskr\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;

class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/

use RegistersUsers;

/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = '/';

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}

/**
* Get a validator for an incoming registration request.
*
* @param array $data
*
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'first_name' => 'required|max:255',
'last_name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|min:6|confirmed'
]);
}

/**
* Create a new user instance after a valid registration.
*
* @param array $data
*
* @return User
*/
protected function create(array $data)
{
$user = User::create([
'first_name' => $data['first_name'],
'last_name' => $data['last_name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'is_admin' => false,
]);

//\Mail::to($user)->send(new Welcome($user));

return $user;
}
}
61 changes: 0 additions & 61 deletions app/Http/Controllers/Auth/RegistrationController.php

This file was deleted.

39 changes: 39 additions & 0 deletions app/Http/Controllers/Auth/ResetPasswordController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace Taskr\Http\Controllers\Auth;

use Taskr\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;

class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/

use ResetsPasswords;

/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/';

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
Loading