Skip to content

Commit

Permalink
first stable version
Browse files Browse the repository at this point in the history
  • Loading branch information
aocneanu committed Jun 24, 2017
0 parents commit 3e52820
Show file tree
Hide file tree
Showing 185 changed files with 118,798 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
33 changes: 33 additions & 0 deletions .env.example
@@ -0,0 +1,33 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

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

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
5 changes: 5 additions & 0 deletions .gitattributes
@@ -0,0 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
11 changes: 11 additions & 0 deletions .gitignore
@@ -0,0 +1,11 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
.env
34 changes: 34 additions & 0 deletions README.md
@@ -0,0 +1,34 @@
# Laravel Enso
[![Total Downloads](https://poser.pugx.org/laravel-enso/enso/downloads)](https://packagist.org/packages/laravel-enso/enso)
[![Latest Stable Version](https://poser.pugx.org/laravel-enso/enso/version)](https://packagist.org/packages/laravel-enso/enso)

demo *soon*

### Installation Steps

1. Download the project with `git clone https://github.com/laravel-enso/Enso.git`

2. Run in the project folder `composer install`

3. Configure `.env` file. Run `php artisan key:generate`

4. Run `php artisan migrate`

5. Publish the needed assets with:

```
art vendor:publish --tag=core-storage`
art vendor:publish --tag=avatars-storage
```

6. Setup the `config/laravel-enso.php` file

7. (optional) `npm install` / `npm run dev`

8. Login into the project with user: `admin@login.com`, password: `password`

9. Enjoy

### Contributions

are welcome
23 changes: 23 additions & 0 deletions app/Console/Kernel.php
@@ -0,0 +1,23 @@
<?php

namespace App\Console;

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

class Kernel extends ConsoleKernel
{
protected $commands = [
//
];

protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
}

protected function commands()
{
require base_path('routes/console.php');
}
}
44 changes: 44 additions & 0 deletions app/Exceptions/Handler.php
@@ -0,0 +1,44 @@
<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use LaravelEnso\Core\app\Exceptions\EnsoHandler;

class Handler extends ExceptionHandler
{
protected $dontReport = [
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
\LaravelEnso\Core\app\Exceptions\EnsoException::class
];

public function report(Exception $exception)
{
parent::report($exception);
}

public function render($request, Exception $exception)
{
if ($exception instanceof \EnsoException) {
return (new EnsoHandler($exception))->render();
}

return parent::render($request, $exception);
}

protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}

return redirect()->guest('login');
}
}
16 changes: 16 additions & 0 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
@@ -0,0 +1,16 @@
<?php

namespace App\Http\Controllers\Auth;

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

class ForgotPasswordController extends Controller
{
use SendsPasswordResetEmails;

public function __construct()
{
$this->middleware('guest');
}
}
18 changes: 18 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
@@ -0,0 +1,18 @@
<?php

namespace App\Http\Controllers\Auth;

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

class LoginController extends Controller
{
use AuthenticatesUsers;

protected $redirectTo = '/';

public function __construct()
{
$this->middleware('guest')->except('logout');
}
}
29 changes: 29 additions & 0 deletions app/Http/Controllers/Auth/RegisterController.php
@@ -0,0 +1,29 @@
<?php

namespace App\Http\Controllers\Auth;

use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;

class RegisterController extends Controller
{
use RegistersUsers;

protected $redirectTo = '/';

public function __construct()
{
$this->middleware('guest');
}

protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
]);
}
}
18 changes: 18 additions & 0 deletions app/Http/Controllers/Auth/ResetPasswordController.php
@@ -0,0 +1,18 @@
<?php

namespace App\Http\Controllers\Auth;

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

class ResetPasswordController extends Controller
{
use ResetsPasswords;

protected $redirectTo = '/';

public function __construct()
{
$this->middleware('guest');
}
}
13 changes: 13 additions & 0 deletions app/Http/Controllers/Controller.php
@@ -0,0 +1,13 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
108 changes: 108 additions & 0 deletions app/Http/Controllers/DashboardController.php
@@ -0,0 +1,108 @@
<?php

namespace App\Http\Controllers;

use LaravelEnso\Charts\app\Classes\BarChart;
use LaravelEnso\Charts\app\Classes\BubbleChart;
use LaravelEnso\Charts\app\Classes\LineChart;
use LaravelEnso\Charts\app\Classes\PieChart;
use LaravelEnso\Charts\app\Classes\RadarChart;

class DashboardController extends Controller
{
public function index()
{
$preferences = json_encode(request()->user()->preferences->local->dashboard);

return view('dashboard.index', compact('preferences'));
}

public function getLineChartData()
{
$labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];

$datasets = [

'Sales' => [65, 59, 80, 81, 56, 55, 40],
'Revenue' => [15, 29, 60, 31, 26, 45, 44],
];

$chart = new LineChart($labels, $datasets);

return $chart->getResponse();
}

public function getBarChartData()
{
$labels = ['Ian', 'Feb', 'Mar'];

$datasets = [

'Vanzari' => [1233, 1231, 3123],
'Incasari' => [1250, 1730, 5300],
'Profit' => [1250 - 1233, 1730 - 1231, 5300 - 3123],
];

$chart = new BarChart($labels, $datasets);

return $chart->getResponse();
}

public function getPieChartData()
{
$labels = ['Green', 'Red', 'Azzure'];

$datasets = [400, 50, 100];

$chart = new PieChart($labels, $datasets);

return $chart->getResponse();
}

public function getRadarChartData()
{
$labels = ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'];

$datasets = [

'2005' => [65, 59, 90, 81, 56, 55, 40],
'2006' => [28, 48, 40, 19, 96, 27, 100],
];

$chart = new RadarChart($labels, $datasets);

return $chart->getResponse();
}

public function getPolarChartData()
{
$labels = ['Green', 'Red', 'Azzure', 'Portocaliu', 'Bleu'];

$datasets = [11, 16, 7, 14, 14];

$chart = new PieChart($labels, $datasets);

return $chart->getResponse();
}

public function getBubbleChartData()
{
$labels = [

0 => 'Geneva',
1 => 'Besel',
2 => 'Bucharest',
];

$datasets = [

0 => [[2010, 59, 4800], [2011, 55, 1800], [2012, 45, 2000], [2013, 58, 4400], [2014, 42, 2900], [2015, 59, 2100]],
1 => [[2010, 48, 1700], [2011, 67, 1200], [2012, 96, 1233], [2013, 35, 3000], [2014, 45, 2000], [2015, 52, 3300]],
2 => [[2010, 44, 2000], [2011, 62, 1500], [2012, 55, 1299], [2013, 39, 4000], [2014, 36, 1000], [2015, 45, 1750]],
];

$chart = new BubbleChart($labels, $datasets);

return $chart->getResponse();
}
}

0 comments on commit 3e52820

Please sign in to comment.