Skip to content

Commit b18218a

Browse files
Initial Release
0 parents  commit b18218a

File tree

184 files changed

+62336
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+62336
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/node_modules
2+
/public/storage
3+
/public/hot
4+
/storage/*.key
5+
/vendor
6+
/.idea
7+
Homestead.json
8+
Homestead.yaml
9+
.env

app/Comment.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use App\Task;
6+
use App\Traits\Userstamps;
7+
use Illuminate\Database\Eloquent\Model;
8+
use Illuminate\Database\Eloquent\SoftDeletes;
9+
10+
class Comment extends Model
11+
{
12+
use SoftDeletes, Userstamps;
13+
14+
/**
15+
* Don't auto-apply mass assignment protection.
16+
*
17+
* @var array
18+
*/
19+
protected $guarded = [];
20+
21+
protected $with = ['creator'];
22+
23+
/**
24+
* The attributes that should be mutated to dates.
25+
*
26+
* @var array
27+
*/
28+
protected $dates = ['deleted_at'];
29+
30+
/**
31+
* A Comment belongs to Task
32+
*
33+
* @return void
34+
*/
35+
public function task()
36+
{
37+
return $this->belongsTo(Task::class);
38+
}
39+
}

app/Console/Kernel.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* The Artisan commands provided by your application.
12+
*
13+
* @var array
14+
*/
15+
protected $commands = [
16+
//
17+
];
18+
19+
/**
20+
* Define the application's command schedule.
21+
*
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
* @return void
24+
*/
25+
protected function schedule(Schedule $schedule)
26+
{
27+
// $schedule->command('inspire')
28+
// ->hourly();
29+
}
30+
31+
/**
32+
* Register the commands for the application.
33+
*
34+
* @return void
35+
*/
36+
protected function commands()
37+
{
38+
$this->load(__DIR__.'/Commands');
39+
40+
require base_path('routes/console.php');
41+
}
42+
}

app/Credential.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use App\Project;
6+
use App\Traits\Userstamps;
7+
use Illuminate\Database\Eloquent\Model;
8+
use Illuminate\Database\Eloquent\SoftDeletes;
9+
10+
class Credential extends Model
11+
{
12+
use SoftDeletes, Userstamps;
13+
14+
/**
15+
* Don't auto-apply mass assignment protection.
16+
*
17+
* @var array
18+
*/
19+
protected $guarded = [];
20+
21+
/**
22+
* The attributes that should be mutated to dates.
23+
*
24+
* @var array
25+
*/
26+
protected $dates = ['deleted_at'];
27+
28+
/**
29+
* Credential belongs to project
30+
*
31+
* @return void
32+
*/
33+
public function project()
34+
{
35+
return $this->belongsTo(Project::class);
36+
}
37+
}

app/Exceptions/Handler.php

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Exception;
6+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
7+
use Illuminate\Auth\Access\AuthorizationException;
8+
use Spatie\Permission\Exceptions\UnauthorizedException;
9+
10+
class Handler extends ExceptionHandler
11+
{
12+
/**
13+
* A list of the exception types that are not reported.
14+
*
15+
* @var array
16+
*/
17+
protected $dontReport = [
18+
//
19+
];
20+
21+
/**
22+
* A list of the inputs that are never flashed for validation exceptions.
23+
*
24+
* @var array
25+
*/
26+
protected $dontFlash = [
27+
'password',
28+
'password_confirmation',
29+
];
30+
31+
/**
32+
* Report or log an exception.
33+
*
34+
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
35+
*
36+
* @param \Exception $exception
37+
* @return void
38+
*/
39+
public function report(Exception $exception)
40+
{
41+
parent::report($exception);
42+
}
43+
44+
/**
45+
* Render an exception into an HTTP response.
46+
*
47+
* @param \Illuminate\Http\Request $request
48+
* @param \Exception $exception
49+
* @return \Illuminate\Http\Response
50+
*/
51+
public function render($request, Exception $exception)
52+
{
53+
if ($exception instanceof AuthorizationException ||
54+
$exception instanceof UnauthorizedException) {
55+
abort(404, 'Page not found.');
56+
}
57+
return parent::render($request, $exception);
58+
}
59+
}

