joneyspark

Member Since 1 Year Ago

Jashore

Experience Points
1,460
Total
Experience

3,540 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
3
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 1
1,460 XP
Jun
12
10 hours ago
Activity icon

Started a new Conversation How To Access Object Inside Object In Laravel Blade File ?

Data


{
  "id": 2,
  "branch_id": 1,
  "counselor_id": 3,
  "universities": [
    {
      "id": 1,
      "lead_id": 2,
      "institute": 1,
      "course": {
        "id": 3,
        "institute_id": 1,
        "course_category_id": 4,
        "course_level_id": 1,
        "course_name": "BSc (Hons) Counselling",
        "course_duration": "3",
        "course_intake": "January, September",
        "active": 1,
        "created_at": "2021-06-10T06:40:45.000000Z",
        "updated_at": "2021-06-10T06:40:45.000000Z",
        "institute": {
          "id": 1,
          "represent_country_id": 1,
          "institute_name": "University Name Here",
          "campus_name": "London",
          "active": 1,
          "created_at": "2021-06-10T06:41:52.000000Z",
          "updated_at": "2021-06-10T06:41:52.000000Z"
        }
      },
      "created_at": null,
      "updated_at": null
    },
    {
      "id": 2,
      "lead_id": 2,
      "institute": 2,
      "course": {
        "id": 13,
        "institute_id": 2,
        "course_category_id": 10,
        "course_level_id": 1,
        "course_name": "BSc (Hons) Business and Events Management",
        "course_duration": "3",
        "course_intake": "January, May & September",
        "active": 1,
        "created_at": "2021-06-10T06:40:45.000000Z",
        "updated_at": "2021-06-10T06:40:45.000000Z",
        "institute": {
          "id": 2,
          "represent_country_id": 1,
          "institute_name": "University Name Here",
          "campus_name": "London",
          "active": 1,
          "created_at": "2021-06-10T06:41:52.000000Z",
          "updated_at": "2021-06-10T06:41:52.000000Z"
        }
      },
      "created_at": null,
      "updated_at": null
    }
  ]
}

blade.php

<div class="course-interest-content">
       <ul>
          @foreach ($applicant_infos['universities'] as $university)
             <li>{{ $university['course']['course_name'] }}</li>
          @endforeach
       </ul>
</div>

it's not working. can anyone help me to how to access object inside object in laravel blade ?

May
31
1 week ago
Activity icon

Started a new Conversation How To Send Controller Parameter To Model In Laravel

myController.php

public function country_branch_app_leads_reports($country_id, $branch_id)
    {

        $data = CountryApplicationStatus::with('status_leads')
						->where('representing_country_id', $country_id)
						->get();

        return response()->json($data );
    }

myModel.php


public function status_leads()
    {
        return $this->hasMany(Lead::class, 'lead_application_status_id');
    }

my expectation


public function status_leads()
    {
        return $this->hasMany(Lead::class, 'lead_application_status_id')->where('branch_id', $branch_id);
    }

how do I achieve? please help

Apr
06
2 months ago
Activity icon

Started a new Conversation Array Of Dynamic Dependent Select Box In Vue.js

Hi, I have an array of Depend select box which contains Universities and courses. Each university has its own course. and I have built the course dropdown which depends on the university. I can successfully get university course from server request but the problem is when I change the select university it's changing all course fields. How I can get rid of the problem please give me some ideas. Thanks

