mentors

mentors Commit Details


Date:2014-07-13 00:25:48 (10 years 5 months ago)
Author:Right Or Wrong
Branch:develop
Commit:ff50c7d2310ae3160e17e49b21ee6e30374486a6
Parents: 9f2eae2d8b4cb561dd4e7ccd2993a9601d5e7f63
Message:added a blog feature next views

Changes:

File differences

app/controllers/BlogController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
class BlogController extends \BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$blogs = Blog::all();
return View::make('blog.index')->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');
}
}
app/controllers/HomeController.php
2525
2626
2727
28
29
30
31
32
33
34
35
36
37
2838
return View::make('home');
}
public function showContact()
{
return View::make('contact');
}
public function contact()
{
$data = Input::all();
}
}
app/database/migrations/2014_07_13_045133_create_blogs_table.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBlogsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('blogs', function(Blueprint $table)
{
$table->increments('id');
$table->string('author');
$table->text('title');
$table->text('body');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('blogs');
}
}
app/models/Blog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
class Blog extends \Eloquent
{
protected $table = 'blogs';
protected $fillable = array('title', 'body', 'author');
protected $rules = array(
'title' => 'required|min:5',
'body' => 'required|min:100',
'author' => 'required'
);
}
app/routes.php
6969
7070
7171
72
73
74
75
7276
7377
7478
});
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');
app/views/contact.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- This file has been downloaded from Bootsnipp.com. Enjoy! -->
<title>Compact contact form - Bootsnipp.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
{{HTML::style('css/mentconnect.css')}}
{{HTML::style('css/denied.css')}}
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
</head>
<body>
<header id="cta" class="background-showcase">
<div id="nv" class="navbar">
<div class="container">
<a class="navbar-brand" href="/">
<div class="asset logo-white-header">
{{ HTML::image("images/mentconnect.png", "editor", array("width" => "130px", "height" => "44px")) }}
</div>
</a>
<ul class=" nav navbar-nav pull-right">
<li class>
{{HTML::link('partners', 'Partners') }}
</li>
<li class>
{{HTML::link('blog', 'Blog') }}
</li>
<li class="button">
{{HTML::link('login', 'Sign In') }}
</li>
</ul>
</div>
</div>
</header>
<div id="signup-content">
{{ Form::open(array('url' => 'users/store', 'class' => 'form-horizontal')) }}
<div class="container padded">
<div class="container">
<legend><h2>Got Questions? </h2></legend>
</div>
<div class="row">
<div class="col-lg-3 col-lg-offset-1">
<h3>Contact Us!</h3>
<p>If you have any questions or suggestions, please complete the form below and we will get back to you as soon as possible.</p>
</div>
<div class="col-lg-8">
<div class="form-group">
<label for="email">Email</label>
{{ Form::email('email', \Input::old('email'), array('class' => 'form-control form-control-bordered',
'tabindex' => '1')) }}
</div>
<div class="form-group">
<label for="first">Subject</label>
{{Form::text('subject', \Input::old('subject'), array('class' => 'form-control form-control-bordered', 'tabindex' => '2'))}}
</div>
<div class="form-group">
<label for="message">Message</label>
{{ Form::textarea('message', Input::old('message'), array('class' => 'form-control form-control-bordered', 'tabindex' => '3')) }}
</div>
<div class="row" id="signup-bottom-row">
{{Form::submit('Send', array('class' => 'btn btn-success btn-large submit-button'))}}
</div>
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div id="footer">
<div id="sub-footer">
<div class="container">
<div class="row">
<div class="col-lg-4">
<p id="copyright-section">
Copyright &copy; 2014. Mentconnect Inc. All Rights Reserved.
</p>
</div>
<div class="col-lg-4">
</div>
<div class="col-lg-4">
<p id="love">
Built With Laravel + Bootstrap Frameworks by Elisha Chirchir.
</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
app/views/home.blade.php
1717
1818
1919
20
20
2121
2222
23
23
2424
25
2526
2627
2728
</a>
<ul class=" nav navbar-nav pull-right">
<li class>
{{HTML::link('partners', 'Partners') }}
{{HTML::link('blog', 'Blog') }}
</li>
<li class>
{{HTML::link('blog', 'Blog') }}
{{HTML::link('contact', 'Contact Us') }}
</li>
<li class="button">
{{HTML::link('login', 'Sign In') }}
</li>
vendor/autoload.php
44
55
66
7
7
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInitef59d4e967a29076ef0d253a93dee760::getLoader();
return ComposerAutoloaderInit2b97c4b5b1dafceaab53da45e98cc605::getLoader();
vendor/composer/autoload_classmap.php
3434
3535
3636
37
3738
3839
3940
......
5354
5455
5556
57
5658
5759
5860
......
944946
945947
946948
949
947950
948951
949952
953
950954
951955
952956
'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',
'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',
'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',
vendor/composer/autoload_real.php
22
33
44
5
5
66
77
88
......
1919
2020
2121
22
22
2323
24
24
2525
2626
2727
......
4646
4747
4848
49
49
5050
5151
5252
5353
5454
5555
56
56
5757
5858
5959
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitef59d4e967a29076ef0d253a93dee760
class ComposerAutoloaderInit2b97c4b5b1dafceaab53da45e98cc605
{
private static $loader;
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());
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequireef59d4e967a29076ef0d253a93dee760($file);
composerRequire2b97c4b5b1dafceaab53da45e98cc605($file);
}
return $loader;
}
}
function composerRequireef59d4e967a29076ef0d253a93dee760($file)
function composerRequire2b97c4b5b1dafceaab53da45e98cc605($file)
{
require $file;
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.08980s using 13 queries.