Browse Source

Initial Commit

merge-requests/1/head
Vincent Canfield 4 years ago
commit
60d8b42483
100 changed files with 13431 additions and 0 deletions
  1. 26
    0
      .env.example
  2. 3
    0
      .gitattributes
  3. 5
    0
      .gitignore
  4. 7
    0
      app/Commands/Command.php
  5. 32
    0
      app/Console/Commands/Inspire.php
  6. 29
    0
      app/Console/Kernel.php
  7. 16
    0
      app/Domain.php
  8. 9
    0
      app/Donation.php
  9. 7
    0
      app/Events/Event.php
  10. 42
    0
      app/Exceptions/Handler.php
  11. 9
    0
      app/Expense.php
  12. 0
    0
      app/Handlers/Commands/.gitkeep
  13. 0
    0
      app/Handlers/Events/.gitkeep
  14. 86
    0
      app/Http/Controllers/Auth/AuthController.php
  15. 38
    0
      app/Http/Controllers/Auth/PasswordController.php
  16. 11
    0
      app/Http/Controllers/Controller.php
  17. 76
    0
      app/Http/Controllers/DonationController.php
  18. 36
    0
      app/Http/Controllers/HomeController.php
  19. 48
    0
      app/Http/Controllers/UserController.php
  20. 53
    0
      app/Http/Controllers/WelcomeController.php
  21. 32
    0
      app/Http/Kernel.php
  22. 50
    0
      app/Http/Middleware/Authenticate.php
  23. 44
    0
      app/Http/Middleware/RedirectIfAuthenticated.php
  24. 20
    0
      app/Http/Middleware/VerifyCsrfToken.php
  25. 9
    0
      app/Http/Requests/Request.php
  26. 46
    0
      app/Http/routes.php
  27. 34
    0
      app/Providers/AppServiceProvider.php
  28. 34
    0
      app/Providers/BusServiceProvider.php
  29. 23
    0
      app/Providers/ConfigServiceProvider.php
  30. 32
    0
      app/Providers/EventServiceProvider.php
  31. 30
    0
      app/Providers/HasherServiceProvider.php
  32. 44
    0
      app/Providers/RouteServiceProvider.php
  33. 54
    0
      app/Services/Registrar.php
  34. 9
    0
      app/Testimonial.php
  35. 34
    0
      app/User.php
  36. 51
    0
      artisan
  37. 55
    0
      bootstrap/app.php
  38. 35
    0
      bootstrap/autoload.php
  39. 46
    0
      composer.json
  40. 3347
    0
      composer.lock
  41. 205
    0
      config/app.php
  42. 67
    0
      config/auth.php
  43. 79
    0
      config/cache.php
  44. 44
    0
      config/captcha.php
  45. 41
    0
      config/compile.php
  46. 125
    0
      config/database.php
  47. 71
    0
      config/filesystems.php
  48. 124
    0
      config/mail.php
  49. 92
    0
      config/queue.php
  50. 37
    0
      config/services.php
  51. 153
    0
      config/session.php
  52. 33
    0
      config/view.php
  53. 1
    0
      database/.gitignore
  54. 0
    0
      database/migrations/.gitkeep
  55. 36
    0
      database/migrations/2015_04_04_225928_create_users_table.php
  56. 34
    0
      database/migrations/2015_04_04_230948_add_donations_table.php
  57. 33
    0
      database/migrations/2015_05_03_164141_add_testimontials_table.php
  58. 33
    0
      database/migrations/2015_05_03_173033_create_domains_table.php
  59. 32
    0
      database/migrations/2015_05_03_181230_add_remember_token_to_users.php
  60. 32
    0
      database/migrations/2015_05_03_185715_add_public_field_to_domains.php
  61. 35
    0
      database/migrations/2015_05_03_211418_create_expenses_table.php
  62. 32
    0
      database/migrations/2015_05_03_212323_set_donation_uid_as_nullable.php
  63. 32
    0
      database/migrations/2015_05_03_213939_drop_donation_updated_column.php
  64. 32
    0
      database/migrations/2015_05_03_220303_make_expenses_stops_at_nullable.php
  65. 32
    0
      database/migrations/2016_01_31_162154_add_open_column_to_domains.php
  66. 0
    0
      database/seeds/.gitkeep
  67. 22
    0
      database/seeds/DatabaseSeeder.php
  68. 23
    0
      database/seeds/UserTableSeeder.php
  69. 16
    0
      gulpfile.js
  70. 7
    0
      package.json
  71. 5
    0
      phpspec.yml
  72. 23
    0
      phpunit.xml
  73. 15
    0
      public/.htaccess
  74. 6256
    0
      public/css/app.css
  75. 1
    0
      public/css/app.css.map
  76. 0
    0
      public/favicon.ico
  77. BIN
      public/fonts/glyphicons-halflings-regular.eot
  78. 288
    0
      public/fonts/glyphicons-halflings-regular.svg
  79. BIN
      public/fonts/glyphicons-halflings-regular.ttf
  80. BIN
      public/fonts/glyphicons-halflings-regular.woff
  81. BIN
      public/fonts/glyphicons-halflings-regular.woff2
  82. 278
    0
      public/img/cock.svg
  83. 101
    0
      public/img/donate/bitcoin.svg
  84. 147
    0
      public/img/donate/paypal.svg
  85. 60
    0
      public/img/donate/stripe.svg
  86. BIN
      public/img/stickers/circle-chen-label-large.png
  87. BIN
      public/img/stickers/circle-chen-label.png
  88. BIN
      public/img/stickers/circle-chen-large.png
  89. BIN
      public/img/stickers/circle-chen.png
  90. BIN
      public/img/stickers/duke-large.png
  91. BIN
      public/img/stickers/duke.png
  92. BIN
      public/img/xmpp-1.png
  93. BIN
      public/img/xmpp-2.png
  94. BIN
      public/img/xmpp-2w.png
  95. 57
    0
      public/index.php
  96. 2
    0
      public/robots.txt
  97. 23
    0
      readme.md
  98. 42
    0
      resources/assets/less/app.less
  99. 68
    0
      resources/assets/less/bootstrap/alerts.less
  100. 0
    0
      resources/assets/less/bootstrap/badges.less

