app/Http/Controllers/ProductController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create()
    {
        $productCategories_data = ProductCategories::all();
        if ($productCategories_data->isEmpty()){
            return redirect('/product')->with('error','Tidak ada data kategori');
        }else{
            return view ('admin.create_product', compact(['productCategories_data']));
        }
    }
public function create ( ) { $ productCategories_data = ProductCategories :: all ( ) ; if ( $ productCategories_data -> isEmpty ( ) ) { return redirect ( '/product' ) -> with ( 'error' , 'Tidak ada data kategori' ) ; } else { return view ( 'admin.create_product' , compact ( [ 'productCategories_data' ] ) ) ; } }
Show the form for creating a new resource.
Show the form for creating a new resource .
//menampilkan halaman penambahan data produk