<template>
  <form @submit.prevent="handleSubmit">
    <div class="col col-md-12">
      <div v-for="(interest, index) in interests" :key="index" class="row">
        <div class="col col-md-6">
          <div class="form-group mb-4">
            <label for="select-ins">Interested Universities </label>
            <select
              v-model="interest.institute_id"
              class="form-control"
              @change="onChangeUniversity($event)"
            >
              <option disabled value="">Select a University</option>
              <option
                v-for="institute in institutes"
                :key="institute.id"
                :value="institute.id"
              >
                {{ institute.institute_name }}
              </option>
            </select>
          </div>
        </div>
        <div class="col col-md-6">
          <div class="form-group mb-4">
            <label>Interested Course</label>
            <select
              v-model="interest.course_id"
              class="form-control"
              @change="onChangeCourse($event)"
            >
              <option disabled value="">Select a Course</option>
              <option
                v-for="course in courses"
                :key="course.id"
                :value="course.id"
              >
                {{ course.course_name }}
              </option>
            </select>
          </div>
        </div>
        <div class="col col-md-12 text-right">
          <div class="row ml-4">
            <div v-show="index == interests.length - 1">
              <button
                class="btn btn-warning mb-2 mr-2 btn-rounded"
                @click.prevent="add"
              >
                Add
              </button>
            </div>
            <div v-show="index || (!index && interests.length > 1)">
              <button
                class="btn btn-danger mb-2 mr-2 btn-rounded"
                @click.prevent="remove"
              >
                Remove
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </form>
</template>

<script>
export default {
  data() {
    return {
      institutes: [],
      courses: [],
      interests: [
        {
          institute_id: "",
          course_id: "",
        },
      ],
    };
  },
  mounted() {
    axios.get("/institues").then((res) => {
      this.institutes = res.data;
    });
  },
  methods: {
    onChangeUniversity(event) {
      let universityId = event.target.value;
      axios.get(`/institute-course/${universityId}`).then((res) => {
        this.courses = res.data;
      });
    },
    add() {
      this.interests.push({
        institute_id: "",
        course_id: "",
      });
    },
    remove(index) {
      this.interests.splice(index, 1);
    },
  },
};
</script>

check screenshot

http://prntscr.com/115mkn5

Apr
02
2 months ago
Activity icon

Replied to How To Upload Array Of Files In Vue.js And Laravel ?

@neilstee this code need to change a little bit

  <form @submit.prevent="handleSubmit">
    <label>Course Module PDF</label>
    <input type="file" class="form-control-file" ref="files" multiple @change="onChangeFiles" />
  </form>
</template>

