Are you trying to add a column to an already existing table?
Can any one help me to how can pass Berear token in header in swagger UI?
I am getting an error in Swagger UI can help me?
what are you using in your javascript?
Then how are you getting 422 error?
Please How do I fix this error?
Something weird about my grammar, can someone fix it?
‘charset’ => ‘utf8mb4’,
‘collation’ => ‘utf8mb4_unicode_ci’,
to
‘charset’ => ‘utf8’,
‘collation’ => ‘utf8_unicode_ci’,
And it worked
‘charset’ => ‘utf8mb4’,
‘collation’ => ‘utf8mb4_unicode_ci’,
to
‘charset’ => ‘utf8’,
‘collation’ => ‘utf8_unicode_ci’,
And it worked
Good job 👍
Error “ users table already exists “ please ASAP
Are you trying to add a column to an already existing table?, if not type on your terminal php artisan migrate:fresh
Print out the request
“title” => “Testing”
“details” => “testing”
“stock” => “8”
“picture” => UploadedFile {#243 ▶️}
“category” => “1”
]

Can any one help me to how can pass Berear token in header in swagger UI?
Sorry I didn’t under stand plz can you explain about it?
I am getting an error in Swagger UI can help me?
Did it work?
ajax or axios?
I know
if (err.responseJSON) {
for (const error in err.responseJSON.errors) {
if (err.responseJSON.errors.hasOwnProperty(error)) {
const element = err.responseJSON.errors[error];
$this.prepend(`<div class=”alert alert-warning”> ${element}</div>`);
}
} this is for ajax(example)
{
$rules = [
‘title’ => ‘required’,
‘details’ => ‘required’,
‘stock’ => ‘required|min:1’,
‘picture’ => ‘required|image’,
‘category’ => ‘required’,
];
//validate
$productData = $this->validate($request, $rules);
//Add the content the pic
$productData[‘picture’] = fopen($request->picture->path(), ‘r’);
//create a product
$productData = $this->marketServices->publishProduct($request->user()->service_id, $productData);
dd($productData);
return redirect()->route(‘products.show’,
[
‘title’ =>$productData->title,
‘id’ =>$productData->identifier,
])
->with(‘success’,[‘Product created successfull’]);
}
Then how are you getting 422 error?
dd($productData);
* Publish a product on the API
* @return stdClass
* */
public function publishProduct($sellerId , $productData)
{
return $this->makeRequest(
‘POST’,
“sellers/{$sellerId}/products”,
[],
$productData,
[],
$hasFile = true
);
}
{
$rules = [
‘title’ => ‘required’,
‘details’ => ‘required’,
‘stock’ => ‘required|min:1’,
‘picture’ => ‘required|image’,
‘category’ => ‘required’,
];
//validate
$productData = $this->validate($request, $rules);
//Add the content the pic
$productData[‘picture’] = fopen($request->picture->path(), ‘r’);
//create a product
$productData = $this->marketServices->publishProduct($request->user()->service_id, $productData);
dd($productData);
return redirect()->route(‘products.show’,
[
‘title’ =>$productData->title,
‘id’ =>$productData->identifier,
])
->with(‘success’,[‘Product created successfull’]);
}
this method is not complete what happens if validation fails?
{
$rules = [
‘title’ => ‘required’,
‘details’ => ‘required’,
‘stock’ => ‘required|min:1’,
‘picture’ => ‘required|image’,
‘category’ => ‘required’,
];
//validate
$productData = $this->validate($request, $rules);
//Add the content the pic
$productData[‘picture’] = fopen($request->picture->path(), ‘r’);
//create a product
$productData = $this->marketServices->publishProduct($request->user()->service_id, $productData);
dd($productData);
return redirect()->route(‘products.show’,
[
‘title’ =>$productData->title,
‘id’ =>$productData->identifier,
])
->with(‘success’,[‘Product created successfull’]);
}
}
return redirect(‘post/create’)
->withErrors($validator)
->withInput();
}
`$request->validate([
‘title’ => ‘required|unique:posts|max:255’,
‘author.name’ => ‘required’,
‘author.description’ => ‘required’,
]);`
Please How do I fix this error?
Please How do I fix this error?
you set a user, in your data base, on this case localhost
Ok
It’s hard to help you without looking at the code
Something weird about my grammar, can someone fix it? Haha
use Vue.js or react js
It’s a jquery library that does multiple uploads