aboutsummaryrefslogtreecommitdiff
path: root/backyard/php-api/trunk/app/Http/Controllers
diff options
context:
space:
mode:
authorCamil Staps2015-02-16 23:48:05 +0100
committerCamil Staps2015-02-16 23:48:05 +0100
commitd7e113be4a56fa5aac3680fb5363168f545e5bce (patch)
tree811fa270a3e3a0bc5d37abc82468a2c8eae58081 /backyard/php-api/trunk/app/Http/Controllers
parentUpdated readme (diff)
Added PHP API framework
Diffstat (limited to 'backyard/php-api/trunk/app/Http/Controllers')
-rw-r--r--backyard/php-api/trunk/app/Http/Controllers/Auth/AuthController.php38
-rw-r--r--backyard/php-api/trunk/app/Http/Controllers/Auth/PasswordController.php38
-rw-r--r--backyard/php-api/trunk/app/Http/Controllers/Controller.php11
-rw-r--r--backyard/php-api/trunk/app/Http/Controllers/HomeController.php36
-rw-r--r--backyard/php-api/trunk/app/Http/Controllers/WelcomeController.php36
5 files changed, 159 insertions, 0 deletions
diff --git a/backyard/php-api/trunk/app/Http/Controllers/Auth/AuthController.php b/backyard/php-api/trunk/app/Http/Controllers/Auth/AuthController.php
new file mode 100644
index 0000000..4ad5c58
--- /dev/null
+++ b/backyard/php-api/trunk/app/Http/Controllers/Auth/AuthController.php
@@ -0,0 +1,38 @@
+<?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;
+
+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->middleware('guest', ['except' => 'getLogout']);
+ }
+
+}
diff --git a/backyard/php-api/trunk/app/Http/Controllers/Auth/PasswordController.php b/backyard/php-api/trunk/app/Http/Controllers/Auth/PasswordController.php
new file mode 100644
index 0000000..3106193
--- /dev/null
+++ b/backyard/php-api/trunk/app/Http/Controllers/Auth/PasswordController.php
@@ -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');
+ }
+
+}
diff --git a/backyard/php-api/trunk/app/Http/Controllers/Controller.php b/backyard/php-api/trunk/app/Http/Controllers/Controller.php
new file mode 100644
index 0000000..27b3f45
--- /dev/null
+++ b/backyard/php-api/trunk/app/Http/Controllers/Controller.php
@@ -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;
+
+}
diff --git a/backyard/php-api/trunk/app/Http/Controllers/HomeController.php b/backyard/php-api/trunk/app/Http/Controllers/HomeController.php
new file mode 100644
index 0000000..c7ca983
--- /dev/null
+++ b/backyard/php-api/trunk/app/Http/Controllers/HomeController.php
@@ -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('home');
+ }
+
+}
diff --git a/backyard/php-api/trunk/app/Http/Controllers/WelcomeController.php b/backyard/php-api/trunk/app/Http/Controllers/WelcomeController.php
new file mode 100644
index 0000000..8a5ac6d
--- /dev/null
+++ b/backyard/php-api/trunk/app/Http/Controllers/WelcomeController.php
@@ -0,0 +1,36 @@
+<?php namespace App\Http\Controllers;
+
+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()
+ {
+ $this->middleware('guest');
+ }
+
+ /**
+ * Show the application welcome screen to the user.
+ *
+ * @return Response
+ */
+ public function index()
+ {
+ return view('welcome');
+ }
+
+}