+ 26
- 0
.env.example View File

@@ -0,0 +1,26 @@
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

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

D_BALANCE=0.0
D_DONATIONS=0.0
D_EXPENSES=1.0

L_BALANCE=0.0
L_DONATIONS=0.0
L_EXPENSES=1.0

+ 3
- 0
.gitattributes View File

@@ -0,0 +1,3 @@
* text=auto
*.css linguist-vendored
*.less linguist-vendored

+ 5
- 0
.gitignore View File

@@ -0,0 +1,5 @@
/vendor
/node_modules
/public/transparency
/public/donations
.env

+ 7
- 0
app/Commands/Command.php View File

@@ -0,0 +1,7 @@
<?php namespace App\Commands;

abstract class Command {

//

}

+ 32
- 0
app/Console/Commands/Inspire.php View File

@@ -0,0 +1,32 @@
<?php namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;

class Inspire extends Command {

/**
* The console command name.
*
* @var string
*/
protected $name = 'inspire';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Display an inspiring quote';

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
}

}

+ 29
- 0
app/Console/Kernel.php View File

@@ -0,0 +1,29 @@
<?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 = [
'App\Console\Commands\Inspire',
];

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

}

+ 16
- 0
app/Domain.php View File

@@ -0,0 +1,16 @@
<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Domain extends Model {

/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'domains';
protected $fillable = ['domain','public','open'];
public $timestamps = false;

}

+ 9
- 0
app/Donation.php View File

@@ -0,0 +1,9 @@
<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Donation extends Model {

public $timestamps = false;

}

+ 7
- 0
app/Events/Event.php View File

@@ -0,0 +1,7 @@
<?php namespace App\Events;

abstract class Event {

//

}

+ 42
- 0
app/Exceptions/Handler.php View File

@@ -0,0 +1,42 @@
<?php namespace App\Exceptions;

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

class Handler extends ExceptionHandler {

/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
];

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
return parent::report($e);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
return parent::render($request, $e);
}

}

+ 9
- 0
app/Expense.php View File

