From f440039cf28f525326590d4a506c0253f5bdaebb Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Mon, 8 Apr 2019 22:13:52 -0400 Subject: [PATCH 01/10] Committing because I haven't in quite a while --- app/Http/Controllers/PostController.php | 31 +++++++++++------------ app/Http/Controllers/TagController.php | 2 +- app/Http/Controllers/ThreadController.php | 11 +++++--- app/Http/Resources/PostCollection.php | 21 +++++++++++++++ app/Http/Resources/TagCollection.php | 21 +++++++++++++++ app/Http/Resources/ThreadsCollection.php | 3 +++ app/Thread.php | 9 +++++-- 7 files changed, 75 insertions(+), 23 deletions(-) create mode 100644 app/Http/Resources/PostCollection.php create mode 100644 app/Http/Resources/TagCollection.php diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php index f07d242..8984b26 100644 --- a/app/Http/Controllers/PostController.php +++ b/app/Http/Controllers/PostController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Post; +use App\PostCollection; use Illuminate\Http\Request; class PostController extends Controller @@ -10,9 +11,10 @@ class PostController extends Controller /** * Display a listing of the resource. * + * @param integer $thread_id * @return \Illuminate\Http\Response */ - public function index() + public function index(Thread $thread) { // } @@ -22,9 +24,9 @@ class PostController extends Controller * * @return \Illuminate\Http\Response */ - public function create() + public function create(Thread $thread) { - // + return view("create_post")->withThread($thread); } /** @@ -35,18 +37,13 @@ class PostController extends Controller */ public function store(Request $request) { - // - } + $post = new Post; - /** - * Display the specified resource. - * - * @param \App\Post $post - * @return \Illuminate\Http\Response - */ - public function show(Post $post) - { - // + $post->poster_id = $request->user_id; + $post->content = $request->content; + $post->thread_id = $request->thread_id; + + $post->save(); } /** @@ -57,7 +54,7 @@ class PostController extends Controller */ public function edit(Post $post) { - // + return view("edit_post")->withPost($post); } /** @@ -69,7 +66,9 @@ class PostController extends Controller */ public function update(Request $request, Post $post) { - // + $post->content = $request->content; + + $post->save(); } /** diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 137d3d2..1a97dc3 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -24,7 +24,7 @@ class TagController extends Controller */ public function create() { - // + } /** diff --git a/app/Http/Controllers/ThreadController.php b/app/Http/Controllers/ThreadController.php index 67bcbb8..659012c 100644 --- a/app/Http/Controllers/ThreadController.php +++ b/app/Http/Controllers/ThreadController.php @@ -48,11 +48,13 @@ class ThreadController extends Controller /** * Display the specified resource. * - * @param \App\Thread $thread + * @param integer $id + * - A thread ID * @return \Illuminate\Http\Response */ - public function show(Thread $thread) + public function show(integer $id) { + $thread = ThreadsCollection(Thread::find($id)->with("posts")->get()); return view("thread_view")->withThread($thread); } @@ -64,7 +66,7 @@ class ThreadController extends Controller */ public function edit(Thread $thread) { - // + return view("edit")->withThread($thread); } /** @@ -76,7 +78,8 @@ class ThreadController extends Controller */ public function update(Request $request, Thread $thread) { - // + $thread->thread_title = $request->thread_title; + $thread->save(); } /** diff --git a/app/Http/Resources/PostCollection.php b/app/Http/Resources/PostCollection.php new file mode 100644 index 0000000..5343616 --- /dev/null +++ b/app/Http/Resources/PostCollection.php @@ -0,0 +1,21 @@ + $this->$collection + ]; + } +} diff --git a/app/Http/Resources/TagCollection.php b/app/Http/Resources/TagCollection.php new file mode 100644 index 0000000..cf199ce --- /dev/null +++ b/app/Http/Resources/TagCollection.php @@ -0,0 +1,21 @@ + $this->$collection + ]; + } +} diff --git a/app/Http/Resources/ThreadsCollection.php b/app/Http/Resources/ThreadsCollection.php index 4de9ef9..421c1f5 100644 --- a/app/Http/Resources/ThreadsCollection.php +++ b/app/Http/Resources/ThreadsCollection.php @@ -19,6 +19,9 @@ class ThreadsCollection extends ResourceCollection ]; } + /** + * Deprecated, kept for posterity. + */ public function getCreators() { foreach($this->collection as &$t) { $creator = $t->creator; diff --git a/app/Thread.php b/app/Thread.php index 70cdd8d..5d7c0d3 100644 --- a/app/Thread.php +++ b/app/Thread.php @@ -6,8 +6,6 @@ use Illuminate\Database\Eloquent\Model; class Thread extends Model { - private $creator_name; - /** * Get the creator of the thread. */ @@ -21,4 +19,11 @@ class Thread extends Model public function tags() { return $this->belongsToMany('App\Tag'); } + + /** + * Get the posts for the thread. + */ + public function posts() { + return $this->hasMany('App\Post'); + } } From 3b1ef512b48f5a598704389ed8dafd4875576440 Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Tue, 9 Apr 2019 02:55:56 -0400 Subject: [PATCH 02/10] Back end controllers done? Find out on the next episode of dragon ball z --- app/Http/Controllers/PostController.php | 24 +++++++------- app/Http/Controllers/TagController.php | 40 ++++++++++------------- app/Http/Controllers/ThreadController.php | 24 +++++++------- app/Http/Resources/TagCollection.php | 2 +- 4 files changed, 43 insertions(+), 47 deletions(-) diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php index 8984b26..b25629f 100644 --- a/app/Http/Controllers/PostController.php +++ b/app/Http/Controllers/PostController.php @@ -29,6 +29,17 @@ class PostController extends Controller return view("create_post")->withThread($thread); } + /** + * Show the form for editing the specified resource. + * + * @param \App\Post $post + * @return \Illuminate\Http\Response + */ + public function edit(Post $post) + { + return view("edit_post")->withPost($post); + } + /** * Store a newly created resource in storage. * @@ -46,17 +57,6 @@ class PostController extends Controller $post->save(); } - /** - * Show the form for editing the specified resource. - * - * @param \App\Post $post - * @return \Illuminate\Http\Response - */ - public function edit(Post $post) - { - return view("edit_post")->withPost($post); - } - /** * Update the specified resource in storage. * @@ -79,6 +79,6 @@ class PostController extends Controller */ public function destroy(Post $post) { - // + $post->delete(); } } diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 1a97dc3..df60c70 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Tag; +use App\Http\Resources\TagCollection; use Illuminate\Http\Request; class TagController extends Controller @@ -14,7 +15,7 @@ class TagController extends Controller */ public function index() { - // + return TagCollection(Tag::get()); } /** @@ -24,40 +25,34 @@ class TagController extends Controller */ public function create() { - + return view("create_tag"); } /** - * Store a newly created resource in storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response - */ - public function store(Request $request) - { - // - } - - /** - * Display the specified resource. + * Show the form for editing the specified resource. * * @param \App\Tag $tag * @return \Illuminate\Http\Response */ - public function show(Tag $tag) + public function edit(Tag $tag) { - // + return view("edit_tag"); } /** - * Show the form for editing the specified resource. + * Store a newly created resource in storage. * - * @param \App\Tag $tag + * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ - public function edit(Tag $tag) + public function store(Request $request) { - // + $tag = new Tag; + + $tag->tag_text = $request->tag_text; + $tag->creator_id = $request->user_id; + + $tag->save(); } /** @@ -69,7 +64,8 @@ class TagController extends Controller */ public function update(Request $request, Tag $tag) { - // + $tag->tag_text = $request->tag_text; + $tag->save(); } /** @@ -80,6 +76,6 @@ class TagController extends Controller */ public function destroy(Tag $tag) { - // + $tag->delete(); } } diff --git a/app/Http/Controllers/ThreadController.php b/app/Http/Controllers/ThreadController.php index 659012c..c5ebe58 100644 --- a/app/Http/Controllers/ThreadController.php +++ b/app/Http/Controllers/ThreadController.php @@ -29,6 +29,17 @@ class ThreadController extends Controller return view("create_thread"); } + /** + * Show the form for editing the specified resource. + * + * @param \App\Thread $thread + * @return \Illuminate\Http\Response + */ + public function edit(Thread $thread) + { + return view("edit")->withThread($thread); + } + /** * Store a newly created resource in storage. * @@ -58,17 +69,6 @@ class ThreadController extends Controller return view("thread_view")->withThread($thread); } - /** - * Show the form for editing the specified resource. - * - * @param \App\Thread $thread - * @return \Illuminate\Http\Response - */ - public function edit(Thread $thread) - { - return view("edit")->withThread($thread); - } - /** * Update the specified resource in storage. * @@ -90,6 +90,6 @@ class ThreadController extends Controller */ public function destroy(Thread $thread) { - // + $thread->delete(); } } diff --git a/app/Http/Resources/TagCollection.php b/app/Http/Resources/TagCollection.php index cf199ce..59ee2ac 100644 --- a/app/Http/Resources/TagCollection.php +++ b/app/Http/Resources/TagCollection.php @@ -18,4 +18,4 @@ class TagCollection extends ResourceCollection "data" => $this->$collection ]; } -} +} \ No newline at end of file From 6e8aad9241c83cad1037403445888a7ce854ccf0 Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Wed, 10 Apr 2019 01:04:31 -0400 Subject: [PATCH 03/10] Back end finishedgit add .git add .git add .git add .git add .git add .git add .git add .git add . --- app/Http/Controllers/PostController.php | 15 +- app/Http/Controllers/ThreadController.php | 8 +- app/Providers/RouteServiceProvider.php | 4 + public/js/app.js | 7 +- resources/js/components/ThreadComponent.vue | 4 +- routes/api.php | 36 +- test_responses/threadgetresponse.html | 1232 +++++++++++++++++++ test_responses/updatedumpresponse.html | 129 ++ 8 files changed, 1413 insertions(+), 22 deletions(-) create mode 100644 test_responses/threadgetresponse.html create mode 100644 test_responses/updatedumpresponse.html diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php index b25629f..b095318 100644 --- a/app/Http/Controllers/PostController.php +++ b/app/Http/Controllers/PostController.php @@ -8,25 +8,14 @@ use Illuminate\Http\Request; class PostController extends Controller { - /** - * Display a listing of the resource. - * - * @param integer $thread_id - * @return \Illuminate\Http\Response - */ - public function index(Thread $thread) - { - // - } - /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ - public function create(Thread $thread) + public function create(Thread $post) { - return view("create_post")->withThread($thread); + return view("create_post")->withThread($post); } /** diff --git a/app/Http/Controllers/ThreadController.php b/app/Http/Controllers/ThreadController.php index c5ebe58..4963ab7 100644 --- a/app/Http/Controllers/ThreadController.php +++ b/app/Http/Controllers/ThreadController.php @@ -51,7 +51,7 @@ class ThreadController extends Controller $thread = new Thread; $thread->thread_title = $request->thread_title; - $thread->thread_poster_id = $request->user_id; + $thread->thread_creator_id = $request->user_id; $thread->save(); } @@ -63,10 +63,10 @@ class ThreadController extends Controller * - A thread ID * @return \Illuminate\Http\Response */ - public function show(integer $id) + public function show(int $id) { - $thread = ThreadsCollection(Thread::find($id)->with("posts")->get()); - return view("thread_view")->withThread($thread); + $selected_thread = new ThreadsCollection(Thread::with("posts")->get()->where("id", $id)); + return $selected_thread; } /** diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 5ea48d3..1e08769 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -26,6 +26,10 @@ class RouteServiceProvider extends ServiceProvider // parent::boot(); + + Route::model('thread', 'App\Thread'); + Route::model('post', 'App\Post'); + Route::model('tag', 'App\Tag'); } /** diff --git a/public/js/app.js b/public/js/app.js index 998f46c..e31df4b 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -36855,8 +36855,11 @@ var render = function() { _vm._v(" "), _vm._l(_vm.threads, function(thread) { return _c("div", { key: thread.id, staticClass: "card card-body" }, [ - _c("p", [_vm._v(_vm._s(thread.creator.name) + "\n ")]), - _c("h3", [_vm._v(_vm._s(thread.thread_title))]) + _c("p", [_vm._v(_vm._s(thread.creator.name))]), + _vm._v(" "), + _c("a", { attrs: { href: "./test/" + thread.id } }, [ + _c("h3", [_vm._v(_vm._s(thread.thread_title))]) + ]) ]) }) ], diff --git a/resources/js/components/ThreadComponent.vue b/resources/js/components/ThreadComponent.vue index 06a3ff8..90d50be 100644 --- a/resources/js/components/ThreadComponent.vue +++ b/resources/js/components/ThreadComponent.vue @@ -2,8 +2,8 @@

