Skip to content

Commit c6c09c0

Browse files
committed
Migrations updated with Models
0 parents  commit c6c09c0

File tree

162 files changed

+20333
-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.

162 files changed

+20333
-0
lines changed

.env.example

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
APP_ENV=local
2+
APP_DEBUG=true
3+
APP_KEY=SomeRandomString
4+
5+
DB_HOST=localhost
6+
DB_DATABASE=homestead
7+
DB_USERNAME=homestead
8+
DB_PASSWORD=secret
9+
10+
CACHE_DRIVER=file
11+
SESSION_DRIVER=file
12+
QUEUE_DRIVER=sync
13+
14+
MAIL_DRIVER=smtp
15+
MAIL_HOST=mailtrap.io
16+
MAIL_PORT=2525
17+
MAIL_USERNAME=null
18+
MAIL_PASSWORD=null

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.less linguist-vendored

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/vendor
2+
/node_modules
3+
.env

app/Business.php

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php namespace App;
2+
3+
use Illuminate\Database\Eloquent\Model;
4+
5+
class Business extends Model {
6+
7+
//
8+
9+
}

app/Commands/Command.php

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php namespace App\Commands;
2+
3+
abstract class Command {
4+
5+
//
6+
7+
}

app/Console/Commands/Inspire.php

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php namespace App\Console\Commands;
2+
3+
use Illuminate\Console\Command;
4+
use Illuminate\Foundation\Inspiring;
5+
6+
class Inspire extends Command {
7+
8+
/**
9+
* The console command name.
10+
*
11+
* @var string
12+
*/
13+
protected $name = 'inspire';
14+
15+
/**
16+
* The console command description.
17+
*
18+
* @var string
19+
*/
20+
protected $description = 'Display an inspiring quote';
21+
22+
/**
23+
* Execute the console command.
24+
*
25+
* @return mixed
26+
*/
27+
public function handle()
28+
{
29+
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
30+
}
31+
32+
}

app/Console/Kernel.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php namespace App\Console;
2+
3+
use Illuminate\Console\Scheduling\Schedule;
4+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
5+
6+
class Kernel extends ConsoleKernel {
7+
8+
/**
9+
* The Artisan commands provided by your application.
10+
*
11+
* @var array
12+
*/
13+
protected $commands = [
14+
'App\Console\Commands\Inspire',
15+
];
16+
17+
/**
18+
* Define the application's command schedule.
19+
*
20+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
21+
* @return void
22+
*/
23+
protected function schedule(Schedule $schedule)
24+
{
25+
$schedule->command('inspire')
26+
->hourly();
27+
}
28+
29+
}

app/Events/Event.php

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php namespace App\Events;
2+
3+
abstract class Event {
4+
5+
//
6+
7+
}

app/Exceptions/Handler.php

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php namespace App\Exceptions;
2+
3+
use Exception;
4+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
5+
6+
class Handler extends ExceptionHandler {
7+
8+
/**
9+
* A list of the exception types that should not be reported.
10+
*
11+
* @var array
12+
*/
13+
protected $dontReport = [
14+
'Symfony\Component\HttpKernel\Exception\HttpException'
15+
];
16+
17+
/**
18+
* Report or log an exception.
19+
*
20+
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
21+
*
22+
* @param \Exception $e
23+
* @return void
24+
*/
25+
public function report(Exception $e)
26+
{
27+
return parent::report($e);
28+
}
29+
30+
/**
31+
* Render an exception into an HTTP response.
32+
*
33+
* @param \Illuminate\Http\Request $request
34+
* @param \Exception $e
35+
* @return \Illuminate\Http\Response
36+
*/
37+
public function render($request, Exception $e)
38+
{
39+
return parent::render($request, $e);
40+
}
41+
42+
}

app/Handlers/Commands/.gitkeep

Whitespace-only changes.