@@ -0,0 +1,9 @@
<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Expense extends Model {

//

}

+ 0
- 0
app/Handlers/Commands/.gitkeep View File


+ 0
- 0
app/Handlers/Events/.gitkeep View File


+ 86
- 0
app/Http/Controllers/Auth/AuthController.php View File

@@ -0,0 +1,86 @@
<?php namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use Illuminate\Http\Request;
use App\Domain;
use Mail;
use Auth;

class AuthController extends Controller {

/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/

use AuthenticatesAndRegistersUsers;

/**
* Create a new authentication controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\Registrar $registrar
* @return void
*/
public function __construct(Guard $auth, Registrar $registrar)
{
$this->auth = $auth;
$this->registrar = $registrar;
$this->redirectTo = "/user";

$this->middleware('guest', ['except' => 'getLogout']);
}

/**
* Show the application registration form.
*
* @return \Illuminate\Http\Response
*/
public function getRegister()
{
return view('auth.register')->with('domains', Domain::where('public',1)->where('open',1)->get());
}

/**
* Handle a registration request for the application.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function postRegister(Request $request)
{
$data = $request->all();

if(isset($data['username']) && isset($data['domain'])) {
$data['email'] = $data['username'] . '@' . $data['domain'];
$data['email'] = strtolower($data['email']);
}

$validator = $this->registrar->validator($data);

if ($validator->fails())
{
$this->throwValidationException(
$request, $validator
);
}

$this->auth->login($this->registrar->create($request->all()));

//Mail::send(['text' => 'emails.welcome'], ['username' => Auth::user()->email], function($message){
// $message->to(Auth::user()->email)->subject('Welcome to Cockmail!');
//});

return redirect($this->redirectPath());
}

}

+ 38
- 0
app/Http/Controllers/Auth/PasswordController.php View File

@@ -0,0 +1,38 @@
<?php namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\PasswordBroker;
use Illuminate\Foundation\Auth\ResetsPasswords;

class PasswordController 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;

/**
* Create a new password controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
* @return void
*/
public function __construct(Guard $auth, PasswordBroker $passwords)
{
$this->auth = $auth;
$this->passwords = $passwords;

$this->middleware('guest');
}

}

+ 11
- 0
app/Http/Controllers/Controller.php View File

@@ -0,0 +1,11 @@
<?php namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;

abstract class Controller extends BaseController {

use DispatchesCommands, ValidatesRequests;

}

+ 76
- 0
app/Http/Controllers/DonationController.php View File

@@ -0,0 +1,76 @@
<?php namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Carbon\Carbon;

use App\Donation;
use App\Expense;

class DonationController extends Controller {

/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
}

public static function calculate() {
$donations = [
"this" => [
"balance" => env('D_BALANCE',0.0),
"donations" => env('D_DONATIONS',0.0),
"expenses" => env('D_EXPENSES',1.0)
],
"last" => [
"balance" => env('L_BALANCE',0.0),
"donations" => env('L_DONATIONS',0.0),
"expenses" => env('L_EXPENSES',1.0)
]
];

return $donations;

$this_month = Carbon::now()->day(1)->hour(0)->minute(0)->second(0);
$last_month = Carbon::now()->subMonth()->day(1)->hour(0)->minute(0)->second(0);

$donations_this = Donation::where('created_at','>=',$this_month)->get();
$expenses_this = Expense::all();

$donations_upToLast = Donation::where('created_at','<',$last_month)->get();
$expenses_upToLast = Expense::where('effective_at','<',$last_month)->get();
$expenses_last = Expense::where('effective_at','<',$this_month)->get();
$donations_last = Donation::where('created_at','<',$this_month)->where('created_at','>=',$last_month)->get();

foreach($donations_upToLast as $donation)
$donations["last"]["balance"] += $donation->amount;

foreach($expenses_upToLast as $expense) {
$date = Carbon::parse($expense->effective_at);
$difference = $date->diffInMonths($last_month);

$donations["last"]["balance"] -= $expense->amount * $difference;
}

foreach($donations_last as $donation)
$donations["last"]["donations"] += $donation->amount;

foreach($expenses_last as $expense)
$donations["last"]["expenses"] += $expense->amount;

$donations["this"]["balance"] = $donations["last"]["balance"] - $donations["last"]["expenses"] + $donations["last"]["donations"];

foreach($donations_this as $donation)
$donations["this"]["donations"] += $donation->amount;

foreach($expenses_this as $expense)
$donations["this"]["expenses"] += $expense->amount;

return $donations;
}
}

