mentors

mentors Commit Details


Date:2014-06-04 00:11:03 (10 years 6 months ago)
Author:Right Or Wrong
Branch:develop, master
Commit:8282d61e7f62d90991c969b9dad310bd9af841c6
Parents: 3971138444855beb3d79176ee05b64542d35c743
Message:finished the template for the CRUD app

Changes:

File differences

app/config/app.php
1313
1414
1515
16
16
1717
1818
1919
|
*/
'debug' => false,
'debug' => true,
/*
|--------------------------------------------------------------------------
app/controllers/MentorController.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
class MentorController extends \BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$mentors = Mentor::all();
return \View::make('mentors.index')->with('mentors', $mentors);
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return \View::make('mentors.create');
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$rules = array(
'name' => 'required',
'email' => 'required|email',
'title' => 'required'
);
$validator = Validator::make(Input::all(), $rules);
// process the login
if ($validator->fails()) {
return Redirect::to('mentors/create')
->withErrors($validator)
->withInput(Input::except('password'));
} else {
// store
$nerd = new Mentor;
$nerd->name = Input::get('name');
$nerd->email = Input::get('email');
$nerd->title = Input::get('title');
$nerd->save();
// redirect
Session::flash('message', 'Successfully created nerd!');
return Redirect::to('mentors');
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
// get the nerd
$mentor = Mentor::find($id);
// show the view and pass the nerd to it
return View::make('mentors.show')
->with('mentor', $mentor);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
// get the nerd
$mentor = Mentor::find($id);
// show the edit form and pass the nerd
return View::make('mentors.edit')
->with('mentor', $mentor);
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
// validate
// read more on validation at http://laravel.com/docs/validation
$rules = array(
'name' => 'required',
'email' => 'required|email',
'title' => 'required'
);
$validator = Validator::make(Input::all(), $rules);
// process the login
if ($validator->fails()) {
return Redirect::to('mentors/' . $id . '/edit')
->withErrors($validator)
->withInput(Input::except('password'));
} else {
// store
$mentor = Mentor::find($id);
$mentor->name = Input::get('name');
$mentor->email = Input::get('email');
$mentor->title = Input::get('title');
$mentor->save();
// redirect
Session::flash('message', 'Successfully updated mentor!');
return Redirect::to('mentors');
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
// delete
$mentor = Mentor::find($id);
$mentor->delete();
// redirect
Session::flash('message', 'Successfully deleted the mentor!');
return Redirect::to('mentors');
}
}
app/database/migrations/2014_06_04_041712_create_mentors_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 CreateMentorsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mentors', function(Blueprint $table)
{
$table->increments('id');
$table->string('name', 100);
$table->string('email', 100);
$table->string('title', 100);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('mentors');
}
}
app/models/Mentor.php
1
2
3
4
<?php
class Mentor extends Eloquent
{}
app/routes.php
1515
1616
1717
18
19
{
return View::make('hello');
});
Route::resource('mentors', 'MentorController');
app/views/hello.php
3636
3737
3838
39
39
4040
4141
4242
<body>
<div class="welcome">
<a href="http://laravel.com" title="Laravel PH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JrRV1lRMpOgkhKAv0Sqkx56Gd9scVMwVsG9eBmYu+aktj0x/2/C/b6Z0th9MkuGZt3frJslYJgTjOkOlnT1DfvyDeMfv9F9Y9omRMSaItM0AQe7Ei/7SsOO5nH+uOG+sGHR7KUkyFgjBY8WOFUKwApONxPBVMtvbUCs5pCHtxHw2zQBBtI9MTxqgB5bfGiSOMisO2Ky7yuDhgMJjVHJ1NIwEmZ8BC/KC8o5M35gSQlAfB4qFOEFFc/YcLcbg2s7XyRVpKIeYGRnwQarw4lMTTop9ZOpJiXKdi0G64f5z3bTI4WMyGzwhxdPcDTI125AwQjT1OZa9I/56rgCPRp/MKHZTTvNFGAcZobw8iDRGUqeiI6oSQAhWXj5GCMFk56jzWRnLYarkreiPT4NuzpXwgvvKix0M+ZHylsyTng/CoFUvnlsWAyEaSH+dIsRoHNFXfyGO5qsyweC59UtNHvB/AQYAJxSvvrFB3mUAAAAASUVORK5CYII=" alt="Laravel PHP Framework"></a>
<h1>You have arrived.</h1>
<h1>You have arrived. This is all you need to succeed.</h1>
</div>
</body>
</html>
app/views/mentors/create.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
<!DOCTYPE html>
<html>
<head>
<title>Look! I'm CRUDding</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<nav class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="{{ URL::to('mentors') }}">Mentor Alert</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{ URL::to('mentors') }}">View All Mentors</a></li>
<li><a href="{{ URL::to('mentors/create') }}">Create a mentor</a>
</ul>
</nav>
<h1>Create a Nerd</h1>
<!-- if there are creation errors, they will show here -->
{{ HTML::ul($errors->all()) }}
{{ Form::open(array('url' => 'mentors')) }}
<div class="form-group">
{{ Form::label('name', 'Name') }}
{{ Form::text('name', Input::old('name'), array('class' => 'form-control')) }}
</div>
<div class="form-group">
{{ Form::label('email', 'Email') }}
{{ Form::email('email', Input::old('email'), array('class' => 'form-control')) }}
</div>
<div class="form-group">
{{ Form::label('title', 'Mentor Title') }}
{{ Form::select('title', array('0' => 'Select a title', '1' => 'Mentor', '2' => 'Mentee', '3' => 'Both'), Input::old('title'), array('class' => 'form-control')) }}
</div>
{{ Form::submit('Create the mentor!', array('class' => 'btn btn-primary')) }}
{{ Form::close() }}
</div>
</body>
</html>
app/views/mentors/edit.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
<!DOCTYPE html>
<html>
<head>
<title>Look! I'm CRUDding</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<nav class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="{{ URL::to('mentors') }}">Mentor Alert</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{ URL::to('mentors') }}">View All Mentors</a></li>
<li><a href="{{ URL::to('mentors/create') }}">Create a Mentor</a>
</ul>
</nav>
<h1>Edit {{ $mentor->name }}</h1>
<!-- if there are creation errors, they will show here -->
{{ HTML::ul($errors->all()) }}
{{ Form::model($mentor, array('route' => array('mentors.update', $mentor->id), 'method' => 'PUT')) }}
<div class="form-group">
{{ Form::label('name', 'Name') }}
{{ Form::text('name', null, array('class' => 'form-control')) }}
</div>
<div class="form-group">
{{ Form::label('email', 'Email') }}
{{ Form::email('email', null, array('class' => 'form-control')) }}
</div>
<div class="form-group">
{{ Form::label('title', 'Title') }}
{{ Form::select('title', array('0' => 'Select a title', '1' => 'Mentor', '2' => 'Mentee', '3' => 'Both'), null, array('class' => 'form-control')) }}
</div>
{{ Form::submit('Edit the Mentor!', array('class' => 'btn btn-primary')) }}
{{ Form::close() }}
</div>
</body>
</html>
app/views/mentors/index.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
<!DOCTYPE html>
<html>
<head>
<title>Look! I'm CRUDding</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<nav class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="{{ URL::to('mentors') }}">Mentor Alert</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{ URL::to('mentors') }}">View All Mentors</a></li>
<li><a href="{{ URL::to('mentors/create') }}">Create a mentor</a>
</ul>
</nav>
<h1>All the Mentors</h1>
<!-- will be used to show any messages -->
@if (Session::has('message'))
<div class="alert alert-info">{{ Session::get('message') }}</div>
@endif
<table class="table table-striped table-bordered">
<thead>
<tr>
<td>ID</td>
<td>Name</td>
<td>Email</td>
<td>Title</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
@foreach($mentors as $key => $value)
<tr>
<td>{{ $value->id }}</td>
<td>{{ $value->name }}</td>
<td>{{ $value->email }}</td>
<td>{{ $value->title }}</td>
<!-- we will also add show, edit, and delete buttons -->
<td>
<!-- delete the nerd (uses the destroy method DESTROY /nerds/{id} -->
<!-- we will add this later since its a little more complicated than the other two buttons -->
{{ Form::open(array('url' => 'mentors/' . $value->id, 'class' => 'pull-right')) }}
{{ Form::hidden('method', 'DELETE') }}
{{ Form::submit('Delete this Mentor', array('class' => 'btn btn-warning')) }}
{{ Form::close() }}
<!-- show the nerd (uses the show method found at GET /nerds/{id} -->
<a class="btn btn-small btn-success" href="{{ URL::to('mentors/' . $value->id) }}">Show this mentor</a>
<!-- edit this nerd (uses the edit method found at GET /nerds/{id}/edit -->
<a class="btn btn-small btn-info" href="{{ URL::to('mentors/' . $value->id . '/edit') }}">Edit this mentor</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</body>
</html>
app/views/mentors/show.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
<!DOCTYPE html>
<html>
<head>
<title>Look! I'm CRUDding</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<nav class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="{{ URL::to('mentors') }}">Mentor Alert</a>
</div>
<ul class="nav navbar-nav">
<li><a href="{{ URL::to('mentors') }}">View All Mentors</a></li>
<li><a href="{{ URL::to('mentors/create') }}">Create a Mentor</a>
</ul>
</nav>
<h1>Showing {{ $mentor->name }}</h1>
<div class="jumbotron text-center">
<h2>{{ $mentor->name }}</h2>
<p>
<strong>Email:</strong> {{ $mentor->email }}<br>
<strong>Title:</strong> {{ $mentor->title }}
</p>
</div>
</div>
</body>
</html>
vendor/autoload.php
44
55
66
7
7
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInitce866d1c30f9d3a988e9f177d36447af::getLoader();
return ComposerAutoloaderInit72c82083eb743a8ff678afeb7e958c8c::getLoader();
vendor/composer/autoload_classmap.php
2828
2929
3030
31
3132
3233
3334
......
415416
416417
417418
419
420
418421
419422
420423
'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',
'CreateMentorsTable' => $baseDir . '/app/database/migrations/2014_06_04_041712_create_mentors_table.php',
'Crypt_AES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/AES.php',
'Crypt_Base' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Base.php',
'Crypt_Blowfish' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php',
'Jeremeamia\\SuperClosure\\Visitor\\ClosureFinderVisitor' => $vendorDir . '/jeremeamia/SuperClosure/src/Jeremeamia/SuperClosure/Visitor/ClosureFinderVisitor.php',
'Jeremeamia\\SuperClosure\\Visitor\\MagicConstantVisitor' => $vendorDir . '/jeremeamia/SuperClosure/src/Jeremeamia/SuperClosure/Visitor/MagicConstantVisitor.php',
'Math_BigInteger' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Math/BigInteger.php',
'Mentor' => $baseDir . '/app/models/Mentor.php',
'MentorController' => $baseDir . '/app/controllers/MentorController.php',
'Monolog\\ErrorHandler' => $vendorDir . '/monolog/monolog/src/Monolog/ErrorHandler.php',
'Monolog\\Formatter\\ChromePHPFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php',
'Monolog\\Formatter\\ElasticaFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.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
......
4949
5050
5151
52
52
5353
5454
5555
5656
5757
5858
59
59
6060
6161
6262
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitce866d1c30f9d3a988e9f177d36447af
class ComposerAutoloaderInit72c82083eb743a8ff678afeb7e958c8c
{
private static $loader;
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitce866d1c30f9d3a988e9f177d36447af', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit72c82083eb743a8ff678afeb7e958c8c', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitce866d1c30f9d3a988e9f177d36447af', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit72c82083eb743a8ff678afeb7e958c8c', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequirece866d1c30f9d3a988e9f177d36447af($file);
composerRequire72c82083eb743a8ff678afeb7e958c8c($file);
}
return $loader;
}
}
function composerRequirece866d1c30f9d3a988e9f177d36447af($file)
function composerRequire72c82083eb743a8ff678afeb7e958c8c($file)
{
require $file;
}

Archive Download the corresponding diff file

Branches

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