News Articles laravel

Paypal Integration using vue, axios and laravel api throws 500 internal error

I am making a paypal integration webapp using vue and laravel api. Whenever i trigger post method it shows internal server error 500. Whenever i trigger post method using axios it only catches the error and doesnot complete the functionality i provided. I also dont know to use csrf token in vue . Anyone who […]

How to download a FIle? Either Image or PDF

My backend controller for the download. public function myAppointment($id) { $appointment = Appointment::find($id); $appointment = public_path(‘/image/’).$appointment->image; return Appointment::download($appointment); } This is where I find a certain appointment via ID and gets it’s details and would only select the image. However, when I clicked on the download it show a 500 status code error. My frontend […]

How to send multiple images in form input repeater

i created a steps form , every row have text area and 3 images and user have ability to add new step (with text area and 3 images) , or title separator so how i can submit form into json format like this "steps" :{ step:{ type: "title", data: "content" }, step:{ type: "step", data:{ […]

Week 2 of 100DaysOfCode Laravel Challenge

Episode 11: Use the Filesystem Class to Read a Directory In this episode, we create a Post model class and move the post finding code from the route definition to the Mode class method find(). We add another method all() to this class where we fetch all posts from the resource/posts directory. We use the […]

How to download ICS file in mail content?

I am trying to create a link to download a .ics file based on the Data for iCalendar event. Here’s the code in jsfiddle which is working independently but not working in Mail which I’m sending. <a href="data:text/calendar;charset=utf8;base64,QkVHSU46VkNBTEVOREFSDQpWRVJTSU9OOjIuMA0KQkVHSU46VkVWRU5UDQpVSUQ6ZWFhMjZhOTFmZWZkMWY0OGU0M2JkMGFhZTE1MTJlNGMNClNVTU1BUlk6w5xDUkVUU8SwWg0KRFRTVEFSVDtUWklEPUV1cm9wZS9Jc3RhbmJ1bDoyMDIxMTIzMFQxNjAwMDANCkRURU5EO1RaSUQ9RXVyb3BlL0lzdGFuYnVsOjIwMjExMjMwVDE2MDAwMA0KREVTQ1JJUFRJT046ZURhbsSxxZ9tYW4gVG9wbGFudMSxc8SxDQpMT0NBVElPTjplRGFuxLHFn21hbg0KRU5EOlZFVkVOVA0KRU5EOlZDQUxFTkRBUg==" download="event.ics"> <button type="button">iCalendar</button> </a> I need to download this file in e-mail content, what are your solutions? […]

Show modal bootstrap when click button if the null select option

I have a modal displayed via JavaScript by clicking the button delete (deleting an option from a select tag). I have to check if an option is selected before displaying the alert modal but I couldn’t find a way to hide the alert modal even if nothing is selected. I used a JavaScript function to […]

Laravel why get element by id is not working

When i am entering hard coded id in Laravel controller, i am able to get data but when i enter same value in text box data i am getting error. working Laravel controller which shows value against id 123: public function getdata(Request $request) { $files = Files::where(‘file_code’,’=’,’123′)->first(); return response()->json([ ‘files’=> $files, ], 200); } Not […]

422 Unprocessable Entity Error. I tried upload Excel file to import data but it is not working

This is my code, i use vuejs and laravel. The function I am doing is both saving the Course and also importing the Excel file to get the data in the file. But when saving the Course is normal, but when it comes to running the validate excel file line, the error is not received. […]

how to upload image with filepond in jetstream inertia?

this is my input file-pond https://i.stack.imgur.com/wURAQ.png this is my script Source: Vue – Stack Overflow

How to use Observers in Laravel?

So what are observers in Laravel and why you should use them? 1. Definition Observers in Laravel help you to fire multiple events or do a CRUD operation in database! When you create an observer, it will listen to a specific condition for a model, e.g: if user create a post and he/she achieved a […]

How to Secure Your Laravel Application

Nowadays, the tools we use to browse the internet require us to follow security standards. Otherwise, they tend to flag our web applications/sites as insecure. Read the full story Source: Hacker Noon – Programming

Vuex+Laravel: Can’t send multiple files with FormData and axios to server side. Always getting null on server side. What’s going on?

The information which I got by my previous question Vuex + Laravel. Why axios sends any values but only not that one, which come's with method's parameter? works only for situation when I pass only one argument in axios. I also found how to successfully pass multiple files with one argument, but in my situation, […]

Vue Js in production not displaying file correctly

I just finished developing an Vue/Vuetify JS +Laravel api(back end). Now I am trying to move it to production mode (to a new server). I ran "npm run build" to generate the filef for production. It worked fine the commnad and I have commited the file. however I am I having a behavior that I […]

How can I properly position an image using laravel-mpdf?

I need to generate a pdf, the HTML itself is ok, but the logo is not where I want it to be. I know that mpdf has some incompatibilities with CSS but I really need this to work. Can someone help me? Thanks in advance! Source: CSS – Stack Overflow

Laravel Eloquent Query containing pivots and relations

I want to make graphs based on values i get from my questionnaire. This is how my database looks like (Only showing the ones I need): questionnaires id client_id questionnaire_answers id questionnaire_id questionnaire_question_id answer questionnaire_questions id question What I want is basically get all the answers of question 1 (of all their questionnaires) from a […]

Relationship between two tables – Laravel, Inertia, Vuejs

I’m new to the subject, I have two tables related to each other, one for departments and one for users, I want to know how many users there are in each department DepartmentController.php public function index() { return Inertia::render(‘back/app/departments/index’, [ ‘filters’ => request()->all(‘visibility’, ‘status’, ‘search’), ‘departments’ => Department::orderBy(‘name’)->get(), ‘total_members’ => User::where(‘department_id’)->count(), dd(User::where(‘department_id’)->count()) ]); } Index.vue […]

How can the css variable from be changed dynamically from `Laravel Nova`?

I am using Nova Settings in which a Color picker field is used. NovaServiceProvider- OptimistDigitalNovaSettingsNovaSettings::addSettingsFields([ Panel::make(‘Colors’, [ Color::make(‘Primary color’)->slider(), Color::make(‘Secondary color’)->slider(), ]), ]); $primary-color = nova_get_setting(‘primary_color’); In my CSS file – :root { –primary-color: rgb(255, 0, 0); //want the nova color setting to be used here –secondary-color: rgb(255, 197, 6); } How can the Nova […]

Updating Files in Production causes Issues with Laravel Mix

I am using Laravel 8 / Vue 2 in my stack. I have a folder in my resources directory that contains json files that need to be accessible to users via javascript. These json files are also updated on occasion through laravel jobs. Now I am able to update these files and access them fine […]

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.