+ 36
- 0
app/Http/Controllers/HomeController.php View File

@@ -0,0 +1,36 @@
<?php namespace App\Http\Controllers;

class HomeController extends Controller {

/*
|--------------------------------------------------------------------------
| Home Controller
|--------------------------------------------------------------------------
|
| This controller renders your application's "dashboard" for users that
| are authenticated. Of course, you are free to change or remove the
| controller as you wish. It is just here to get your app started!
|
*/

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

/**
* Show the application dashboard to the user.
*
* @return Response
*/
public function index()
{
return view('pages.user.home');
}

}

+ 48
- 0
app/Http/Controllers/UserController.php View File

@@ -0,0 +1,48 @@
<?php namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;

use Hash;
use Validator;
use Auth;

class UserController extends Controller {

public function __construct() {
$this->middleware('auth');
}
public function getIndex() {
return view('pages.user.home');
}

public function getChangepass() {
return view('pages.user.changepass');
}

public function postChangepass(Request $request) {
Validator::extend('passcheck', function ($attribute, $value, $parameters)
{
return Hash::check($value, Auth::user()->password);
});
$this->validate($request, [
'old_password' => 'required|passcheck',
'password' => 'required|confirmed|min:8|max:255',
],[
'old_password.passcheck' => 'The password you entered is incorrect',
'password.min' => 'Password must be 8-255 characters',
]);

$user = Auth::user();
$user->password = Hash::make($request->password);
$user->save();

return redirect('/user/changepass')->with('message','Your password has been changed!');
}

}

+ 53
- 0
app/Http/Controllers/WelcomeController.php View File

@@ -0,0 +1,53 @@
<?php namespace App\Http\Controllers;

use App\Domain;
use App\User;
use App\Testimonial;

class WelcomeController extends Controller {

/*
|--------------------------------------------------------------------------
| Welcome Controller
|--------------------------------------------------------------------------
|
| This controller renders the "marketing page" for the application and
| is configured to only allow guests. Like most of the other sample
| controllers, you are free to modify or remove it as you desire.
|
*/

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
}

/**
* Show the application welcome screen to the user.
*
* @return Response
*/
public function index()
{
$domains = [];
$total = 0;
foreach(Domain::where('public',1)->orderBy('open','DESC')->get() as $domain) {
$count = User::where('email','like',"%@{$domain->domain}")->count();
$domains[] = (object) [
'domain' => $domain->domain,
'count' => $count,
'open' => $domain->open
];
$total += $count;
}

$testimonial = Testimonial::orderByRaw('RAND()')->first();

return view('pages.welcome')->with('domains',$domains)->with('total',$total)->with('testimonial',$testimonial)->with('donations',DonationController::calculate());
}

}

+ 32
- 0
app/Http/Kernel.php View File