<script>
export default {
  data() {
    return {
      files: [],
    };
  },
  methods: {
    handleSubmit() {
		let formData = new FormData();

		 var self = this;
     	 for (let i = 0; i < this.files.length; i++) {
        	let file = self.files[i];
        	formData.append("files[" + i + "]", file);
      	}

		axios.post( '/add-course',
          formData,
          {
            headers: {
                'Content-Type': 'multipart/form-data'
            }
          }
        ).then(() => {
          this.isLoading = false;
          console.log('Success');
        })
        .catch(error => {
          console.log(error);
        }
    },
    onChangeFiles(event) {
        for (let i = 0; i < this.$refs.files.files.length; i++) {
        this.files.push(this.$refs.files.files[i]);

        console.log(this.files);
      }
    },
  },
};
</script>

Backend Code

//Multiple files

        if ($request->hasFile('files')) {

            foreach ($request->file('files') as $file) {
                $ext = $file->getClientOriginalExtension();
                $name = time().'-'.".".$ext;
                $upload_path = 'backend/files/';
                $upload_url = $upload_path.$name;
                $file->move(public_path($upload_path),$upload_url);

			//save database

                CourseAdditionalFile::create([
                    'course_id' => $course->id,
                    'course_additional_files' => $upload_url
                ]);
            }
        }
Apr
01
2 months ago
Activity icon

Replied to How To Upload Array Of Files In Vue.js And Laravel ?

Hi,

dd($request) not working on API response but I can return $request->all(); and last time I send you the screenshot of which data I actually get. please check below the screenshot

http://prntscr.com/111nnr0

Activity icon

Replied to How To Upload Array Of Files In Vue.js And Laravel ?

Thanks for your reply but I do not have any problem to submit data @nickywan123

Activity icon

Replied to How To Upload Array Of Files In Vue.js And Laravel ?

@lianmaymesi got this types of data

https://prnt.sc/111gd68

but I can not work with the data properly in laravel. have any suggestions for me for the Laravel backend?

Activity icon

Replied to How To Upload Array Of Files In Vue.js And Laravel ?

Can you explain more what data you expect? because I gave the response data screenshot

Activity icon

Replied to How To Upload Array Of Files In Vue.js And Laravel ?

https://prnt.sc/111gd68

you can check the link which request I got

Activity icon

Replied to How To Upload Array Of Files In Vue.js And Laravel ?

@neilstee I appreciate your code no doubt but my HTML is a bit different the file selection section has been created using add or remove button so is it possible to keep the same design? and I actually get file data in the console but in Laravel code It does not respond to me

http://prntscr.com/111idic

Activity icon

Replied to How To Upload Array Of Files In Vue.js And Laravel ?

handleSubmit() {
      let data = new FormData();
      data.append("files[]", this.files);

      axios.post(data, "/add-course")
        .then(() => {
          this.isLoading = false;
          console.log('Success');
        })
        .catch(error => {
          console.log(error);
          
          
        }
    },
Activity icon

Started a new Conversation How To Upload Array Of Files In Vue.js And Laravel ?

Vue file

<template>
  <form @submit.prevent="handleSubmit">
    <label>Course Module PDF</label>
    <input type="file" class="form-control-file" @change="onChangeFiles" />
  </form>
</template>

<script>
export default {
  data() {
    return {
      files: [],
    };
  },
  methods: {
    handleSubmit() {
      let data = new FormData();
      data.append("files[]", this.files);
    },
    onChangeFiles(event) {
      let file = event.target.files[0];
      this.files.push(file);
    },
  },
};
</script>

controller code

$files = $request->files;

  if (count($files) > 0) {

      foreach ($files as $file) {
          $ext = $file->getClientOriginalExtension();
          $name = time().'-'.".".$ext;
          $upload_path = 'backend/files/';
          $upload_url = $upload_path.$name;
          $file->move(public_path($upload_path),$upload_url);
      }

  }

  return "Success";

Nothing is happening

template screenshot:

http://prntscr.com/111fd8j

Mar
29
2 months ago
Activity icon

Replied to Vue 3 Date Time Format In Moment.js ?

It has been solved by using the method

methods: {
    dateTime(value) {
      return moment(value).format("YYYY-MM-DD");
    }

Thanks @drehimself

Activity icon

Replied to Vue 3 Date Time Format In Moment.js ?

I am very glad to get your suggestions. I request a little bit you said you may not use the library so can I get some code suggestions that how I could convert " 2021-03-29T13:56:16.000000Z " this type of data and time?

Thanks

Activity icon

Replied to Vue 3 Date Time Format In Moment.js ?

Thanks for your reply. I got another error

http://prntscr.com/10z4lv5

I don't know the moment.js support Vue 3 or not. Please give me suggestions which will be best for the date and time conversion in Vue 3

Thanks

Activity icon

Started a new Conversation Vue 3 Date Time Format In Moment.js ?

vue file

<template>
  <div>
    <p class="text-danger">
      {{ dateTime(category.created_at) }}
    </p>
  </div>
</template>

<script>
import moment from "moment";
export default {
  computed: {
    dateTime(value) {
      return moment(value).format("YYYY-MM-DD");
    },
  },
};
</script>

getting error

http://prntscr.com/10z3p80

Mar
28
2 months ago
Activity icon

Replied to How To Make Vue 3 And Laravel Pagination ?

Thanks for your reply. Finally, I have solved it with help of the package

https://www.npmjs.com/package/v-pagination-3

Activity icon

Started a new Conversation How To Make Vue 3 And Laravel Pagination ?

Hi, Can you suggest how I could make Vue 3 and Larvel Pagination? some of the package I used for Vue 2 but in Vue 3 it's not working properly

Mar
26
2 months ago
Activity icon

Replied to How To Show Array Of Errors In Vue.js ? Backend Validation With Laravel

Finally, I have solve the problem to follow Object-Oriented Form

https://laracasts.com/series/learn-vue-2-step-by-step/episodes/19

Thanks to The Community

Activity icon

Replied to Laravel Array Validation With Vue Components

I have ask to the same problem ?

Activity icon

Started a new Conversation How To Show Array Of Errors In Vue.js ? Backend Validation With Laravel

Hi, I have some complex data and I want to show the validation error array data in vue file but I can not because I have got some data that has index please share your opinion

vue file

<template>
  <div>
    <form enctype="multipart/form-data" @submit.prevent="handleSubmit">
      <div v-for="(contact, index) in contacts" :key="index" class="row">
        <div class="col col-md-3">
          <div class="form-group mb-4">
            <label for="personName">Contact Person Name</label>
            <input
              id="personName"
              v-model="contact.name"
              type="text"
              class="form-control"
            />
            <small> Want to show here the error ? </small
            >
          </div>
        </div>

        <!-- Add or Remove button -->

        <div class="col col-md-12 text-right">
          <div class="row ml-4">
            <div v-show="index == contacts.length - 1">
              <button
                class="btn btn-warning mb-2 mr-2 btn-rounded"
                @click.prevent="add"
              >
                Add More
              </button>
            </div>
            <div v-show="index || (!index && contacts.length > 1)">
              <button
                class="btn btn-danger mb-2 mr-2 btn-rounded"
                @click.prevent="remove"
              >
                Remove
              </button>
            </div>
          </div>
        </div>
      </div>
    </form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      contacts: [
        {
          name: "",
        },
      ],

      errors: [],
    };
  },
  methods: {
    handleSubmit() {
      let data = new FormData();
      data.append("contacts", JSON.stringify(this.contacts));

      Request.POST_REQ(data, "/add-institute")
        .then(() => {
          alert("success");
        })
        .catch((err) => {
          this.errors = err.response.data.errors;
        });
    },
    add() {
      this.contacts.push({
        name: "",
        email: "",
        phone: "",
        alternate_phone: "",
      });
    },
    remove(index) {
      this.contacts.splice(index, 1);
    },
  },
};
</script>

