Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasJez committed Jan 23, 2020
0 parents commit 9af24cb
Show file tree
Hide file tree
Showing 130 changed files with 23,008 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
44 changes: 44 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.idea
16 changes: 16 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
php:
preset: laravel
enabled:
- alpha_ordered_imports
disabled:
- length_ordered_imports
- unused_use
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A README is coming soon ...
34 changes: 34 additions & 0 deletions app/Activity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Activity extends Model
{
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function resource()
{
return $this->belongsTo('App\Resource');
}

/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function rule()
{
return $this->belongsTo('App\Rule');
}

/**
* @return string
* @throws \Exception
*/
public function getEndAttribute() {
return (new \DateTime($this->start))
->add(new \DateInterval('P' . $this->duration . 'D'))
->format('Y-m-d');
}
}
42 changes: 42 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];

/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}

/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
51 changes: 51 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
* Report or log an exception.
*
* @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
{
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}
}
12 changes: 12 additions & 0 deletions app/Ganttconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Ganttconfig extends Model
{
protected $table = 'ganttconfig';
public $incrementing = false;
protected $keyType = 'string';
}
75 changes: 75 additions & 0 deletions app/Http/Controllers/ActivityController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

namespace App\Http\Controllers;

use App\Ganttconfig;
use Illuminate\Http\Request;
use App\Activity;
use App\Term;
use App\Http\Resources\ResourcesCollection;
use Illuminate\Http\Response;

class ActivityController extends Controller
{
/**
* @param Activity $activity
* @return Activity
*/
public function show(Activity $activity)
{
return $activity;
}

/**
* @param Activity $activity
* @param Request $request
* @return \Illuminate\Http\JsonResponse
* @throws \Exception
*/
public function update(Activity $activity, Request $request)
{
$x = $request->get('x');
$activity->start = (new \DateTime(Ganttconfig::find('start')->value))
->add(new \DateInterval('P' . $x . 'D'))
->format('Y-m-d');
$activity->resource_id = $request->get('resourceId');
$activity->duration = $request->get('duration');
$activity->save();
return response()->json($activity, Response::HTTP_OK);
}

/**
* @param Request $request
* @return \Illuminate\Http\JsonResponse
* @throws \Exception
*/
public function store(Request $request)
{
$activity = new Activity();
$activity->id = $request->get('id');
$x = $request->get('x');
$activity->start = (new \DateTime(Ganttconfig::find('start')->value))
->add(new \DateInterval('P' . $x . 'D'))
->format('Y-m-d');
$activity->resource_id = $request->get('resourceId');
$activity->rule_id = $request->get('ruleId');
$activity->duration = $request->get('duration');
$activity->r = $request->get('r');
$activity->g = $request->get('g');;
$activity->b = $request->get('b');
$activity->save();
return response()->json($activity, Response::HTTP_CREATED);
}

/**
* @param Activity $activity
* @return \Illuminate\Http\JsonResponse
* @throws \Exception
*/
public function delete(Activity $activity)
{
$activity->delete();
return response()->json(null, Response::HTTP_NO_CONTENT);
}

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

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ConfirmsPasswords;

class ConfirmPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Confirm Password Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password confirmations and
| uses a simple trait to include the behavior. You're free to explore
| this trait and override any functions that require customization.
|
*/

use ConfirmsPasswords;

/**
* Where to redirect users when the intended url fails.
*
* @var string
*/
protected $redirectTo = '/home';

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

namespace App\Http\Controllers\Auth;

use App\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;
}
Loading

0 comments on commit 9af24cb

Please sign in to comment.