@@ -0,0 +1,32 @@
<?php namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel {

/**
* The application's global HTTP middleware stack.
*
* @var array
*/
protected $middleware = [
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Illuminate\Cookie\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
'Illuminate\View\Middleware\ShareErrorsFromSession',
'App\Http\Middleware\VerifyCsrfToken',
];

/**
* The application's route middleware.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => 'App\Http\Middleware\Authenticate',
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
];

}

+ 50
- 0
app/Http/Middleware/Authenticate.php View File

@@ -0,0 +1,50 @@
<?php namespace App\Http\Middleware;

use Closure;
use Illuminate\Contracts\Auth\Guard;

class Authenticate {

/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;

/**
* Create a new filter instance.
*
* @param Guard $auth
* @return void
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}

/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->auth->guest())
{
if ($request->ajax())
{
return response('Unauthorized.', 401);
}
else
{
return redirect()->guest('auth/login');
}
}

return $next($request);
}

}

+ 44
- 0
app/Http/Middleware/RedirectIfAuthenticated.php View File

@@ -0,0 +1,44 @@
<?php namespace App\Http\Middleware;

use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\RedirectResponse;

class RedirectIfAuthenticated {

/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;

/**
* Create a new filter instance.
*
* @param Guard $auth
* @return void
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}

/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->auth->check())
{
return new RedirectResponse(url('/user/home'));
}

return $next($request);
}

}

+ 20
- 0
app/Http/Middleware/VerifyCsrfToken.php View File

@@ -0,0 +1,20 @@
<?php namespace App\Http\Middleware;

use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

class VerifyCsrfToken extends BaseVerifier {

/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
return parent::handle($request, $next);
}

}

+ 9
- 0
app/Http/Requests/Request.php View File

@@ -0,0 +1,9 @@
<?php namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

abstract class Request extends FormRequest {

//

}

+ 46
- 0
app/Http/routes.php View File

@@ -0,0 +1,46 @@
<?php
use App\Http\Controllers;

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', 'WelcomeController@index');

Route::get('/server', function() {
return view('pages.server');
});

Route::get('/mailinglist', function() {
return view('pages.mailinglist');
});

Route::get('/xmpp', function() {
return view('pages.xmpp');
});

Route::get('/donate', function() {
return view('pages.donate')->with('donations',App\Http\Controllers\DonationController::calculate());;
});

Route::get('/tos', function() {
return view('pages.tos');
});

Route::get('/abuse', function() {
return view('pages.abuse');
});

Route::get('/privacy', function() {
return view('pages.privacy');
});

Route::controller('auth','Auth\AuthController');
Route::controller('user','UserController');

+ 34
- 0
app/Providers/AppServiceProvider.php View File

@@ -0,0 +1,34 @@
<?php namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider {

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}

/**
* Register any application services.
*
* This service provider is a great spot to register your various container
* bindings with the application. As you can see, we are registering our
* "Registrar" implementation here. You can add your own bindings too!
*
* @return void
*/
public function register()
{
$this->app->bind(
'Illuminate\Contracts\Auth\Registrar',
'App\Services\Registrar'
);
}

}

+ 34
- 0
app/Providers/BusServiceProvider.php View File

@@ -0,0 +1,34 @@
<?php namespace App\Providers;

use Illuminate\Bus\Dispatcher;
use Illuminate\Support\ServiceProvider;

class BusServiceProvider extends ServiceProvider {

/**
* Bootstrap any application services.
*
* @param \Illuminate\Bus\Dispatcher $dispatcher
* @return void
*/
public function boot(Dispatcher $dispatcher)
{
$dispatcher->mapUsing(function($command)
{
return Dispatcher::simpleMapping(
$command, 'App\Commands', 'App\Handlers\Commands'
);
});
}

/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}

}

+ 23
- 0
app/Providers/ConfigServiceProvider.php View File

@@ -0,0 +1,23 @@
<?php namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class ConfigServiceProvider extends ServiceProvider {

/**
* Overwrite any vendor / package configuration.
*
* This service provider is intended to provide a convenient location for you
* to overwrite any "vendor" or package configuration that you may want to
* modify before the application handles the incoming request / command.
*
* @return void
*/
public function register()
{
config([
//
]);
}

}

+ 32
- 0
app/Providers/EventServiceProvider.php View File

@@ -0,0 +1,32 @@
<?php namespace App\Providers;