Browse Threads

-

{{ thread.creator.name }} -

{{ thread.thread_title }}

+

{{ thread.creator.name }}

+

{{ thread.thread_title }}

diff --git a/routes/api.php b/routes/api.php index 8c2120f..03005d7 100644 --- a/routes/api.php +++ b/routes/api.php @@ -17,4 +17,38 @@ Route::middleware('auth:api')->get('/user', function (Request $request) { return $request->user(); }); -Route::get('threads', 'ThreadController@index'); \ No newline at end of file +/**- + * Thread routes + */ +$thread_prefix = "thread"; + +//Gets +Route::get('threads', 'ThreadController@index'); +Route::get($thread_prefix . '/{id}', 'ThreadController@show'); + +//Posts +Route::post($thread_prefix . '/update/{thread}', 'ThreadController@update'); +Route::post($thread_prefix . '/store', 'ThreadController@store'); +Route::post($thread_prefix . '/destroy/{thread}', 'ThreadController@destroy'); + +/** + * Post routes + */ +$post_prefix = "post"; + +//Posts +Route::post($post_prefix . '/update/{post}', 'PostController@update'); +Route::post($post_prefix . '/store', 'PostController@store'); +Route::post($post_prefix . '/destroy/{post}', 'PostController@destroy'); + + /** + * Tag routes + */ +$tag_prefix = "tag"; +Route::get('tags', 'TagController@index'); +Route::get($tag_prefix . '/{id}', 'TagController@show'); + +//Posts +Route::post($tag_prefix . '/update/{tag}', 'TagController@update'); +Route::post($tag_prefix . '/store', 'TagController@store'); +Route::post($tag_prefix . '/destroy/{tag}', 'TagController@destroy'); \ No newline at end of file diff --git a/test_responses/threadgetresponse.html b/test_responses/threadgetresponse.html new file mode 100644 index 0000000..20dacfa --- /dev/null +++ b/test_responses/threadgetresponse.html @@ -0,0 +1,1232 @@ + + + + + + Whoops! There was an error. + + + + + +
+
+ +
+
+
+
+ Symfony \ Component \ Debug \ Exception \ FatalThrowableError + (E_ERROR) +
+ +
+ Call to undefined function App\Http\Controllers\ThreadsCollection() + + + + + + + + + Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Call to undefined function App\Http\Controllers\ThreadsCollection()" + +Stacktrace: +#0 Symfony\Component\Debug\Exception\FatalThrowableError in /home/bkains/Git/GamingForum/app/Http/Controllers/ThreadController.php:68 + + +
+
+
+
+ + Application frames (1) + + + All frames (1) + +
+
+
+ 0 +
+
Symfony
\
Component
\
Debug
\
Exception
\
FatalThrowableError
+
+
+ +
+
/
app
/
Http
/
Controllers
/
ThreadController.php
68 +
+
+
+
+
+
+
+
/
home
/
bkains
/
Git
/
GamingForum
/
app
/
Http
/
Controllers
/
ThreadController.php
+
+
    public function store(Request $request)
