Skip to content

Commit 59585de

Browse files
committed
Project Creation now has github_link, slack_link, website_link, and a place to say how to get involved. Also, it now stores the user who created it into a column called project_admin_user_id. This could potentially be changed later on so others could hold the admin for this project.
1 parent d85cc6f commit 59585de

File tree

4 files changed

+58
-1
lines changed

4 files changed

+58
-1
lines changed

app/Http/Controllers/ProjectController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ public function projectCreateProject(request $request)
1212
$project = new Project();
1313
$project->title = $request['title'];
1414
$project->description = $request['description'];
15+
$project->github_link = $request['github_link'];
16+
$project->slack_link = $request['slack_link'];
17+
$project->website_link = $request['website_link'];
18+
$project->get_involved_pitch = $request['get_involved_pitch'];
19+
$project->project_admin_user_id = $request->user()->id;
1520
$request->user()->projects()->save($project);
1621
return view('home');
1722
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class AddToProjects extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('projects', function (Blueprint $table) {
17+
//
18+
$table->integer('project_admin_user_id')->nullable();
19+
$table->string('github_link', 100)->nullable();
20+
$table->string('slack_link', 100)->nullable();
21+
$table->string('website_link', 100)->nullable();
22+
$table->longText('get_involved_pitch')->nullable();
23+
});
24+
}
25+
26+
/**
27+
* Reverse the migrations.
28+
*
29+
* @return void
30+
*/
31+
public function down()
32+
{
33+
Schema::table('projects', function (Blueprint $table) {
34+
//
35+
$table->dropColumn('project_admin_user_id');
36+
$table->dropColumn('github_link');
37+
$table->dropColumn('slack_link');
38+
$table->dropColumn('website_link');
39+
$table->dropColumn('get_involved_pitch');
40+
});
41+
}
42+
}

resources/views/new_project.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
<div class="form-group">
1515
<textarea class="form-control" name="title" id="new-project" rows="5" placeholder="Your Project Title"></textarea>
1616
<textarea class="form-control" name="description" id="new-project" rows="5" placeholder="Your Project Description"></textarea>
17-
</div>
17+
<textarea class="form-control" name="github_link" id="new-project" rows="2" placeholder="GitHub Link Here"></textarea>
18+
<textarea class="form-control" name="slack_link" id="new-project" rows="2" placeholder="Slack Link Here"></textarea>
19+
<textarea class="form-control" name="website_link" id="new-project" rows="2" placeholder="Website Link Here"></textarea>
20+
<textarea class="form-control" name="get_involved_pitch" id="new-project" rows="5" placeholder="Explain how to get involved"></textarea>
21+
</div>
1822
<button type="submit" class="btn btn-primary">Create Post</button>
1923
<input type="hidden" value="{{ Session::token() }}" name="_token">
2024
{{ csrf_field() }}

resources/views/project.blade.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@
44
<h1>{{ $project->title }}</h1>
55
<h3>{{ $project->description }}</h3>
66
<a href="/members/{{ $project->id }}">Members</a>
7+
8+
<div>
9+
</div>
10+
11+
12+
713
@endsection

0 commit comments

Comments
 (0)