use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider {

/**
* The event handler mappings for the application.
*
* @var array
*/
protected $listen = [
'event.name' => [
'EventListener',
],
];

/**
* Register any other events for your application.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function boot(DispatcherContract $events)
{
parent::boot($events);

//
}

}

+ 30
- 0
app/Providers/HasherServiceProvider.php View File

@@ -0,0 +1,30 @@
<?php namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Services\CustomHasher;

class HasherServiceProvider extends ServiceProvider {

/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
}

/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->bind('hash', function() {
return new CustomHasher();
});
}

}

+ 44
- 0
app/Providers/RouteServiceProvider.php View File

@@ -0,0 +1,44 @@
<?php namespace App\Providers;

use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

class RouteServiceProvider extends ServiceProvider {

/**
* This namespace is applied to the controller routes in your routes file.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';

/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
parent::boot($router);

//
}

/**
* Define the routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function map(Router $router)
{
$router->group(['namespace' => $this->namespace], function($router)
{
require app_path('Http/routes.php');
});
}

}

+ 54
- 0
app/Services/Registrar.php View File

@@ -0,0 +1,54 @@
<?php namespace App\Services;

use App\User;
use Validator;
use Carbon\Carbon;
use Illuminate\Contracts\Auth\Registrar as RegistrarContract;

class Registrar implements RegistrarContract {

/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
public function validator(array $data)
{
Validator::extend('floodprotection', function ($attribute, $value, $parameters)
{
$time = Carbon::now()->subDay();
return User::where('registered_ip',$_SERVER['REMOTE_ADDR'])->where('created_at','>=',$time)->count() < 5;
});

return Validator::make($data, [
'username' => ['required','regex:/^[0-9a-zA-Z]{1,32}$/'],
'email' => 'required|floodprotection|email|unique:users',
'domain' => 'required|exists:domains,domain,public,1,open,1',
'password' => 'required|confirmed|min:8|max:255',
'captcha' => 'required|captcha'
], [
'username.regex' => 'Username invalid. 1-32 characters, 0-9, a-z, A-Z allowed.',
'email.floodprotection' => 'Registration is limited to 5 accounts per 24 hours',
'captcha' => 'Captcha incorrect',
'password.min' => 'Password must be 8-255 characters',
'domain.exists' => 'You tried to register with a non-existant domain.',
]);
}

/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
public function create(array $data)
{
return User::create([
'email' => $data['username'] . '@' . $data['domain'],
'password' => bcrypt($data['password']),
'registered_ip' => $_SERVER['REMOTE_ADDR'],
]);
}

}

+ 9
- 0
app/Testimonial.php View File

@@ -0,0 +1,9 @@
<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Testimonial extends Model {

protected $table = "testimonials";

}

+ 34
- 0
app/User.php View File

@@ -0,0 +1,34 @@
<?php namespace App;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;

class User extends Model implements AuthenticatableContract {

use Authenticatable;

/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';

/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['email', 'password','registered_ip','created_at','updated_at','disabled'];

/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];

public $timestamps = false;

}

+ 51
- 0
artisan View File

@@ -0,0 +1,51 @@
#!/usr/bin/env php
<?php

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/

require __DIR__.'/bootstrap/autoload.php';

$app = require_once __DIR__.'/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/

$kernel = $app->make('Illuminate\Contracts\Console\Kernel');

$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);

/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running. We will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/

$kernel->terminate($input, $status);

exit($status);

+ 55
- 0
bootstrap/app.php View File

@@ -0,0 +1,55 @@
<?php

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/

$app = new Illuminate\Foundation\Application(
realpath(__DIR__.'/../')
);

/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/

$app->singleton(
'Illuminate\Contracts\Http\Kernel',
'App\Http\Kernel'
);

$app->singleton(
'Illuminate\Contracts\Console\Kernel',
'App\Console\Kernel'
);

$app->singleton(
'Illuminate\Contracts\Debug\ExceptionHandler',
'App\Exceptions\Handler'
);

/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/

return $app;

+ 35
- 0
bootstrap/autoload.php View File

@@ -0,0 +1,35 @@
<?php

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/

require __DIR__.'/../vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Include The Compiled Class File
|--------------------------------------------------------------------------
|
| To dramatically increase your application's performance, you may use a
| compiled class file which contains all of the classes commonly used
| by a request. The Artisan "optimize" is used to create this file.
|
*/

$compiledPath = __DIR__.'/../storage/framework/compiled.php';

if (file_exists($compiledPath))
{
require $compiledPath;
}

+ 46
- 0
composer.json View File

@@ -0,0 +1,46 @@
{
"name": "vc/cock.li",
"description": "Website for cock.li",
"keywords": ["cocks"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*",
"doctrine/dbal": "~2.3",
"mews/captcha": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}

+ 3347
- 0
composer.lock
File diff suppressed because it is too large
View File


+ 205
- 0
config/app.php View File

@@ -0,0 +1,205 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/

'debug' => env('APP_DEBUG'),

/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/

'url' => 'http://localhost',

/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/

'timezone' => 'America/New_York',

/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/

'locale' => 'en',

/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/

'fallback_locale' => 'en',

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/

'key' => env('APP_KEY', 'SomeRandomString'),

'cipher' => MCRYPT_RIJNDAEL_128,

/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog", "errorlog"
|
*/

'log' => 'daily',

/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/

'providers' => [

/*
* Laravel Framework Service Providers...
*/
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',
'Illuminate\Filesystem\FilesystemServiceProvider',
'Illuminate\Foundation\Providers\FoundationServiceProvider',
//'Illuminate\Hashing\HashServiceProvider',
'App\Providers\HasherServiceProvider',
'Illuminate\Mail\MailServiceProvider',
'Illuminate\Pagination\PaginationServiceProvider',
'Illuminate\Pipeline\PipelineServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
'Illuminate\Redis\RedisServiceProvider',
'Illuminate\Auth\Passwords\PasswordResetServiceProvider',
'Illuminate\Session\SessionServiceProvider',
'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',

/*
* Application Service Providers...
*/
'App\Providers\AppServiceProvider',
'App\Providers\BusServiceProvider',
'App\Providers\ConfigServiceProvider',
'App\Providers\EventServiceProvider',
'App\Providers\RouteServiceProvider',

/*
* Custom Service Providers
*/
'Mews\Captcha\CaptchaServiceProvider',

],

/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/

'aliases' => [

'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
'Auth' => 'Illuminate\Support\Facades\Auth',
'Blade' => 'Illuminate\Support\Facades\Blade',
'Bus' => 'Illuminate\Support\Facades\Bus',
'Cache' => 'Illuminate\Support\Facades\Cache',
'Config' => 'Illuminate\Support\Facades\Config',
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event',
'File' => 'Illuminate\Support\Facades\File',
'Hash' => 'Illuminate\Support\Facades\Hash',
'Input' => 'Illuminate\Support\Facades\Input',
'Inspiring' => 'Illuminate\Foundation\Inspiring',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Session' => 'Illuminate\Support\Facades\Session',
'Storage' => 'Illuminate\Support\Facades\Storage',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'Captcha' => 'Mews\Captcha\Facades\Captcha',

],

];

+ 67
- 0
config/auth.php View File

@@ -0,0 +1,67 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
| This driver manages the retrieval and authentication of the users
| attempting to get access to protected areas of your application.
|
| Supported: "database", "eloquent"
|
*/

'driver' => 'eloquent',

/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/

'model' => 'App\User',

/*
|--------------------------------------------------------------------------
| Authentication Table
|--------------------------------------------------------------------------
|
| When using the "Database" authentication driver, we need to know which
| table should be used to retrieve your users. We have chosen a basic
| default value but you may easily change it to any table you like.
|
*/

'table' => 'users',

/*
|--------------------------------------------------------------------------
| Password Reset Settings
|--------------------------------------------------------------------------
|
| Here you may set the options for resetting passwords including the view
| that is your password reset e-mail. You can also set the name of the
| table that maintains all of the reset tokens for your application.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/

'password' => [
'email' => 'emails.password',
'table' => 'password_resets',
'expire' => 60,
],

];

+ 79
- 0
config/cache.php View File

@@ -0,0 +1,79 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
*/

'default' => env('CACHE_DRIVER', 'file'),

/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
*/

'stores' => [

'apc' => [
'driver' => 'apc'
],

'array' => [
'driver' => 'array'
],

'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],

'file' => [
'driver' => 'file',
'path' => storage_path().'/framework/cache',
],

'memcached' => [
'driver' => 'memcached',
'servers' => [
[
'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100
],
],
],

'redis' => [
'driver' => 'redis',
'connection' => 'default',
],

],

/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/

'prefix' => 'laravel',

];