controller file


public function add_institute(Request $request) {
  $request['contacts'] = json_decode($request['contacts'], true);
  $request->validate([
      'contacts.*.name'=> 'unique:institute_contact_people|distinct',
  ]);

  ...rest of code of insert 

  return response()->json("Success...");
}

Getting Response data

errors: {
  contacts.0.name: ["The contacts.0.name has already been taken.", "The contacts.0.name field has a duplicate value."]
  0: "The contacts.0.name has already been taken."
  contacts.1.name: ["The contacts.1.name has already been taken.", "The contacts.1.name field has a duplicate value."]
  0: "The contacts.1.name has already been taken."
}
Mar
25
2 months ago
Activity icon

Replied to How To Upload Pdf, Xls, Xlsx, Doc, Docx In Laravel And Vue.js

Thanks for sharing your opinion and also share the link. I have already done and validation also.

Thanks @radu

Activity icon

Awarded Best Reply on How To Upload Pdf, Xls, Xlsx, Doc, Docx In Laravel And Vue.js

Unfortunately, nobody leaves any reply for me and I have found a blog for me blessing

https://dev.to/diogoko/file-upload-using-laravel-and-vue-js-the-right-way-1775?signin=true

Hope it's working for those who are suffering as like me

Thanks

Activity icon

Replied to How To Upload Pdf, Xls, Xlsx, Doc, Docx In Laravel And Vue.js

Unfortunately, nobody leaves any reply for me and I have found a blog for me blessing

https://dev.to/diogoko/file-upload-using-laravel-and-vue-js-the-right-way-1775?signin=true

Hope it's working for those who are suffering as like me

Thanks

Mar
24
2 months ago
Activity icon

Started a new Conversation How To Upload Pdf, Xls, Xlsx, Doc, Docx In Laravel And Vue.js

My Code is below but it's not working

.vue file

