diff --git a/app/controllers/BlogController.php b/app/controllers/BlogController.php
new file mode 100644
index 0000000..b61586c
--- /dev/null
+++ b/app/controllers/BlogController.php
@@ -0,0 +1,121 @@
+with('blogs', $blogs);
+ }
+
+
+ /**
+ * Show the form for creating a new resource.
+ *
+ * @return Response
+ */
+ public function create()
+ {
+ return View::make('blog.create');
+ }
+
+
+ /**
+ * Store a newly created resource in storage.
+ *
+ * @return Response
+ */
+ public function store()
+ {
+ $data = Input::all();
+
+ $blog = Blog::create(array(
+ 'title' => Input::get('title'),
+ 'author'=> Auth::user()->first,
+ 'body' => Input::get('body')
+ ));
+
+ if($blog->save())
+ {
+ return Redirect::route('blog.index');
+ }
+ }
+
+
+ /**
+ * Display the specified resource.
+ *
+ * @param int $id
+ * @return Response
+ */
+ public function show($id)
+ {
+ $post = Blog::find($id);
+
+ return View::make('blog.show')->with('post', $post);
+ }
+
+
+ /**
+ * Show the form for editing the specified resource.
+ *
+ * @param int $id
+ * @return Response
+ */
+ public function edit($id)
+ {
+ $post = Blog::find($id);
+
+ return View::make('blog.edit')->with('post', $post);
+ }
+
+
+ /**
+ * Update the specified resource in storage.
+ *
+ * @param int $id
+ * @return Response
+ */
+ public function update($id)
+ {
+ $data = Input::all();
+
+ $post = Blog::find($id);
+
+ //complete validation here
+
+ $post->title = Input::get('title');
+ $post->author = Auth::user()->first;
+ $post->body = Input::get('body');
+
+
+ if($post->save())
+ {
+ return Redirect::route('blog.index');
+ }
+ }
+
+
+ /**
+ * Remove the specified resource from storage.
+ *
+ * @param int $id
+ * @return Response
+ */
+ public function destroy($id)
+ {
+ Blog::destroy($id);
+
+ Session::flash('message', 'You have successfull deleted a blog post');
+
+ return Redirect::route('blog.index');
+ }
+
+
+}
diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php
index 6384ff3..53a3b7a 100755
--- a/app/controllers/HomeController.php
+++ b/app/controllers/HomeController.php
@@ -25,4 +25,14 @@ class HomeController extends BaseController {
return View::make('home');
}
+ public function showContact()
+ {
+ return View::make('contact');
+ }
+
+ public function contact()
+ {
+ $data = Input::all();
+ }
+
}
diff --git a/app/database/migrations/2014_07_13_045133_create_blogs_table.php b/app/database/migrations/2014_07_13_045133_create_blogs_table.php
new file mode 100644
index 0000000..35430fe
--- /dev/null
+++ b/app/database/migrations/2014_07_13_045133_create_blogs_table.php
@@ -0,0 +1,35 @@
+increments('id');
+ $table->string('author');
+ $table->text('title');
+ $table->text('body');
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('blogs');
+ }
+
+}
diff --git a/app/models/Blog.php b/app/models/Blog.php
new file mode 100644
index 0000000..a4be5a0
--- /dev/null
+++ b/app/models/Blog.php
@@ -0,0 +1,14 @@
+ 'required|min:5',
+ 'body' => 'required|min:100',
+ 'author' => 'required'
+ );
+}
\ No newline at end of file
diff --git a/app/routes.php b/app/routes.php
index 55c5307..e0cb0cf 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -69,6 +69,10 @@ Route::group(array('before' => 'auth|admin'), function()
});
+Route::get('contact', array('as' => 'contact', 'uses' => 'HomeController@showContact'));
+Route::post('contact', array('uses' => 'HomeController@contact'));
+Route::resource('blog', 'BlogController');
+
Route::get('denied', function()
{
return View::make('404');
diff --git a/app/views/blog/create.blade.php b/app/views/blog/create.blade.php
new file mode 100644
index 0000000..e69de29
diff --git a/app/views/blog/edit.blade.php b/app/views/blog/edit.blade.php
new file mode 100644
index 0000000..e69de29
diff --git a/app/views/blog/index.blade.php b/app/views/blog/index.blade.php
new file mode 100644
index 0000000..e69de29
diff --git a/app/views/blog/show.blade.php b/app/views/blog/show.blade.php
new file mode 100644
index 0000000..e69de29
diff --git a/app/views/contact.blade.php b/app/views/contact.blade.php
new file mode 100644
index 0000000..03dc43f
--- /dev/null
+++ b/app/views/contact.blade.php
@@ -0,0 +1,104 @@
+
+
+
+
+
+ Compact contact form - Bootsnipp.com
+
+ {{HTML::style('css/mentconnect.css')}}
+ {{HTML::style('css/denied.css')}}
+
+
+
+
+
+
+
+
+
+
+ -
+ {{HTML::link('partners', 'Partners') }}
+
+ -
+ {{HTML::link('blog', 'Blog') }}
+
+ -
+ {{HTML::link('login', 'Sign In') }}
+
+
+
+
+
+
+
+ {{ Form::open(array('url' => 'users/store', 'class' => 'form-horizontal')) }}
+
+
+
+
+
+
+
+
+
Contact Us!
+
If you have any questions or suggestions, please complete the form below and we will get back to you as soon as possible.
+
+
+
+
+
+
+
+
+ {{ Form::email('email', \Input::old('email'), array('class' => 'form-control form-control-bordered',
+ 'tabindex' => '1')) }}
+
+
+
+
+ {{Form::text('subject', \Input::old('subject'), array('class' => 'form-control form-control-bordered', 'tabindex' => '2'))}}
+
+
+
+
+ {{ Form::textarea('message', Input::old('message'), array('class' => 'form-control form-control-bordered', 'tabindex' => '3')) }}
+
+
+
+ {{Form::submit('Send', array('class' => 'btn btn-success btn-large submit-button'))}}
+
+
+
+
+ {{ Form::close() }}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/home.blade.php b/app/views/home.blade.php
index 664b565..9f9dc73 100755
--- a/app/views/home.blade.php
+++ b/app/views/home.blade.php
@@ -17,11 +17,12 @@
-
- {{HTML::link('partners', 'Partners') }}
+ {{HTML::link('blog', 'Blog') }}
-
- {{HTML::link('blog', 'Blog') }}
+ {{HTML::link('contact', 'Contact Us') }}
+
-
{{HTML::link('login', 'Sign In') }}
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 2d90776..b30546a 100755
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
-return ComposerAutoloaderInitef59d4e967a29076ef0d253a93dee760::getLoader();
+return ComposerAutoloaderInit2b97c4b5b1dafceaab53da45e98cc605::getLoader();
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index c91ee01..58dbe5d 100755
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -34,6 +34,7 @@ return array(
'ClassPreloader\\Parser\\DirVisitor' => $vendorDir . '/classpreloader/classpreloader/src/ClassPreloader/Parser/DirVisitor.php',
'ClassPreloader\\Parser\\FileVisitor' => $vendorDir . '/classpreloader/classpreloader/src/ClassPreloader/Parser/FileVisitor.php',
'ClassPreloader\\Parser\\NodeTraverser' => $vendorDir . '/classpreloader/classpreloader/src/ClassPreloader/Parser/NodeTraverser.php',
+ 'CreateBlogsTable' => $baseDir . '/app/database/migrations/2014_07_13_045133_create_blogs_table.php',
'CreateMcRoleTable' => $baseDir . '/app/database/migrations/2014_06_26_235750_create_mc_role_table.php',
'CreateMcUserTable' => $baseDir . '/app/database/migrations/2014_06_26_234302_create_mc_user_table.php',
'CreateMentorMenteeMatchTable' => $baseDir . '/app/database/migrations/2014_06_29_143038_create_mentor_mentee_match_table.php',
@@ -53,6 +54,7 @@ return array(
'Crypt_TripleDES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php',
'Crypt_Twofish' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php',
'DatabaseSeeder' => $baseDir . '/app/database/seeds/DatabaseSeeder.php',
+ 'EmailController' => $baseDir . '/app/controllers/EmailController.php',
'File_ANSI' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ANSI.php',
'File_ASN1' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ASN1.php',
'File_ASN1_Element' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ASN1.php',
@@ -944,9 +946,11 @@ return array(
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
+ 'ReceivedEmail' => $baseDir . '/app/models/ReceivedEmail.php',
'RemindersController' => $baseDir . '/app/controllers/RemindersController.php',
'Role' => $baseDir . '/app/models/Role.php',
'RoleTableSeeder' => $baseDir . '/app/database/seeds/RoleTableSeeder.php',
+ 'SentEmail' => $baseDir . '/app/models/SentEmail.php',
'SessionController' => $baseDir . '/app/controllers/SessionController.php',
'SessionHandlerInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php',
'Stack\\Builder' => $vendorDir . '/stack/builder/src/Stack/Builder.php',
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index 994e070..5af248c 100755
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInitef59d4e967a29076ef0d253a93dee760
+class ComposerAutoloaderInit2b97c4b5b1dafceaab53da45e98cc605
{
private static $loader;
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitef59d4e967a29076ef0d253a93dee760
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInitef59d4e967a29076ef0d253a93dee760', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInit2b97c4b5b1dafceaab53da45e98cc605', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInitef59d4e967a29076ef0d253a93dee760', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInit2b97c4b5b1dafceaab53da45e98cc605', 'loadClassLoader'));
$includePaths = require __DIR__ . '/include_paths.php';
array_push($includePaths, get_include_path());
@@ -46,14 +46,14 @@ class ComposerAutoloaderInitef59d4e967a29076ef0d253a93dee760
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
- composerRequireef59d4e967a29076ef0d253a93dee760($file);
+ composerRequire2b97c4b5b1dafceaab53da45e98cc605($file);
}
return $loader;
}
}
-function composerRequireef59d4e967a29076ef0d253a93dee760($file)
+function composerRequire2b97c4b5b1dafceaab53da45e98cc605($file)
{
require $file;
}