+ 44
- 0
config/captcha.php View File

@@ -0,0 +1,44 @@
<?php

return [

'default' => [
'length' => 5,
'width' => 120,
'height' => 36,
'quality' => 90,
'fontColors'=> ['#000000','#003300','#330000','#000033'],
],

'flat' => [
'length' => 6,
'width' => 160,
'height' => 46,
'quality' => 90,
'lines' => 6,
'bgImage' => false,
'bgColor' => '#ecf2f4',
//'fontColors'=> ['#2c3e50', '#c0392b', '#16a085', '#c0392b', '#8e44ad', '#303f9f', '#f57c00', '#795548'],
'contrast' => -5,
],

'mini' => [
'length' => 3,
'width' => 60,
'height' => 32,
],

'inverse' => [
'length' => 5,
'width' => 120,
'height' => 36,
'quality' => 90,
'sensitive' => true,
'angle' => 12,
'sharpen' => 10,
'blur' => 2,
'invert' => true,
'contrast' => -5,
]

];

+ 41
- 0
config/compile.php View File

@@ -0,0 +1,41 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Additional Compiled Classes
|--------------------------------------------------------------------------
|
| Here you may specify additional classes to include in the compiled file
| generated by the `artisan optimize` command. These should be classes
| that are included on basically every request into the application.
|
*/