app/Handlers/Events/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php namespace App\Http\Controllers\Auth;
2+
3+
use App\Http\Controllers\Controller;
4+
use Illuminate\Contracts\Auth\Guard;
5+
use Illuminate\Contracts\Auth\Registrar;
6+
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
7+
use Illuminate\Http\Request;
8+
use App\User;
9+
10+
class AuthController extends Controller {
11+
12+
/*
13+
|--------------------------------------------------------------------------
14+
| Registration & Login Controller
15+
|--------------------------------------------------------------------------
16+
|
17+
| This controller handles the registration of new users, as well as the
18+
| authentication of existing users. By default, this controller uses
19+
| a simple trait to add these behaviors. Why don't you explore it?
20+
|
21+
*/
22+
23+
use AuthenticatesAndRegistersUsers;
24+
25+
/**
26+
* Create a new authentication controller instance.
27+
*
28+
* @param \Illuminate\Contracts\Auth\Guard $auth
29+
* @param \Illuminate\Contracts\Auth\Registrar $registrar
30+
* @return void
31+
*/
32+
public function __construct(Guard $auth, Registrar $registrar)
33+
{
34+
$this->auth = $auth;
35+
$this->registrar = $registrar;
36+
37+
$this->middleware('guest', ['except' => 'getLogout']);
38+
}
39+
40+
public function postLogin(Request $request)
41+
{
42+
$this->validate($request, [
43+
'email' => 'required|email', 'password' => 'required',
44+
]);
45+
46+
$credentials = $request->only('email', 'password');
47+
48+
return $this->loginUser($credentials);
49+
}
50+
51+
private function loginUser($credentials){
52+
$model = User::where('email', $credentials['email'])->first();
53+
if(isset($model)){
54+
if($model['password'] == base64_encode($credentials['password'])){
55+
$this->auth->login($model);
56+
return redirect($this->redirectPath());
57+
}else{
58+
return redirect($this->loginPath())
59+
->withInput($credentials)
60+
->withErrors([
61+
'email' => $this->getFailedLoginMessage(),
62+
]);
63+
}
64+
}else{
65+
return redirect($this->loginPath())
66+
->withInput($credentials)
67+
->withErrors([
68+
'email' => $this->getFailedLoginMessage(),
69+
]);
70+
}
71+
}
72+
73+
public function redirectPath()
74+
{
75+
if (property_exists($this, 'redirectPath'))
76+
{
77+
return $this->redirectPath;
78+
}
79+
80+
return property_exists($this, 'redirectTo') ? $this->redirectTo : '/';
81+
}
82+
83+
84+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php namespace App\Http\Controllers\Auth;
2+
3+
use App\Http\Controllers\Controller;
4+
use Illuminate\Contracts\Auth\Guard;
5+
use Illuminate\Contracts\Auth\PasswordBroker;
6+
use Illuminate\Foundation\Auth\ResetsPasswords;
7+
8+
class PasswordController extends Controller {
9+
10+
/*
11+
|--------------------------------------------------------------------------
12+
| Password Reset Controller
13+
|--------------------------------------------------------------------------
14+
|
15+
| This controller is responsible for handling password reset requests
16+
| and uses a simple trait to include this behavior. You're free to
17+
| explore this trait and override any methods you wish to tweak.
18+
|
19+
*/
20+
21+
use ResetsPasswords;
22+
23+
/**
24+
* Create a new password controller instance.
25+
*
26+
* @param \Illuminate\Contracts\Auth\Guard $auth
27+
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
28+
* @return void
29+
*/
30+
public function __construct(Guard $auth, PasswordBroker $passwords)
31+
{
32+
$this->auth = $auth;
33+
$this->passwords = $passwords;
34+
35+
$this->middleware('guest');
36+
}
37+
38+
}

app/Http/Controllers/Controller.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php namespace App\Http\Controllers;
2+
3+
use Illuminate\Foundation\Bus\DispatchesCommands;
4+
use Illuminate\Routing\Controller as BaseController;
5+
use Illuminate\Foundation\Validation\ValidatesRequests;
6+
7+
abstract class Controller extends BaseController {
8+
9+
use DispatchesCommands, ValidatesRequests;
10+
11+
}
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php namespace App\Http\Controllers;
2+
3+
class HomeController extends Controller {
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Home Controller
8+
|--------------------------------------------------------------------------
9+
|
10+
| This controller renders your application's "dashboard" for users that
11+
| are authenticated. Of course, you are free to change or remove the
12+
| controller as you wish. It is just here to get your app started!
13+
|
14+
*/
15+
16+
/**
17+
* Create a new controller instance.
18+
*
19+
* @return void
20+
*/
21+
public function __construct()
22+
{
23+
$this->middleware('auth');
24+
}
25+
26+
/**
27+
* Show the application dashboard to the user.
28+
*
29+
* @return Response
30+
*/
31+
public function index()
32+
{
33+
return view('home');
34+
}
35+
36+
}
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php namespace App\Http\Controllers;
2+
3+
class WelcomeController extends Controller {
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Welcome Controller
8+
|--------------------------------------------------------------------------
9+
|
10+
| This controller renders the "marketing page" for the application and
11+
| is configured to only allow guests. Like most of the other sample
12+
| controllers, you are free to modify or remove it as you desire.
13+
|
14+
*/
15+
16+
/**
17+
* Create a new controller instance.
18+
*
19+
* @return void
20+
*/
21+
public function __construct()
22+
{
23+
$this->middleware('guest');
24+
}
25+
26+
/**
27+
* Show the application welcome screen to the user.
28+
*
29+
* @return Response
30+
*/
31+
public function index()
32+
{
33+
return view('welcome');
34+
}
35+
36+
}

0 commit comments

Comments
 (0)