<template>
  <div>
    <form enctype="multipart/form-data" @submit.prevent="handleSubmit">
      <div class="form-group mb-4">
        <label>Institute Prospectus</label>
        <label class="custom-file-container__custom-file">
          <input
            type="file"
            class="form-control-file"
            @change="onChangeProspectus"
          />
        </label>
      </div>
    </form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      institute_prospectus: "",
    };
  },
  methods: {
    handleSubmit() {
      let data = {
        institute_prospectus: this.institute_prospectus,
      };
      axios.post(data, "/add-institute")
        .then(() => {
          console.log("Success");
        })
        .catch((err) => {
          console.log(err);
        });
    },
    onChangeProspectus(event) {
      let file = event.target.files[0];
      this.institute_prospectus = file.name;
    },
  },
};
</script>

InstituteController.php

public function add_institute(Request $request) {

    $prospectus_file = $request->institute_prospectus;
    if ($prospectus_file) {
        $ext = substr($prospectus_file, strrpos($prospectus_file, '.', -1), strlen($prospectus_file));
        $name = time().'-'.$slug.".".$ext;
        $upload_path = 'backend/files/institute/';
        $prospectus_url = $upload_path.$name;
        $prospectus_file->move($upload_path,$prospectus_url);
    }
return response()->json("Institute Created Successfully...");
}

Feb
22
3 months ago
Activity icon

Awarded Best Reply on Laravel Sanctum SPA Auth - Unauthenticated After Successfully Login

Unfortunately, I have found the solution

#localhost

SESSION_DRIVER=cookie
SANCTUM_STATEFUL_DOMAINS=localhost:8080,127.0.0.1:8080,localhost:3000,127.0.0.1:3000
SESSION_DOMAIN=localhost

localhost:8080 for frontend server the port might be changing sometimes like localhost:8081 localhost:3000 so make sure you put the correct URL

#Live Server

SANCTUM_STATEFUL_DOMAINS=*.yourdomain.com
SESSION_DOMAIN=.yourdomain.com

I have also figure out sometimes I was right but the Laravel cache gives me the wrong result so you have to clean the Laravel cache and also browser cache. you can follow the below code to make a route function in web.php

Route::get('/clear', function() {

   Artisan::call('cache:clear');
   Artisan::call('config:clear');
   Artisan::call('config:cache');
   Artisan::call('view:clear');

   return "Cleared!";

});

Hope it will works

Thanks

Activity icon

Replied to Laravel Sanctum SPA Auth - Unauthenticated After Successfully Login

Unfortunately, I have found the solution

#localhost

SESSION_DRIVER=cookie
SANCTUM_STATEFUL_DOMAINS=localhost:8080,127.0.0.1:8080,localhost:3000,127.0.0.1:3000
SESSION_DOMAIN=localhost

localhost:8080 for frontend server the port might be changing sometimes like localhost:8081 localhost:3000 so make sure you put the correct URL

#Live Server

SANCTUM_STATEFUL_DOMAINS=*.yourdomain.com
SESSION_DOMAIN=.yourdomain.com

I have also figure out sometimes I was right but the Laravel cache gives me the wrong result so you have to clean the Laravel cache and also browser cache. you can follow the below code to make a route function in web.php

Route::get('/clear', function() {

   Artisan::call('cache:clear');
   Artisan::call('config:clear');
   Artisan::call('config:cache');
   Artisan::call('view:clear');

   return "Cleared!";

});

Hope it will works

Thanks

Feb
21
3 months ago
Activity icon

Replied to Laravel Sanctum SPA Auth - Unauthenticated After Successfully Login

.env file I have also set it

SESSION_DRIVER=cookie
SESSION_DOMAIN=localhost
SANCTUM_STATEFUL_DOMAINS=localhost:8000
Activity icon

Started a new Conversation Laravel Sanctum SPA Auth - Unauthenticated After Successfully Login