app/Filters/Filters.php

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
namespace App\Filters;
4+
5+
use Illuminate\Http\Request;
6+
7+
abstract class Filters
8+
{
9+
/**
10+
* @var Request
11+
*/
12+
protected $request;
13+
14+
/**
15+
* The Eloquent builder.
16+
*
17+
* @var \Illuminate\Database\Eloquent\Builder
18+
*/
19+
protected $builder;
20+
21+
/**
22+
* Registered filters to operate upon.
23+
*
24+
* @var array
25+
*/
26+
protected $filters = [];
27+
28+
/**
29+
* Create a new ThreadFilters instance.
30+
*
31+
* @param Request $request
32+
*/
33+
public function __construct(Request $request)
34+
{
35+
$this->request = $request;
36+
}
37+
38+
/**
39+
* Apply the filters.
40+
*
41+
* @param \Illuminate\Database\Eloquent\Builder $builder
42+
* @return \Illuminate\Database\Eloquent\Builder
43+
*/
44+
public function apply($builder)
45+
{
46+
$this->builder = $builder;
47+
48+
foreach ($this->getFilters() as $filter => $value) {
49+
if (method_exists($this, $filter)) {
50+
$this->$filter($value);
51+
}
52+
}
53+
54+
return $this->builder;
55+
}
56+
57+
/**
58+
* Fetch all relevant filters from the request.
59+
*
60+
* @return array
61+
*/
62+
public function getFilters()
63+
{
64+
return array_filter($this->request->only($this->filters));
65+
}
66+
}

app/Filters/ProjectFilters.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace App\Filters;
4+
5+
use App\User;
6+
use App\Status;
7+
use App\Filters\Filters;
8+
9+
class ProjectFilters extends Filters
10+
{
11+
/**
12+
* Registered filters to operate upon.
13+
*
14+
* @var array
15+
*/
16+
protected $filters = ['for','status'];
17+
18+
/**
19+
* Filter the query by a given username.
20+
*
21+
* @param string $username
22+
* @return \Illuminate\Database\Eloquent\Builder
23+
*/
24+
protected function for($username)
25+
{
26+
$user = User::where('name', $username)->firstOrFail();
27+
return $this->builder->where('client_id', $user->id);
28+
}
29+
30+
/**
31+
* Filter the query by a given status slug.
32+
*
33+
* @param string $username
34+
* @return \Illuminate\Database\Eloquent\Builder
35+
*/
36+
protected function status($slug)
37+
{
38+
$user = Status::where('slug', $slug)->firstOrFail();
39+
return $this->builder->where('status_id', $user->id);
40+
}
41+
}

app/Filters/TaskFilters.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace App\Filters;
4+
5+
use App\User;
6+
use App\Status;
7+
use App\Filters\Filters;
8+
9+
class TaskFilters extends Filters
10+
{
11+
/**
12+
* Registered filters to operate upon.
13+
*
14+
* @var array
15+
*/
16+
protected $filters = ['status'];
17+
18+
/**
19+
* Filter the query by a given status slug.
20+
*
21+
* @param string $username
22+
* @return \Illuminate\Database\Eloquent\Builder
23+
*/
24+
protected function status($slug)
25+
{
26+
$user = Status::where('slug', $slug)->firstOrFail();
27+
return $this->builder->where('status_id', $user->id);
28+
}
29+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7+
8+
class ForgotPasswordController extends Controller
9+
{
10+
/*
11+
|--------------------------------------------------------------------------
12+
| Password Reset Controller
13+
|--------------------------------------------------------------------------
14+
|
15+
| This controller is responsible for handling password reset emails and
16+
| includes a trait which assists in sending these notifications from
17+
| your application to your users. Feel free to explore this trait.
18+
|
19+
*/
20+
21+
use SendsPasswordResetEmails;
22+
23+
/**
24+
* Create a new controller instance.
25+
*
26+
* @return void
27+
*/
28+
public function __construct()
29+
{
30+
$this->middleware('guest');
31+
}
32+
}

0 commit comments

Comments
 (0)