News Articles laravel

Every time I try to execute npm run dev I get Error: Cannot find module ‘p-limit’

I’m running a Laravel 8 and Vue 3 project on laradock, compiling with Laravel Mix. All was working fine and I only updated the PrimeVue version. The problem is that after running npm install and npm run dev I get the following error: Error: Cannot find module ‘p-limit’ Require stack: – /var/www/node_modules/p-locate/index.js – /var/www/node_modules/locate-path/index.js – […]

Problem rendering data to modal on Vue component in Laravel

form on modal(Posts.vue) <label>Category</label> <select class="form-control" v-model="form.category_id"> <option v-for="(cat,index) in categories" :key="index" :value="index" :selected="index == form.category_id">{{ cat }}</option> </select> data & method in Posts.vue component data(){ return{ editmode: false, posts: {}, form: new Form({ id: ”, category: ”, title : ”, content : ”, image : ”, author_id : ”, published: ”, category_id: ”, }), […]

When i try to scaffolding in New laravel Project with vue js given error "$0.25rem and 0 are incompatible"

Hello All i am create a new laravel project and Scaffold with vue Js so given error "SassError: 0.25rem and 0 are incompatible. $return: append($return, max($value, 0));" I doing these steps: composer create-project laravel/laravel blog composer require laravel/ui php artisan ui vue npm install npm run dev when i doing npm run dev given the […]

how to make check all at laravel with vuejs?

i wanted to create checkall a checkbox horizontally in laravel vuejs, i’ve searching and trying but the result always got vertically and just the All box checked. I don’t know how to explain this, but here is my code : Vue : let app = new Vue({ el: ‘#app’, data: { name: ”, checkedPermissions: [], […]

Laravel – Routing with Inertia Visit to fill prop in Vuejs3

I want to send data from page A to page B without use controllers, just in laravel routes. ( Laravel / VueJS3 / InertiaJS ) In my first page, I have this method: // first.vue tappedCourse(course: Course): void { const data: secondParams = { courseName: course.name, }; Inertia.get("/second", data as any); }, And in my […]

Inertia handle null in share middleware

public function share(Request $request) { return array_merge(parent::share($request), [ ‘darkMode’ => !!$request->user()->dark_mode, ]); } So the code above is saying "use darkMode" once a user is logged in. The issue is, if a user is NOT logged in it comes back as NULL. How do I set a default value if it comes back as null […]

Vue Laravel not showing data from method

I know I am blind because I’ve been looking at this for 2 days off and on and I think I am just eye stuck on what is really going on. Below is the code. What SHOULD happen is an array of data should be shown into a modal. I can see the data as […]

what is the best way to translate a website, a client has requested to translate the whole website to another language?

I am using laravel with Vue, I’ve tried google api, but the page seems to first load in English then translated to another language which is not appropriate <script> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: ‘en’, includedLanguages: ‘en,el’, // layout: google.translate.TranslateElement.InlineLayout.SIMPLE }, ‘google_translate_element’); } </script> <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> Source: Vue – Stack Overflow

Why we use doctrine package in Laravel

Hello all programmer’s here. In this blog post I will describe you why we use doctrine library. This libraryis mostly used for modifying the column of database field with change() method to the to column within the migration file. Let us see how to use it Before modifying the column we first need to install […]

Hide Elements Dynamically in Blade Foreach Loop

I have a form in Laravel Blade which contains data that need to be hidden and shown dynamically. Here is the code. @foreach ($working_orders as $key => $order) <div class="col-lg-12 row "> <div class="title-md">Work Order # {{$order->id}}</div> <div class="form-group col-lg-6"> <label style="color: #44484d;">Camión</label> <select class="form-control kt-selectpicker truck_type" required name="truck_type" onchange="getOrderFields()"> <option value="1" selected>No asignar</option> <option […]

Hide Elements Dynamically in Blade Foreach Loop

I have a form in Laravel Blade which contains data that need to be hidden and shown dynamically. Here is the code. @foreach ($working_orders as $key => $order) <div class="col-lg-12 row "> <div class="title-md">Work Order # {{$order->id}}</div> <div class="form-group col-lg-6"> <label style="color: #44484d;">Camión</label> <select class="form-control kt-selectpicker truck_type" required name="truck_type" onchange="getOrderFields()"> <option value="1" selected>No asignar</option> <option […]

Hide Elements Dynamically in Blade Foreach Loop

I have a form in Laravel Blade which contains data that need to be hidden and shown dynamically. Here is the code. @foreach ($working_orders as $key => $order) <div class="col-lg-12 row "> <div class="title-md">Work Order # {{$order->id}}</div> <div class="form-group col-lg-6"> <label style="color: #44484d;">Camión</label> <select class="form-control kt-selectpicker truck_type" required name="truck_type" onchange="getOrderFields()"> <option value="1" selected>No asignar</option> <option […]

How to remove CROSS ORIGIN (CORS) policy issue with fetch() method when use Amazon S3 file URL?

I have stuck at the problem of CORS origin coming from Amazon S3. I have a project where I am uploading images as well as PDF files to the Amazon S3 bucket using Laravel and Vue. Whenever I am fetching PDF files it will fetch out without any error but whenever I am fetching images […]

How to use Laravel relationships to create a table?

as you see on the diagram : the task belong to a user and a project on the same time. the user and project can have multiple tasks. how can i use laravel relationships to create a task? Source: Vue – Stack Overflow

Laravel 8 REST API Authentication using Sanctum

Sanctum is Laravel package for authentication for single page application(SPAs), mobile applications and basic token based APIs. For SPA authentication, Sanctum uses Laravel’s built in cookie based authentication services. Means while working with front end technologies like react, Angular Sanctum create cookie and save in browser by using this accomplish authentication. For token based Rest […]

Build Your New On-demand Multi-Service App Utilizing The Best Laravel PHP Framework

As app development is the core process to start any kind of on-demand online business, concentrating on it is very important. Consequently, the developers today majorly use the Laravel backend program on the basis of its powerful integration framework. Because of its notable advantages, the same source has been used in on-demand multi-service app development […]

Inserting into pivot table Error: Function name must be a string

This is my first time I make a system with an order… I am confusing how can I insert data to the pivot table order_services order table: (id, total) services table: (id, name, price) item table:(id, name) order_service table: (order_id,service_id, item_id, quantity, amount) Models: Order.php protected $guarded = []; public function services() { return $this->belongsToMany(Service::class)->withPivot(‘order_id’,’service_id’,’item_id’,’quantity’,’amount’); […]

Laravel api request from mobile app receives missing token error page (419)

Working on a small ionic framework application with laravel backend. Request from postman or browser works fine, but builds from Android’s getting 419 token mismatch error with same endpoints. Request Data from Android (error 419): Headers Accept application/json Accept-Encoding gzip, deflate Accept-Language en-AU,en-US;q=0.9,en;q=0.8 Authorization [Filtered] Content-Length 25 Content-Type application/json Host app.example.com Origin http://localhost Referer http://localhost/ […]

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.