Ejemplo n.º 1
0
                                        <th width="" class="to_stock_section" @if($stockDetails->entry_type != 'Transfer') style="display:none;" @endif  >To Stock</th>
                                        <th width="">Remarks</th>
                                        <th width="">Action</th>
                                    </tr>

                                    </thead>
                                    <tbody>

                                    </tbody>
                                    <?php 
foreach ($stockDetails2 as $stckDetail) {
    $productsName2 = App\Product::find($stockDetails->product_id);
    $category = $productsName2->category->name;
    $subCategoryName = '';
    if ($productsName2->sub_category_id) {
        $subCategory = App\SubCategory::find($productsName2->sub_category_id);
        $subCategoryName = '(' . $subCategory->name . ')';
    }
    ?>
                                    <tr class="clone_">
                                        <td>
                                            <?php 
    echo $stckDetail->product->name . ' (' . $category . ') ' . $subCategoryName;
    ?>
                                        </td>
                                        <td>
                                            <?php 
    echo $stckDetail->quantity;
    ?>
                                        </td>
 public function storeSubCategory()
 {
     $input = Input::all();
     $validate = Validator::make(Input::all(), ['category_id' => 'required', 'name' => 'required', 'liter_per_item' => 'required|numeric', 'alcohol_content_per_item' => 'required|numeric']);
     if (!$validate->fails()) {
         $sub_category = new \App\SubCategory();
         $sub_category->category_id = Input::get('category_id');
         $sub_category->name = Input::get('name');
         $sub_category->description = Input::get('description');
         $sub_category->liter_per_item = Input::get('liter_per_item');
         $sub_category->alcohol_content_per_item = Input::get('alcohol_content_per_item');
         $sub_category->save();
         return redirect("admin/sub_categories")->with('success', 'Sub Category added successfully!');
     } else {
         return Redirect::back()->with('error', 'Error: Invalid data');
     }
 }