+    {
+        $thread = new Thread;
+        
+        $thread->thread_title = $request->thread_title;
+        $thread->thread_creator_id = $request->user_id;
+ 
+        $thread->save();
+    }
+ 
+    /**
+     * Display the specified resource.
+     *
+     * @param integer $id
+     *  - A thread ID
+     * @return \Illuminate\Http\Response
+     */
+    public function show(int $id)
+    {
+        $thread = ThreadsCollection(Thread::find($id)->with("posts")->get());
+        return view("thread_view")->withThread($thread);
+    }
+ 
+    /**
+     * Update the specified resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \App\Thread  $thread
+     * @return \Illuminate\Http\Response
+     */
+    public function update(Request $request, Thread $thread)
+    {
+        $thread->thread_title = $request->thread_title;
+        $thread->save();
+    }
+ 
+    /**
+     * Remove the specified resource from storage.
+     *
+     * @param  \App\Thread  $thread
+ + +
+ Arguments +
+
+
  1. "Call to undefined function App\Http\Controllers\ThreadsCollection()"
    +
    +
+ +
+
+ +
+
+
+

Environment & details:

+ +
+
+ + empty +
+
+ + empty +
+
+ + empty +
+
+ + empty +
+
+ + empty +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyValue
DOCUMENT_ROOT
"/home/bkains/Git/GamingForum/public"
+
+
REMOTE_ADDR
"127.0.0.1"
+
+
REMOTE_PORT
"49676"
+
+
SERVER_SOFTWARE
"PHP 7.2.16 Development Server"
+
+
SERVER_PROTOCOL
"HTTP/1.1"
+
+
SERVER_NAME
"127.0.0.1"
+
+
SERVER_PORT
"8000"
+
+
REQUEST_URI
"/api/thread/1"
+
+
REQUEST_METHOD
"GET"
+
+
SCRIPT_NAME
"/index.php"
+
+
SCRIPT_FILENAME
"/home/bkains/Git/GamingForum/public/index.php"
+
+
PATH_INFO
"/api/thread/1"
+
+
PHP_SELF
"/index.php/api/thread/1"
+
+
CONTENT_TYPE
"application/x-www-form-urlencoded"
+
+
HTTP_CONTENT_TYPE
"application/x-www-form-urlencoded"
+
+
HTTP_CACHE_CONTROL
"no-cache"
+
+
HTTP_POSTMAN_TOKEN
"96c14108-10d7-4b48-8a8b-4aaa8a00e19e"
+
+
HTTP_USER_AGENT
"PostmanRuntime/7.6.1"
+
+
HTTP_ACCEPT
"*/*"
+
+
HTTP_HOST
"localhost:8000"
+
+
HTTP_ACCEPT_ENCODING
"gzip, deflate"
+
+
HTTP_CONNECTION
"keep-alive"
+
+
REQUEST_TIME_FLOAT
1554837063.3276
+
+
REQUEST_TIME
1554837063
+
+
+
+
+ + empty +
+
+ +
+ +
+ 0. Whoops\Handler\PrettyPageHandler
+
+ +
+
+
+
+ + + + + + + diff --git a/test_responses/updatedumpresponse.html b/test_responses/updatedumpresponse.html new file mode 100644 index 0000000..5bfc4b1 --- /dev/null +++ b/test_responses/updatedumpresponse.html @@ -0,0 +1,129 @@ +
Request {#43
+  #json: null
+  #convertedFiles: []
+  #userResolver: Closure($guard = null) {#192
+    class: "Illuminate\Auth\AuthServiceProvider"
+    this: AuthServiceProvider {#40 …}
+    parameters: {
+      $guard: {
+        default: null
+      }
+    }
+    use: {
+      $app: Application {#2 …}
+    }
+    file: "/home/bkains/Git/GamingForum/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php"
+    line: "85 to 87"
+  }
+  #routeResolver: Closure() {#194
+    class: "Illuminate\Routing\Router"
+    this: Router {#26 …}
+    use: {
+      $route: Route {#141 …}
+    }
+    file: "/home/bkains/Git/GamingForum/vendor/laravel/framework/src/Illuminate/Routing/Router.php"
+    line: "650 to 652"
+  }
+  +attributes: ParameterBag {#45
+    #parameters: []
+  }
+  +request: ParameterBag {#44
+    #parameters: []
+  }
+  +query: ParameterBag {#51
+    #parameters: []
+  }
+  +server: ServerBag {#47
+    #parameters: array:26 [
+      "DOCUMENT_ROOT" => "/home/bkains/Git/GamingForum/public"
+      "REMOTE_ADDR" => "127.0.0.1"
+      "REMOTE_PORT" => "57994"
+      "SERVER_SOFTWARE" => "PHP 7.2.16 Development Server"
+      "SERVER_PROTOCOL" => "HTTP/1.1"
+      "SERVER_NAME" => "127.0.0.1"
+      "SERVER_PORT" => "8000"
+      "REQUEST_URI" => "/api/thread/update/4"
+      "REQUEST_METHOD" => "PATCH"
+      "SCRIPT_NAME" => "/index.php"
+      "SCRIPT_FILENAME" => "/home/bkains/Git/GamingForum/public/index.php"
+      "PATH_INFO" => "/api/thread/update/4"
+      "PHP_SELF" => "/index.php/api/thread/update/4"
+      "HTTP_CACHE_CONTROL" => "no-cache"
+      "HTTP_POSTMAN_TOKEN" => "e7eeb739-2d0c-413c-8bc4-104d58b80d58"
+      "HTTP_USER_AGENT" => "PostmanRuntime/7.6.1"
+      "HTTP_ACCEPT" => "*/*"
+      "HTTP_HOST" => "localhost:8000"
+      "HTTP_ACCEPT_ENCODING" => "gzip, deflate"
+      "CONTENT_TYPE" => "multipart/form-data; boundary=--------------------------909217796805609421657437"
+      "HTTP_CONTENT_TYPE" => "multipart/form-data; boundary=--------------------------909217796805609421657437"
+      "CONTENT_LENGTH" => "180"
+      "HTTP_CONTENT_LENGTH" => "180"
+      "HTTP_CONNECTION" => "keep-alive"
+      "REQUEST_TIME_FLOAT" => 1554871991.338
+      "REQUEST_TIME" => 1554871991
+    ]
+  }
+  +files: FileBag {#48
+    #parameters: []
+  }
+  +cookies: ParameterBag {#46
+    #parameters: []
+  }
+  +headers: HeaderBag {#49
+    #headers: array:9 [
+      "cache-control" => array:1 [
+        0 => "no-cache"
+      ]
+      "postman-token" => array:1 [
+        0 => "e7eeb739-2d0c-413c-8bc4-104d58b80d58"
+      ]
+      "user-agent" => array:1 [
+        0 => "PostmanRuntime/7.6.1"
+      ]
+      "accept" => array:1 [
+        0 => "*/*"
+      ]
+      "host" => array:1 [
+        0 => "localhost:8000"
+      ]
+      "accept-encoding" => array:1 [
+        0 => "gzip, deflate"
+      ]
+      "content-type" => array:1 [
+        0 => "multipart/form-data; boundary=--------------------------909217796805609421657437"
+      ]
+      "content-length" => array:1 [
+        0 => "180"
+      ]
+      "connection" => array:1 [
+        0 => "keep-alive"
+      ]
+    ]
+    #cacheControl: array:1 [
+      "no-cache" => true
+    ]
+  }
+  #content: null
+  #languages: null
+  #charsets: null
+  #encodings: null
+  #acceptableContentTypes: null
+  #pathInfo: "/api/thread/update/4"
+  #requestUri: "/api/thread/update/4"
+  #baseUrl: ""
+  #basePath: null
+  #method: "PATCH"
+  #format: null
+  #session: null
+  #locale: null
+  #defaultLocale: "en"
+  -isHostValid: true
+  -isForwardedValid: true
+  basePath: ""
+  format: "html"
+}
+
From 3530857e3f1f1ae135a95043ca4f7010b2ccaba5 Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Wed, 10 Apr 2019 02:24:44 -0400 Subject: [PATCH 04/10] fixed gitignore to remove test_responses --- .gitignore | 1 + .../js/components/ThreadCreateComponent.vue | 0 routes/.api.php.swp | Bin 0 -> 12288 bytes 3 files changed, 1 insertion(+) create mode 100644 resources/js/components/ThreadCreateComponent.vue create mode 100644 routes/.api.php.swp diff --git a/.gitignore b/.gitignore index a4854be..2cf2893 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ vendor/ node_modules/ npm-debug.log +test-responses/ # Laravel 4 specific bootstrap/compiled.php diff --git a/resources/js/components/ThreadCreateComponent.vue b/resources/js/components/ThreadCreateComponent.vue new file mode 100644 index 0000000..e69de29 diff --git a/routes/.api.php.swp b/routes/.api.php.swp new file mode 100644 index 0000000000000000000000000000000000000000..0300ebbbbf952f7338f3dc32478ab148ee4fffb9 GIT binary patch literal 12288 zcmeI2O>fjj7{>=L<+V`w0uS4jHraO91f&9?gf~Hw15y-{N^K*d$$GLLaBO!xW?2P_ zxbqcy>j|lsUJ&%qeu+x0;0sVyN)MGPdg_1d-DF=(gbJ5PkEP#w{qj8X%+E7cR+-h4 zU(Da2v&|`i?WhnJyFaXKesDniG$+LB9jT+#UD$aGZD8bapeRZKeqgC zIXRjQumLu}2G{@_U;}J`4X}Y-WxytT#6wiPw^#L<-hR)>zIVtwHoykh02^QfY=8~0 z0XDz}*Z><~18iUy8j!va|LhZDb3cm5|Nr~H|NlKA#B1;pya2y}$KWA24W_`W4~6(1 zNN@|RfUm(v;P1mi`~^0_AK-WJD|il`fgiyma0Ofj=fIzbgm?nJ0$+kSnP;0CS6u;~w}38SZE7!BTMhTe)v=-dl3t`i+;JHO z0&D1RI$p4je09&=IwtSOum9ukXNs7l~g!(pXHL>mApRJlXA^N zrUo+&X $_dFWi7wyiMRZ*h4I+z0<+@TZUJk)6cM|}_D8f;*c^vgvQ*NR7#-}V+V zhVu>SSQ^byE@V7IU&&7OlxP_kNY(MATZ3?{skH}Xdsa|1Jv z*?uHT`SHL*X$bKEedE?&_9WF!5dOD?=S^ z109hp5>qG8tpG{p6v9zVCvaboo?0@3h_+5GqR>>oowe8$&C4VSbxXQFHfbqPsd7DP tytfTixn}cTr0+GchZhl^63vHUhL!essjkdfo2>L66kg$ Date: Wed, 10 Apr 2019 02:26:19 -0400 Subject: [PATCH 05/10] Revert "fixed gitignore to remove test_responses" This reverts commit 3530857e3f1f1ae135a95043ca4f7010b2ccaba5. --- .gitignore | 1 - .../js/components/ThreadCreateComponent.vue | 0 routes/.api.php.swp | Bin 12288 -> 0 bytes 3 files changed, 1 deletion(-) delete mode 100644 resources/js/components/ThreadCreateComponent.vue delete mode 100644 routes/.api.php.swp diff --git a/.gitignore b/.gitignore index 2cf2893..a4854be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ vendor/ node_modules/ npm-debug.log -test-responses/ # Laravel 4 specific bootstrap/compiled.php diff --git a/resources/js/components/ThreadCreateComponent.vue b/resources/js/components/ThreadCreateComponent.vue deleted file mode 100644 index e69de29..0000000 diff --git a/routes/.api.php.swp b/routes/.api.php.swp deleted file mode 100644 index 0300ebbbbf952f7338f3dc32478ab148ee4fffb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2O>fjj7{>=L<+V`w0uS4jHraO91f&9?gf~Hw15y-{N^K*d$$GLLaBO!xW?2P_ zxbqcy>j|lsUJ&%qeu+x0;0sVyN)MGPdg_1d-DF=(gbJ5PkEP#w{qj8X%+E7cR+-h4 zU(Da2v&|`i?WhnJyFaXKesDniG$+LB9jT+#UD$aGZD8bapeRZKeqgC zIXRjQumLu}2G{@_U;}J`4X}Y-WxytT#6wiPw^#L<-hR)>zIVtwHoykh02^QfY=8~0 z0XDz}*Z><~18iUy8j!va|LhZDb3cm5|Nr~H|NlKA#B1;pya2y}$KWA24W_`W4~6(1 zNN@|RfUm(v;P1mi`~^0_AK-WJD|il`fgiyma0Ofj=fIzbgm?nJ0$+kSnP;0CS6u;~w}38SZE7!BTMhTe)v=-dl3t`i+;JHO z0&D1RI$p4je09&=IwtSOum9ukXNs7l~g!(pXHL>mApRJlXA^N zrUo+&X $_dFWi7wyiMRZ*h4I+z0<+@TZUJk)6cM|}_D8f;*c^vgvQ*NR7#-}V+V zhVu>SSQ^byE@V7IU&&7OlxP_kNY(MATZ3?{skH}Xdsa|1Jv z*?uHT`SHL*X$bKEedE?&_9WF!5dOD?=S^ z109hp5>qG8tpG{p6v9zVCvaboo?0@3h_+5GqR>>oowe8$&C4VSbxXQFHfbqPsd7DP tytfTixn}cTr0+GchZhl^63vHUhL!essjkdfo2>L66kg$ Date: Wed, 10 Apr 2019 02:31:15 -0400 Subject: [PATCH 06/10] fixed gitignore to ignore test_responses --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a4854be..48a823f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ vendor/ node_modules/ npm-debug.log +test_responses/ # Laravel 4 specific bootstrap/compiled.php From b6cdb63cd2cc0d4e3ffec745c1c8e536b55e80a0 Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Wed, 10 Apr 2019 03:46:27 -0400 Subject: [PATCH 07/10] a couple more components started --- public/js/app.js | 343 ++++++++++++++++++ resources/js/app.js | 2 + .../js/components/CreateThreadComponent.vue | 44 +++ resources/js/components/ExampleComponent.vue | 23 -- .../js/components/TagSelectComponent.vue | 35 ++ routes/.api.php.swp | Bin 0 -> 12288 bytes 6 files changed, 424 insertions(+), 23 deletions(-) create mode 100644 resources/js/components/CreateThreadComponent.vue delete mode 100644 resources/js/components/ExampleComponent.vue create mode 100644 resources/js/components/TagSelectComponent.vue create mode 100644 routes/.api.php.swp diff --git a/public/js/app.js b/public/js/app.js index e31df4b..616ba01 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1752,6 +1752,106 @@ module.exports = { }; +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js&": +/*!********************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js& ***! + \********************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +// +// +// +// +// +// +// +// +// +// +// +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['user_id'], + data: function data() { + return { + thread_title: '', + edit: true + }; + }, + methods: { + createThread: function createThread() { + var _this = this; + + fetch("api/thread/store", { + method: "post", + body: { + thread_title: this.thread_title, + user_id: this.user_id + }, + headers: { + 'content-type': 'application/json' + } + }).then(function (res) { + return res.json; + }).then(function (data) { + _this.thread_title = ''; + alert("it might have worked"); + }).catch(function (err) { + return console.log(err); + }); + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&": +/*!*****************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js& ***! + \*****************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +// +// +// +// +// +// +// +// +/* harmony default export */ __webpack_exports__["default"] = ({ + data: function data() { + return { + tags: [], + tag: { + id: '', + tag_text: '' + } + }; + }, + created: function created() { + this.fetchTags(); + }, + methods: { + fetchTags: function fetchTags() { + var _this = this; + + fetch("api/tags").then(function (res) { + return res.json(); + }).then(function (res) { + _this.tags = res.data; + }); + } + } +}); + /***/ }), /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&": @@ -36831,6 +36931,109 @@ exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c&": +/*!************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c& ***! + \************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "form", + { + staticClass: "mb-3", + on: { + submit: function($event) { + $event.preventDefault() + return _vm.createThread($event) + } + } + }, + [ + _c("div", { staticClass: "form-group" }, [ + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.thread_title, + expression: "thread_title" + } + ], + staticClass: "form-control", + attrs: { type: "text", placeholder: "Title" }, + domProps: { value: _vm.thread_title }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.thread_title = $event.target.value + } + } + }) + ]), + _vm._v(" "), + _vm._m(0) + ] + ) +} +var staticRenderFns = [ + function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", { staticClass: "form-group" }, [ + _c("button", { staticClass: "btn btn-light", attrs: { type: "submit" } }) + ]) + } +] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&": +/*!*********************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292& ***! + \*********************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + _vm._l(_vm.tags, function(tag) { + return _c("div", { key: tag.id, staticClass: "card card-body" }, [ + _c("p", [_vm._v(_vm._s(tag.tag_text))]) + ]) + }), + 0 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&": @@ -49035,6 +49238,8 @@ window.Vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common. // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)); Vue.component('thread-component', __webpack_require__(/*! ./components/ThreadComponent.vue */ "./resources/js/components/ThreadComponent.vue").default); +Vue.component('tag_selector', __webpack_require__(/*! ./components/TagSelectComponent.vue */ "./resources/js/components/TagSelectComponent.vue").default); +Vue.component('thread-create-form', __webpack_require__(/*! ./components/CreateThreadComponent.vue */ "./resources/js/components/CreateThreadComponent.vue").default); /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application @@ -49103,6 +49308,144 @@ if (token) { // encrypted: true // }); +/***/ }), + +/***/ "./resources/js/components/CreateThreadComponent.vue": +/*!***********************************************************!*\ + !*** ./resources/js/components/CreateThreadComponent.vue ***! + \***********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CreateThreadComponent.vue?vue&type=template&id=69e9049c& */ "./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c&"); +/* harmony import */ var _CreateThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CreateThreadComponent.vue?vue&type=script&lang=js& */ "./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _CreateThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__["render"], + _CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/CreateThreadComponent.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js&": +/*!************************************************************************************!*\ + !*** ./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js& ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./CreateThreadComponent.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CreateThreadComponent.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c&": +/*!******************************************************************************************!*\ + !*** ./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c& ***! + \******************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./CreateThreadComponent.vue?vue&type=template&id=69e9049c& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CreateThreadComponent.vue?vue&type=template&id=69e9049c&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CreateThreadComponent_vue_vue_type_template_id_69e9049c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/TagSelectComponent.vue": +/*!********************************************************!*\ + !*** ./resources/js/components/TagSelectComponent.vue ***! + \********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TagSelectComponent.vue?vue&type=template&id=6b77d292& */ "./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&"); +/* harmony import */ var _TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TagSelectComponent.vue?vue&type=script&lang=js& */ "./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["render"], + _TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/TagSelectComponent.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&": +/*!*********************************************************************************!*\ + !*** ./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js& ***! + \*********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./TagSelectComponent.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&": +/*!***************************************************************************************!*\ + !*** ./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292& ***! + \***************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./TagSelectComponent.vue?vue&type=template&id=6b77d292& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + /***/ }), /***/ "./resources/js/components/ThreadComponent.vue": diff --git a/resources/js/app.js b/resources/js/app.js index dc8570e..4359fcc 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -21,6 +21,8 @@ window.Vue = require('vue'); // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)); Vue.component('thread-component', require('./components/ThreadComponent.vue').default); +Vue.component('tag_selector', require('./components/TagSelectComponent.vue').default); +Vue.component('thread-create-form', require('./components/CreateThreadComponent.vue').default); /** * Next, we will create a fresh Vue application instance and attach it to diff --git a/resources/js/components/CreateThreadComponent.vue b/resources/js/components/CreateThreadComponent.vue new file mode 100644 index 0000000..a43152a --- /dev/null +++ b/resources/js/components/CreateThreadComponent.vue @@ -0,0 +1,44 @@ + + + \ No newline at end of file diff --git a/resources/js/components/ExampleComponent.vue b/resources/js/components/ExampleComponent.vue deleted file mode 100644 index 3fb9f9a..0000000 --- a/resources/js/components/ExampleComponent.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - diff --git a/resources/js/components/TagSelectComponent.vue b/resources/js/components/TagSelectComponent.vue new file mode 100644 index 0000000..e98a0c0 --- /dev/null +++ b/resources/js/components/TagSelectComponent.vue @@ -0,0 +1,35 @@ + + + \ No newline at end of file diff --git a/routes/.api.php.swp b/routes/.api.php.swp new file mode 100644 index 0000000000000000000000000000000000000000..8335dd3907c91a2df72351723a807d9e8d459527 GIT binary patch literal 12288 zcmeI2&uxb%YH0{;Y3EBX(#suT`fs5tPQT|4oQ4b34J#9QfOdv|8uzW3P~OO|K( z*yXtk^nGJe;5aD6$d8bmk{~G=$d}jv8`uK_2gLDjCXcy5UsaCKp)W7(K}-(8 z2G{@_U;}J`4X^<=zy{dByJEm5`@}6I`$0G1Z@cgNhTglU{Kf{@02^QfY=8~00XDz} z*Z><~18jf|yn_a$FU0GQgn02WlE?r5z2E=;eJ;c+@E3Rv{s4EtEpQx6g1eNz!%`<0mKBG;2-cOcm^JWN8opG8=MBGzzOj0r$XEZSHTr<37i9`!BJ2L74ZBM zA?|{UU;$hJGvEZMf>-;6cnY3?had&t0axRutCJ5lzy{a=8(;%$fDODy1{U02%c-dZ zyEVtER<^DuMy=>|q6XDGU!~T>9d82-H)~&0ZBe$)#1XEAp)x;pn``6KVy7@JN@`=H zMn@Ny|7UEL_|mGK5-3{T{XK6U6<}{_H<6YaEXU=sq5YB~(jad4Rp18JP;NS!u#SAS z?z;AS`jIN=U6~d{b3ZycCY1*T}z&yt7I3J`y&l#9vWZnd3bbB zw7XuGMTzQae++nVr%r_PP^WpE^*oGfuz^w1FBeg?6^|Ri>nAF8%AYOE$R8%$w$c5QrOCSNa}>x>1nl0{9c zhs>srk7h2vMvrLN*k}(np}>P97_le^Hq=-Bj}?UemrZ)Ydl85y>JjwFBJ@5ahhV za3s?X+y{iGri>t>rBjPhxK-~yE3qkVFOwwHP3dZE&|;uc@VvebQ0(?a}k(rvbX0|NUwApigX literal 0 HcmV?d00001 From 1e47c49c6c83ce9bc240cce704618e661043d2ea Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Wed, 10 Apr 2019 20:56:05 -0400 Subject: [PATCH 08/10] Retrieval components working, Guest vs Logged In working --- app/Http/Controllers/PostController.php | 13 +- app/Http/Controllers/ThreadController.php | 14 +- app/Http/Resources/PostCollection.php | 2 +- public/js/app.js | 225 ++++++++++-------- resources/js/app.js | 5 +- .../js/components/ThreadViewComponent.vue | 58 +++++ resources/views/create_thread.blade.php | 9 + resources/views/home.blade.php | 2 +- resources/views/layouts/app.blade.php | 7 +- resources/views/thread.blade.php | 9 + ...{dashboard.blade.php => threads.blade.php} | 0 routes/.api.php.swp | Bin 12288 -> 0 bytes routes/api.php | 2 + routes/web.php | 12 +- 14 files changed, 247 insertions(+), 111 deletions(-) create mode 100644 resources/js/components/ThreadViewComponent.vue create mode 100644 resources/views/create_thread.blade.php create mode 100644 resources/views/thread.blade.php rename resources/views/{dashboard.blade.php => threads.blade.php} (100%) delete mode 100644 routes/.api.php.swp diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php index b095318..8b42368 100644 --- a/app/Http/Controllers/PostController.php +++ b/app/Http/Controllers/PostController.php @@ -3,7 +3,7 @@ namespace App\Http\Controllers; use App\Post; -use App\PostCollection; +use App\Http\Resources\PostCollection; use Illuminate\Http\Request; class PostController extends Controller @@ -29,6 +29,17 @@ class PostController extends Controller return view("edit_post")->withPost($post); } + /** + * Show the posts for a certain thread. + * + * @param int $thread + */ + public function show(int $thread_id) { + $posts = new PostCollection(Post::with("poster")->get()->where("thread_id", $thread_id)); +//dd($posts); + return $posts; + } + /** * Store a newly created resource in storage. * diff --git a/app/Http/Controllers/ThreadController.php b/app/Http/Controllers/ThreadController.php index 4963ab7..1f121c3 100644 --- a/app/Http/Controllers/ThreadController.php +++ b/app/Http/Controllers/ThreadController.php @@ -29,6 +29,15 @@ class ThreadController extends Controller return view("create_thread"); } + /** + * Show thread view. + * + * @param int $thread + */ + public function view_thread(int $thread_id) { + return view("thread")->with("thread_id", $thread_id); + } + /** * Show the form for editing the specified resource. * @@ -65,8 +74,9 @@ class ThreadController extends Controller */ public function show(int $id) { - $selected_thread = new ThreadsCollection(Thread::with("posts")->get()->where("id", $id)); - return $selected_thread; + $selected_thread = new ThreadsCollection(Thread::with("creator")->get()->where("id", $id)); +//dd(Thread::with("posts")->get()->where("id", $id)); + return Thread::with("creator")->find($id);//$selected_thread; } /** diff --git a/app/Http/Resources/PostCollection.php b/app/Http/Resources/PostCollection.php index 5343616..5afb80d 100644 --- a/app/Http/Resources/PostCollection.php +++ b/app/Http/Resources/PostCollection.php @@ -15,7 +15,7 @@ class PostCollection extends ResourceCollection public function toArray($request) { return [ - 'data' => $this->$collection + 'data' => $this->collection ]; } } diff --git a/public/js/app.js b/public/js/app.js index 616ba01..566668b 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1809,10 +1809,10 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&": -/*!*****************************************************************************************************************************************************************************!*\ - !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js& ***! - \*****************************************************************************************************************************************************************************/ +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&": +/*!**************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js& ***! + \**************************************************************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -1826,27 +1826,34 @@ __webpack_require__.r(__webpack_exports__); // // // +// +// /* harmony default export */ __webpack_exports__["default"] = ({ data: function data() { return { - tags: [], - tag: { + threads: [], + thread: { id: '', - tag_text: '' - } + thread_title: '', + creator: { + name: '' + } + }, + thread_id: '', + edit: false }; }, created: function created() { - this.fetchTags(); + this.fetchThreads(); }, methods: { - fetchTags: function fetchTags() { + fetchThreads: function fetchThreads() { var _this = this; - fetch("api/tags").then(function (res) { + fetch("api/threads").then(function (res) { return res.json(); }).then(function (res) { - _this.tags = res.data; + _this.threads = res.data; }); } } @@ -1854,10 +1861,10 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&": -/*!**************************************************************************************************************************************************************************!*\ - !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js& ***! - \**************************************************************************************************************************************************************************/ +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadViewComponent.vue?vue&type=script&lang=js&": +/*!******************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ThreadViewComponent.vue?vue&type=script&lang=js& ***! + \******************************************************************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -1873,33 +1880,50 @@ __webpack_require__.r(__webpack_exports__); // // // +// /* harmony default export */ __webpack_exports__["default"] = ({ + props: ['thread_id'], data: function data() { return { - threads: [], - thread: { + id: '', + thread_title: '', + creator: { + name: '' + }, + posts: [], + post: { id: '', - thread_title: '', - creator: { + content: '', + poster: { name: '' } - }, - thread_id: '', - edit: false + } }; }, created: function created() { - this.fetchThreads(); + this.fetchThread(); }, methods: { - fetchThreads: function fetchThreads() { + fetchThread: function fetchThread() { var _this = this; - fetch("api/threads").then(function (res) { + fetch("../api/thread/" + this.thread_id).then(function (res) { return res.json(); }).then(function (res) { - _this.threads = res.data; + _this.id = res.id; + _this.thread_title = res.thread_title; + _this.creator = res.creator; + }).catch(function (err) { + return console.log(err); + }); + fetch("../api/post/thread/" + this.thread_id).then(function (res) { + return res.json(); + }).then(function (res) { + _this.posts = res.data; + }).catch(function (err) { + return console.log(err); }); + ; } } }); @@ -37004,10 +37028,10 @@ render._withStripped = true /***/ }), -/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&": -/*!*********************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292& ***! - \*********************************************************************************************************************************************************************************************************************/ +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&": +/*!******************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610& ***! + \******************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -37021,12 +37045,20 @@ var render = function() { var _c = _vm._self._c || _h return _c( "div", - _vm._l(_vm.tags, function(tag) { - return _c("div", { key: tag.id, staticClass: "card card-body" }, [ - _c("p", [_vm._v(_vm._s(tag.tag_text))]) - ]) - }), - 0 + [ + _c("h2", [_vm._v("Browse Threads")]), + _vm._v(" "), + _vm._l(_vm.threads, function(thread) { + return _c("div", { key: thread.id, staticClass: "card card-body" }, [ + _c("p", [_vm._v(_vm._s(thread.creator.name))]), + _vm._v(" "), + _c("a", { attrs: { href: "./test/" + thread.id } }, [ + _c("h3", [_vm._v(_vm._s(thread.thread_title))]) + ]) + ]) + }) + ], + 2 ) } var staticRenderFns = [] @@ -37036,10 +37068,10 @@ render._withStripped = true /***/ }), -/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&": -/*!******************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610& ***! - \******************************************************************************************************************************************************************************************************************/ +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadViewComponent.vue?vue&type=template&id=14c8b65a&": +/*!**********************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ThreadViewComponent.vue?vue&type=template&id=14c8b65a& ***! + \**********************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -37054,15 +37086,15 @@ var render = function() { return _c( "div", [ - _c("h2", [_vm._v("Browse Threads")]), + _c("h2", [_vm._v(_vm._s(_vm.thread_title))]), _vm._v(" "), - _vm._l(_vm.threads, function(thread) { - return _c("div", { key: thread.id, staticClass: "card card-body" }, [ - _c("p", [_vm._v(_vm._s(thread.creator.name))]), + _c("h3", [_vm._v("By " + _vm._s(_vm.creator.name))]), + _vm._v(" "), + _vm._l(_vm.posts, function(post) { + return _c("div", { key: post.id, staticClass: "card card-body" }, [ + _c("p", [_vm._v(_vm._s(post.poster.name))]), _vm._v(" "), - _c("a", { attrs: { href: "./test/" + thread.id } }, [ - _c("h3", [_vm._v(_vm._s(thread.thread_title))]) - ]) + _c("p", [_vm._v(_vm._s(post.content))]) ]) }) ], @@ -49238,8 +49270,9 @@ window.Vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common. // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)); Vue.component('thread-component', __webpack_require__(/*! ./components/ThreadComponent.vue */ "./resources/js/components/ThreadComponent.vue").default); -Vue.component('tag_selector', __webpack_require__(/*! ./components/TagSelectComponent.vue */ "./resources/js/components/TagSelectComponent.vue").default); -Vue.component('thread-create-form', __webpack_require__(/*! ./components/CreateThreadComponent.vue */ "./resources/js/components/CreateThreadComponent.vue").default); +Vue.component('thread-view', __webpack_require__(/*! ./components/ThreadViewComponent.vue */ "./resources/js/components/ThreadViewComponent.vue").default); +Vue.component('thread-create', __webpack_require__(/*! ./components/CreateThreadComponent.vue */ "./resources/js/components/CreateThreadComponent.vue").default); //Vue.component('tag_selector', require('./components/TagSelectComponent.vue').default); + /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application @@ -49379,17 +49412,17 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/***/ "./resources/js/components/TagSelectComponent.vue": -/*!********************************************************!*\ - !*** ./resources/js/components/TagSelectComponent.vue ***! - \********************************************************/ +/***/ "./resources/js/components/ThreadComponent.vue": +/*!*****************************************************!*\ + !*** ./resources/js/components/ThreadComponent.vue ***! + \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TagSelectComponent.vue?vue&type=template&id=6b77d292& */ "./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&"); -/* harmony import */ var _TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TagSelectComponent.vue?vue&type=script&lang=js& */ "./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&"); +/* harmony import */ var _ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThreadComponent.vue?vue&type=template&id=fb8db610& */ "./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&"); +/* harmony import */ var _ThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ThreadComponent.vue?vue&type=script&lang=js& */ "./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); @@ -49399,9 +49432,9 @@ __webpack_require__.r(__webpack_exports__); /* normalize component */ var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( - _TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], - _TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["render"], - _TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + _ThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__["render"], + _ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, null, @@ -49411,54 +49444,54 @@ var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_ /* hot reload */ if (false) { var api; } -component.options.__file = "resources/js/components/TagSelectComponent.vue" +component.options.__file = "resources/js/components/ThreadComponent.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), -/***/ "./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&": -/*!*********************************************************************************!*\ - !*** ./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js& ***! - \*********************************************************************************/ +/***/ "./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&": +/*!******************************************************************************!*\ + !*** ./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js& ***! + \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./TagSelectComponent.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=script&lang=js&"); -/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./ThreadComponent.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), -/***/ "./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&": -/*!***************************************************************************************!*\ - !*** ./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292& ***! - \***************************************************************************************/ +/***/ "./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&": +/*!************************************************************************************!*\ + !*** ./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610& ***! + \************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./TagSelectComponent.vue?vue&type=template&id=6b77d292& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/TagSelectComponent.vue?vue&type=template&id=6b77d292&"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["render"]; }); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./ThreadComponent.vue?vue&type=template&id=fb8db610& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__["render"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TagSelectComponent_vue_vue_type_template_id_6b77d292___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); /***/ }), -/***/ "./resources/js/components/ThreadComponent.vue": -/*!*****************************************************!*\ - !*** ./resources/js/components/ThreadComponent.vue ***! - \*****************************************************/ +/***/ "./resources/js/components/ThreadViewComponent.vue": +/*!*********************************************************!*\ + !*** ./resources/js/components/ThreadViewComponent.vue ***! + \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThreadComponent.vue?vue&type=template&id=fb8db610& */ "./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&"); -/* harmony import */ var _ThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ThreadComponent.vue?vue&type=script&lang=js& */ "./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&"); +/* harmony import */ var _ThreadViewComponent_vue_vue_type_template_id_14c8b65a___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThreadViewComponent.vue?vue&type=template&id=14c8b65a& */ "./resources/js/components/ThreadViewComponent.vue?vue&type=template&id=14c8b65a&"); +/* harmony import */ var _ThreadViewComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ThreadViewComponent.vue?vue&type=script&lang=js& */ "./resources/js/components/ThreadViewComponent.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); @@ -49468,9 +49501,9 @@ __webpack_require__.r(__webpack_exports__); /* normalize component */ var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( - _ThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], - _ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__["render"], - _ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + _ThreadViewComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _ThreadViewComponent_vue_vue_type_template_id_14c8b65a___WEBPACK_IMPORTED_MODULE_0__["render"], + _ThreadViewComponent_vue_vue_type_template_id_14c8b65a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, null, @@ -49480,38 +49513,38 @@ var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_ /* hot reload */ if (false) { var api; } -component.options.__file = "resources/js/components/ThreadComponent.vue" +component.options.__file = "resources/js/components/ThreadViewComponent.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), -/***/ "./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&": -/*!******************************************************************************!*\ - !*** ./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js& ***! - \******************************************************************************/ +/***/ "./resources/js/components/ThreadViewComponent.vue?vue&type=script&lang=js&": +/*!**********************************************************************************!*\ + !*** ./resources/js/components/ThreadViewComponent.vue?vue&type=script&lang=js& ***! + \**********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./ThreadComponent.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=script&lang=js&"); -/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadViewComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./ThreadViewComponent.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadViewComponent.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadViewComponent_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), -/***/ "./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&": -/*!************************************************************************************!*\ - !*** ./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610& ***! - \************************************************************************************/ +/***/ "./resources/js/components/ThreadViewComponent.vue?vue&type=template&id=14c8b65a&": +/*!****************************************************************************************!*\ + !*** ./resources/js/components/ThreadViewComponent.vue?vue&type=template&id=14c8b65a& ***! + \****************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./ThreadComponent.vue?vue&type=template&id=fb8db610& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadComponent.vue?vue&type=template&id=fb8db610&"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__["render"]; }); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadViewComponent_vue_vue_type_template_id_14c8b65a___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./ThreadViewComponent.vue?vue&type=template&id=14c8b65a& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ThreadViewComponent.vue?vue&type=template&id=14c8b65a&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadViewComponent_vue_vue_type_template_id_14c8b65a___WEBPACK_IMPORTED_MODULE_0__["render"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadComponent_vue_vue_type_template_id_fb8db610___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ThreadViewComponent_vue_vue_type_template_id_14c8b65a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); diff --git a/resources/js/app.js b/resources/js/app.js index 4359fcc..769d868 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -21,8 +21,9 @@ window.Vue = require('vue'); // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)); Vue.component('thread-component', require('./components/ThreadComponent.vue').default); -Vue.component('tag_selector', require('./components/TagSelectComponent.vue').default); -Vue.component('thread-create-form', require('./components/CreateThreadComponent.vue').default); +Vue.component('thread-view', require('./components/ThreadViewComponent.vue').default); +Vue.component('thread-create', require('./components/CreateThreadComponent.vue').default); +//Vue.component('tag_selector', require('./components/TagSelectComponent.vue').default); /** * Next, we will create a fresh Vue application instance and attach it to diff --git a/resources/js/components/ThreadViewComponent.vue b/resources/js/components/ThreadViewComponent.vue new file mode 100644 index 0000000..28b319b --- /dev/null +++ b/resources/js/components/ThreadViewComponent.vue @@ -0,0 +1,58 @@ + + + \ No newline at end of file diff --git a/resources/views/create_thread.blade.php b/resources/views/create_thread.blade.php new file mode 100644 index 0000000..8dfc008 --- /dev/null +++ b/resources/views/create_thread.blade.php @@ -0,0 +1,9 @@ +@extends('layouts.app') + +@section('content') +
+
+ +
+
+@endsection \ No newline at end of file diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 05dfca9..4a20066 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -14,7 +14,7 @@ @endif - You are logged in! + diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index ee7767c..5b371f7 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -39,6 +39,9 @@