'files' => [

realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'),
realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'),
realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'),
realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'),
realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'),

],

/*
|--------------------------------------------------------------------------
| Compiled File Providers
|--------------------------------------------------------------------------
|
| Here you may list service providers which define a "compiles" function
| that returns additional files that should be compiled, providing an
| easy way to get common files from any packages you are utilizing.
|
*/

'providers' => [
//
],

];

+ 125
- 0
config/database.php View File

@@ -0,0 +1,125 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/

'fetch' => PDO::FETCH_CLASS,

/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/

'default' => 'mysql',

/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/

'connections' => [

'sqlite' => [
'driver' => 'sqlite',
'database' => storage_path().'/database.sqlite',
'prefix' => '',
],

'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'cockli'),
'username' => env('DB_USERNAME', 'homestead'),
'password' => env('DB_PASSWORD', 'secret'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],

'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],

'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'prefix' => '',
],

],

/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/

'migrations' => 'migrations',

/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/

'redis' => [

'cluster' => false,

'default' => [
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
],

],

];

+ 71
- 0
config/filesystems.php View File

@@ -0,0 +1,71 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. A "local" driver, as well as a variety of cloud
| based drivers are available for your choosing. Just store away!
|
| Supported: "local", "s3", "rackspace"
|
*/

'default' => 'local',

/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/

'cloud' => 's3',

/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
*/

'disks' => [

'local' => [
'driver' => 'local',
'root' => storage_path().'/app',
],

's3' => [
'driver' => 's3',
'key' => 'your-key',
'secret' => 'your-secret',
'region' => 'your-region',
'bucket' => 'your-bucket',
],

'rackspace' => [
'driver' => 'rackspace',
'username' => 'your-username',
'key' => 'your-key',
'container' => 'your-container',
'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
'region' => 'IAD',
'url_type' => 'publicURL'
],

],

];

+ 124
- 0
config/mail.php View File

@@ -0,0 +1,124 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log"
|
*/

'driver' => env('MAIL_DRIVER', 'smtp'),

/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/

'host' => env('MAIL_HOST', 'mail.cock.li'),

/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/

'port' => env('MAIL_PORT', 587),

/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/

'from' => ['address' => 'vc@cock.li', 'name' => 'Vincent Canfield'],

/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/

'encryption' => 'tls',

/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/

'username' => env('MAIL_USERNAME'),

/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/

'password' => env('MAIL_PASSWORD'),

/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/

'sendmail' => '/usr/sbin/sendmail -bs',

/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/

'pretend' => false,

];

+ 92
- 0
config/queue.php View File

@@ -0,0 +1,92 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Queue Driver
|--------------------------------------------------------------------------
|
| The Laravel queue API supports a variety of back-ends via an unified
| API, giving you convenient access to each back-end using the same
| syntax for each one. Here you may set the default queue driver.
|
| Supported: "null", "sync", "database", "beanstalkd",
| "sqs", "iron", "redis"
|
*/

'default' => env('QUEUE_DRIVER', 'sync'),