text: (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[7],{
  
  /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/admin/pages/post/add.vue?vue&type=script&lang=js&":
  /*!********************************************************************************************************************************************************************!*\
    !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/admin/pages/post/add.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 {
        form: new Form({
          title: '',
          description: '',
          image: '',
          category_id: ''
        })
      };
    },
    mounted: function mounted() {
      this.$store.dispatch('setCategory');
    },
    computed: {
      categories: function categories() {
        return this.$store.getters.getCategory;
      }
    },
    methods: {
      setImage: function setImage(event) {
        var _this = this;
  
        var file = event.target.files[0];
        var reader = new FileReader();
  
        reader.onload = function (event) {
          _this.form.image = event.target.result;
        };
  
        reader.readAsDataURL(file);
      },
      addCategory: function addCategory() {
        this.form.post('/api/post').then(function (_ref) {
          var data = _ref.data;
          Toast.fire({
            icon: 'success',
            title: data.data
          }); // this.$router.push({name:'post_list'})
        })["catch"](function (error) {
          console.log(error);
        });
      }
    }
  });
  
  /***/ }),
  
  /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/admin/pages/post/add.vue?vue&type=template&id=642fbe5b&":
  /*!************************************************************************************************************************************************************************************************************!*\
    !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/admin/pages/post/add.vue?vue&type=template&id=642fbe5b& ***!
    \************************************************************************************************************************************************************************************************************/
  /*! 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", { attrs: { id: "add_category" } }, [
      _c("div", { staticClass: "row" }, [
        _c("div", { staticClass: "col-12" }, [
          _c("div", { staticClass: "card" }, [
            _c("div", { staticClass: "card-header" }, [
              _c(
                "h3",
                { staticClass: "card-title float-right" },
                [
                  _c(
                    "router-link",
                    {
                      staticClass: "btn btn-warning",
                      attrs: { to: { name: "post_list" } }
                    },
                    [_vm._v("Back")]
                  )
                ],
                1
              )
            ]),
            _vm._v(" "),
            _c(
              "form",
              {
                attrs: { enctype: "multipart/form-data" },
                on: {
                  submit: function($event) {
                    $event.preventDefault()
                    return _vm.addCategory($event)
                  }
                }
              },
              [
                _c("div", { staticClass: "card-body" }, [
                  _c(
                    "div",
                    { staticClass: "form-group" },
                    [
                      _c("label", [_vm._v("Post title")]),
                      _vm._v(" "),
                      _c("input", {
                        directives: [
                          {
                            name: "model",
                            rawName: "v-model",
                            value: _vm.form.title,
                            expression: "form.title"
                          }
                        ],
                        staticClass: "form-control",
                        class: { "is-invalid": _vm.form.errors.has("title") },
                        attrs: { type: "text" },
                        domProps: { value: _vm.form.title },
                        on: {
                          input: function($event) {
                            if ($event.target.composing) {
                              return
                            }
                            _vm.$set(_vm.form, "title", $event.target.value)
                          }
                        }
                      }),
                      _vm._v(" "),
                      _c("has-error", {
                        attrs: { form: _vm.form, field: "title" }
                      })
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "div",
                    { staticClass: "form-group" },
                    [
                      _c("label", [_vm._v("Description")]),
                      _vm._v(" "),
                      _c("markdown-editor", {
                        class: {
                          "is-invalid": _vm.form.errors.has("description")
                        },
                        model: {
                          value: _vm.form.description,
                          callback: function($$v) {
                            _vm.$set(_vm.form, "description", $$v)
                          },
                          expression: "form.description"
                        }
                      }),
                      _vm._v(" "),
                      _c("has-error", {
                        attrs: { form: _vm.form, field: "description" }
                      })
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "form-group" }, [
                    _c("label", [_vm._v("Image")]),
                    _vm._v(" "),
                    _c("input", {
                      staticClass: "form-control",
                      attrs: { type: "file" },
                      on: {
                        change: function($event) {
                          return _vm.setImage($event)
                        }
                      }
                    }),
                    _vm._v(" "),
                    _c("img", {
                      attrs: { src: _vm.form.image, alt: "", width: "100" }
                    })
                  ]),
                  _vm._v(" "),
                  _c(
                    "div",
                    { staticClass: "form-group" },
                    [
                      _c("label", [_vm._v("Category")]),
                      _vm._v(" "),
                      _c(
                        "select",
                        {
                          directives: [
                            {
                              name: "model",
                              rawName: "v-model",
                              value: _vm.form.category_id,
                              expression: "form.category_id"
                            }
                          ],
                          staticClass: "form-control",
                          class: {
                            "is-invalid": _vm.form.errors.has("category_id")
                          },
                          on: {
                            change: function($event) {
                              var $$selectedVal = Array.prototype.filter
                                .call($event.target.options, function(o) {
                                  return o.selected
                                })
                                .map(function(o) {
                                  var val = "_value" in o ? o._value : o.value
                                  return val
                                })
                              _vm.$set(
                                _vm.form,
                                "category_id",
                                $event.target.multiple
                                  ? $$selectedVal
                                  : $$selectedVal[0]
                              )
                            }
                          }
                        },
                        [
                          _c("option", { attrs: { value: "" } }, [
                            _vm._v("Select Category")
                          ]),
                          _vm._v(" "),
                          _vm._l(_vm.categories, function(category, index) {
                            return _c(
                              "option",
                              { key: index, domProps: { value: category.id } },
                              [_vm._v(" " + _vm._s(category.name))]
                            )
                          })
                        ],
                        2
                      ),
                      _vm._v(" "),
                      _c("has-error", {
                        attrs: { form: _vm.form, field: "category_id" }
                      })
                    ],
                    1
                  )
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "card-footer" }, [
                  _c(
                    "button",
                    {
                      staticClass: "btn btn-primary",
                      attrs: { type: "submit", disabled: _vm.form.busy }
                    },
                    [_vm._v("Submit")]
                  )
                ])
              ]
            )
          ])
        ])
      ])
    ])
  }
  var staticRenderFns = []
  render._withStripped = true
  
  
  
  /***/ }),
  
  /***/ "./resources/js/admin/pages/post/add.vue":
  /*!***********************************************!*\
    !*** ./resources/js/admin/pages/post/add.vue ***!
    \***********************************************/
  /*! exports provided: default */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  __webpack_require__.r(__webpack_exports__);
  /* harmony import */ var _add_vue_vue_type_template_id_642fbe5b___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.vue?vue&type=template&id=642fbe5b& */ "./resources/js/admin/pages/post/add.vue?vue&type=template&id=642fbe5b&");
  /* harmony import */ var _add_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./add.vue?vue&type=script&lang=js& */ "./resources/js/admin/pages/post/add.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"])(
    _add_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
    _add_vue_vue_type_template_id_642fbe5b___WEBPACK_IMPORTED_MODULE_0__["render"],
    _add_vue_vue_type_template_id_642fbe5b___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
    false,
    null,
    null,
    null
    
  )
  
  /* hot reload */
  if (false) { var api; }
  component.options.__file = "resources/js/admin/pages/post/add.vue"
  /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  
  /***/ }),
  
  /***/ "./resources/js/admin/pages/post/add.vue?vue&type=script&lang=js&":
  /*!************************************************************************!*\
    !*** ./resources/js/admin/pages/post/add.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_add_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!./add.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/admin/pages/post/add.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_add_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 
  
  /***/ }),
  
  /***/ "./resources/js/admin/pages/post/add.vue?vue&type=template&id=642fbe5b&":
  /*!******************************************************************************!*\
    !*** ./resources/js/admin/pages/post/add.vue?vue&type=template&id=642fbe5b& ***!
    \******************************************************************************/
  /*! 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_add_vue_vue_type_template_id_642fbe5b___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!./add.vue?vue&type=template&id=642fbe5b& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/admin/pages/post/add.vue?vue&type=template&id=642fbe5b&");
  /* 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_add_vue_vue_type_template_id_642fbe5b___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_add_vue_vue_type_template_id_642fbe5b___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  
  
  
  /***/ })
  
  }]);