diff --git a/app/controllers/ProjectsController.php b/app/controllers/ProjectsController.php
index d25908b..8901ea3 100644
--- a/app/controllers/ProjectsController.php
+++ b/app/controllers/ProjectsController.php
@@ -15,6 +15,14 @@ class ProjectsController extends \BaseController {
}
+ public function fetchProject($url = null)
+ {
+ $session = curl_init('http://simpledeveloper.com/');
+ curl_setopt($session, CURLOPT_RETURNTRANSFER,true);
+ $json = curl_exec($session);
+
+ return $json;
+ }
/**
* Show the form for creating a new resource.
@@ -38,7 +46,7 @@ class ProjectsController extends \BaseController {
'title' => 'required|min:5',
'link' => 'required|url',
'language' => 'required'
- );
+ );
$data = Input::all();
@@ -53,6 +61,7 @@ class ProjectsController extends \BaseController {
{
$project = Project::firstOrCreate(
array(
+ 'user_id' => Auth::id(),
'title' => Input::get('title'),
'link' => Input::get('link'),
'language' => Input::get('language')
@@ -125,6 +134,7 @@ class ProjectsController extends \BaseController {
->withInput(Input::all());
}else
{
+ $project->user_id = Auth::id();
$project->title = Input::get('title');
$project->link = Input::get('link');
$project->language = Input::get('language');
diff --git a/app/database/migrations/2014_07_06_040450_alter_users_table_add_deleted_at_column.php b/app/database/migrations/2014_07_06_040450_alter_users_table_add_deleted_at_column.php
index 1ba4bed..e253313 100644
--- a/app/database/migrations/2014_07_06_040450_alter_users_table_add_deleted_at_column.php
+++ b/app/database/migrations/2014_07_06_040450_alter_users_table_add_deleted_at_column.php
@@ -25,7 +25,10 @@ class AlterUsersTableAddDeletedAtColumn extends Migration {
*/
public function down()
{
- //do nothing here
+ Schema::table('users', function(Blueprint $table)
+ {
+ $table->dropColumn('deleted_at');
+ });
}
}
diff --git a/app/database/migrations/2014_07_07_034137_alter_projects_table_add_user_id_column.php b/app/database/migrations/2014_07_07_034137_alter_projects_table_add_user_id_column.php
new file mode 100644
index 0000000..04d9859
--- /dev/null
+++ b/app/database/migrations/2014_07_07_034137_alter_projects_table_add_user_id_column.php
@@ -0,0 +1,38 @@
+integer('user_id')->unsigned()->after('id');
+ $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade');
+ $table->softDeletes();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('projects', function(Blueprint $table)
+ {
+ $table->dropColumn('user_id');
+ $table->dropForeign('user_id');
+ $table->dropColumn('deleted_at');
+ });
+ }
+
+}
diff --git a/app/models/Project.php b/app/models/Project.php
index 3ea4de4..6a75fd9 100644
--- a/app/models/Project.php
+++ b/app/models/Project.php
@@ -1,5 +1,7 @@
- Mentconnect - Login
+ Mentconnect - Add New Projects
{{HTML::style('css/mentconnect.css')}}
{{HTML::style('css/denied.css')}}
@@ -13,16 +13,13 @@
-
{{HTML::link('projects', 'Projects') }}
- -
- {{HTML::link('projects/create', 'Add Projects') }}
-
-
{{HTML::link('logout', 'Logout') }}
@@ -36,7 +33,7 @@
-
diff --git a/app/views/projects/edit.blade.php b/app/views/projects/edit.blade.php
index 2a04d5a..f1dd655 100644
--- a/app/views/projects/edit.blade.php
+++ b/app/views/projects/edit.blade.php
@@ -2,7 +2,7 @@
-
Mentconnect - Login
+
Editing - {{ $project->title }}
{{HTML::style('css/mentconnect.css')}}
{{HTML::style('css/denied.css')}}
diff --git a/app/views/projects/home.blade.php b/app/views/projects/home.blade.php
index 0f76c4a..6b5b588 100644
--- a/app/views/projects/home.blade.php
+++ b/app/views/projects/home.blade.php
@@ -2,7 +2,7 @@
-
Mentconnect - Login
+
Mentconnect - Open Source Projects
{{HTML::style('css/mentconnect.css')}}
{{HTML::style('css/denied.css')}}
@@ -28,59 +28,48 @@
-
-
-
-
-
-
-
-
Awesome Projects, You're Welcome!
-
- Explore these community recommended projects and start learning today!
-
- @if(Session::has('message'))
-
{{ Session::get('message') }}
- @endif
-
-
-
-
-
-
-
-
- Project Title |
- Project URL |
- Project Language |
- View Project |
-
-
-
- @foreach($projects as $key => $value)
-
- {{ $value->title }} |
- {{ $value->link }} |
- {{ $value->language }} |
-
- View this Project
- |
-
- @endforeach
-
-
-
-
+
+
+
+
Awesome Projects, You're Welcome!
+
+ Explore these community recommended projects and start learning today!
+
+ @if(Session::has('message'))
+
{{ Session::get('message') }}
+ @endif
+
+
+
+
+
+
+
+
+ Project Title |
+ Project URL |
+ Project Language |
+ View Project |
+
+
+
+ @foreach($projects as $key => $value)
+
+ {{ $value->title }} |
+ {{ $value->link }} |
+ {{ $value->language }} |
+
+ View this Project
+ |
+
+ @endforeach
+
+
-
-
-
+
+
-
+