Hi, I have an application with Laravel and Vue.js for the separate folder which one is for the backend and another is the frontend and I have successfully configured all following the Laravel sanctum documentation and also protecting the route API and I am able to successfully log in and register but after successfully Login it's showing me "Unauthenticated " when I try to fetch the authenticated user. I am using localhost as a default. can anyone give me some suggestions

Thanks

Jan
21
4 months ago
Activity icon

Replied to How To Solve "Array To String Conversion" In Laravel

I think so also. after checking my error.log

Activity icon

Replied to How To Solve "Array To String Conversion" In Laravel

[2021-01-21 07:50:10] local.ERROR: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '["1","1","1"]' for column 'lead_interested_country' at row 1 (SQL: update `starter_leads` set `lead_intake_year` = 2021-01, `lead_interested_country` = ["1","1","1"], `lead_interested_institution` = ["19","2","7"], `lead_interested_course` = ["117","14","116"] where `lead_id` = 1442) {"userId":1,"exception":"[object] (Illuminate\Database\QueryException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '[\"1\",\"1\",\"1\"]' for column 'lead_interested_country' at row 1 (SQL: update `starter_leads` set `lead_intake_year` = 2021-01, `lead_interested_country` = [\"1\",\"1\",\"1\"], `lead_interested_institution` = [\"19\",\"2\",\"7\"], `lead_interested_course` = [\"117\",\"14\",\"116\"] where `lead_id` = 1442) at C:\xampp\htdocs\boost-lms\agntcrm\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669)```
Activity icon

Replied to How To Solve "Array To String Conversion" In Laravel

Can you explain a little bit more? Actually, I dd the variables but can not find anything

Activity icon

Started a new Conversation How To Solve "Array To String Conversion" In Laravel

I have a Multi-dimensional Array like below

quotation_country_1: ["1", "1", "1"]
quotation_institute_1: ["125", "109", "57"]
quotation_course_1: ["19", "7", "17"]

It has successfully inserted in the database but gives an error for the ajax request "Array to string conversion" So can I get help on how to solve this issue?

public function create_quotation(Request $request)
{
$lead_id = $request->post('selected_lead');

$data = $request->all();

if (count($data['quotation_country_1']) > 0) {
	foreach ($data['quotation_country_1'] as $item => $value) {
		$data2 = array(
			'lead_id' => $lead_id,
			'interestd_country_id'=>$data['quotation_country_1'][$item],
			'interestd_institute_id'=>$data['quotation_institute_1'][$item],
			'interestd_course_id'=>$data['quotation_course_1'][$item],
		);

		DB::table('starter_application_interested_course_ins')
					  ->insert($data2);
			}
		}
}

Dec
09
6 months ago
Activity icon

Awarded Best Reply on Laravel 7 Installation - Npm Run Dev Error

Solved

1st Step:

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force

2nd step:

package.json file add this

"webpack": "^4.44.1",

npm install

Activity icon

Replied to Laravel 7 Installation - Npm Run Dev Error

Solved

1st Step:

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force

2nd step:

package.json file add this

"webpack": "^4.44.1",

npm install

Dec
08
6 months ago
Activity icon

Started a new Conversation Laravel 7 Installation - Npm Run Dev Error

$ npm run dev

> dev
> npm run development


> development
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js

[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration.module.rules[10] has an unknown property 'loaders'. These properties are valid:
   object { compiler?, dependency?, descriptionData?, enforce?, exclude?, generator?, include?, issuer?, loader?, mimetype?, oneOf?, options?, parser?, realResource?, resolve?, resource?, resourceFragment?, resourceQuery?, rules?, sideEffects?, test?, type?, use? }
   -> A rule description with conditions and effects for modules.
npm ERR! code 2
npm ERR! path C:\xampp\htdocs\laravel7
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js"

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Digital Planet\AppData\Local\npm-cache\_logs20-12-08T17_55_32_929Z-debug.log
npm ERR! code 2
npm ERR! path C:\xampp\htdocs\laravel7
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "npm run development"

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Digital Planet\AppData\Local\npm-cache\_logs20-12-08T17_55_32_991Z-debug.log