That doesn't sound too normal. Are you able to share the relevant code for the controller and view?
summernote editor give the Forbidden error on lorem paragraph
sorry, but i am new to laravel . i am using summernote editor at some place on my admin panel . in the developing mode i am able to add the lorem text in the editor and save it . but in the production when i try to add the lorem text and save the form it is telling me the error of Forbidden .
at first i thought that i did some mistake in my code but if i add other random paragraph which is not lorem then it is letting me save it . is it normal ?
@jj15 here:
index.blade.php
<div>
<div class="form-group">
<label for="description">About Author <span style="color: rgb(204, 61, 61);">*</span></label>
<textarea class="summernote" name="description" id="summernote"></textarea>
</div>
</div>
<script>
function summernote(){
$('#summernote').summernote({
placeholder: 'Add the Description for Author',
tabsize: 2,
height: 200,
disableDragAndDrop: true,
tooltip: false,
toolbar: [
['style', ['style']],
['fontsize', ['fontsize']],
['font', ['bold', 'italic', 'underline', 'clear']],
['fontname', ['fontname']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['view', ['fullscreen', 'codeview', 'help']]
],
fontSizes: [ '11', '13', '15', '17', '19', '21', '25', '30', '36']
});
}
$(document).ready(function() {
summernote();
});
</script>
controller.php
public function store(Request $request)
{
if ($request->has('social_links')) {
$request->merge(['social_links' => json_decode($request->input('social_links'), true)]);
}
$validatedData = $request->validate([
'name' => 'required|string|max:255',
'country' => 'required|string|max:255',
'description' => 'required|string',
'image' => 'nullable|image|mimes:jpg,jpeg,png|max:10240',
'social_links' => 'nullable|array',
'social_links.*.social_media_id' => 'nullable|exists:social_media,id',
'social_links.*.link' => 'nullable|url',
]);
try {
$path = $request->hasFile('image')
? $request->file('image')->store('authors', 'public')
: null;
$author = Author::create([
'authorName' => ucfirst($validatedData['name']),
'country' => ucfirst($validatedData['country']),
'description' => $validatedData['description'],
'profilePic' => $path,
'active' => false,
]);
if (!empty($validatedData['social_links'])) {
foreach ($validatedData['social_links'] as $socialLink) {
AuthorSocialMedia::create([
'author_id' => $author->id,
'social_media_id' => $socialLink['social_media_id'],
'link' => $socialLink['link'],
]);
}
}
return response()->json([
'success' => true,
'message' => 'Author created successfully.',
]);
} catch (Exception $e) {
return response()->json(['error' => true, 'message' => 'Something Went Wrong.']);
}
}
Which method are you using to submit the form—GET or POST?
Have you included a CSRF token?
Additionally, ensure that the server is not blocking submissions containing potential spam keywords like 'lorem.'
Try submitting the form with a genuine description. Test it once using different text to verify if the issue persists.
@jayandholariya i am submitting the data through POST method and i have also include the CSRF token in my form using @csrf... as long as it is not lorem it is working so it is okay i think
@srushti_kansagara Using genuine description its working that means keywords like 'lorem' is forbidden on the server.
@jayandholariya can you help me out with this query i don't know where i am wrong in this https://laracasts.com/discuss/channels/laravel/403-error-while-adding-the-mulitiple-summernote-editor-in-one-form
@jayandholariya sorry to disturb you but can you tell me what is the best way to send the push notification to multiple devices in one request i know the way 'using TOPIC' but it is not suitable for my current situation . i need to use the FCM token but send() method will take too much time if there is large number of users
@srushti_kansagara Is your message content for notification will be same for all ? then you can send 500 notification at time using firebase.
@jayandholariya yahh notification is about upgrading subscription plan and have few % discount on it . so it will be same for every user
Please or to participate in this conversation.