deepu07

Member Since 1 Year Ago

Experience Points 27,650
Experience Level 6

2,350 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 228
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

16 Aug
2 days ago

deepu07 left a reply on Eloquent Builder: Where Inside Where Statement

@andrewk Try like this

Products::whereIn('id', function($query){
    $query->select('paper_type_id')
    ->from(with(new ProductCategory)->getTable())
    ->whereIn('category_id', ['223', '15'])
    ->where('active', 1);
})->get();
13 Aug
5 days ago
12 Aug
6 days ago

deepu07 left a reply on Attach Method (Saving Id's In Pivot Table)

$book->students()->updateExistingPivot (
            $student_id,
            ['author_id' => $request['author_id']]
        );

this will do the trick. Thanks again.

deepu07 left a reply on Attach Method (Saving Id's In Pivot Table)

@tykus So If I Want to update existed pivot table record which one you will suggest writing an attach()or updateExistingPivot()?

deepu07 left a reply on Attach Method (Saving Id's In Pivot Table)

@tykus quick question... also the same trick works for updateExistingPivot() method?

deepu07 left a reply on Attach Method (Saving Id's In Pivot Table)

@tykus Thanks a lot. you made my day!

deepu07 left a reply on Attach Method (Saving Id's In Pivot Table)

@tykus My pivot table has 3 columns i.e. book_id, student_id author_id. I want to add three ids to the pivot table.

deepu07 started a new conversation Attach Method (Saving Id's In Pivot Table)

Hello Folks, In my project I'm trying to use attach method somehow getting a weird error. i.e.

SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "author_id" violates not-null constraint DETAIL: Failing row contains (41, 1, null). (SQL: insert into "book_student" ("book_id", "student_id") values (41, 1), (41, 1), (41, 1))

Here are my logic and relationship

Book.php (Model)

public function students()
{
      return $this->belongsToMany(Student::class, 'book_student')->withPivot('author_id');
 }

Logic

$book = Book::find($id);
$author_id = 1;
$student_id = 1; 

 $book->students()->attach ([
                $book->id,
                $student_id,
                $author_id
            ]);

Am I doing wrong here? Confused I don't know why I'm getting that error back. Any help that would be great.Thanks in advance

11 Aug
1 week ago

deepu07 left a reply on Laravel Postman Auth

nvm. I got it.

deepu07 started a new conversation Laravel Postman Auth

Hello guys, In my project I'm using Laravel (web, auth) routes. I was trying to get data from routes by passing my email and password in postman headers. somehow it is not going through. Here I'm just using email & password to authenticate the user (using Laravel PHP artisan make: auth). Am I doing correct ? or how to authenticate the user by passing my email and password in Postman?

10 Aug
1 week ago

deepu07 started a new conversation (failed) Net::ERR_CONNECTION_RESET

Hello Folks, In my project (Laravel+Vue.js) I'm uploading 7mb pdf document to the AWS s3 bucket. somehow for a POST request, I'm getting an error like this in the browser. Any idea how to fix this error? Thanks in advance

(failed)
net::ERR_CONNECTION_RESET
28 Jul
3 weeks ago

deepu07 started a new conversation Laravel Service Layer B/w Two Systems

Hello guys, In my project I wanna create a service layer between two systems. two systems should be in the auto sink for every request. Where can I start and where is the best place to create a service layer in Laravel? any help/suggestions that would be great. Thanks in advance

27 Jul
3 weeks ago

deepu07 started a new conversation Stacked Chart Vue-chart.js

Hello All, In my project I'm trying to display a stacked chart. somehow it is displaying a bar chart. can anyone help me with this? Thanks in advance. Here is my files

BarChart.js

import {  Bar, mixins } from 'vue-chartjs'
const { reactiveProp } = mixins

export default {
  extends:  Bar,
  mixins: [reactiveProp]
}
<template>
    <div class="barChart col-md-6">
      <bar-chart :chart-data="barchartDatacollection"></bar-chart>
      </div>
  </div>
</template>

<script>
import BarChart from "./BarChart.js";

export default {
  components: {
    BarChart
  },
  data() {
    return {
      barchartDatacollection: { labels: [], datasets: [], options: {} }, 
     
    };
  },
  mounted() {
    this.barchartdata();
  },
  methods: {
    barchartdata() {
      this.barchartDatacollection = {
        labels: [
          "January",
          "February",
          "March",
          "April",
          "May",
          "June",
          "July",
          "August",
          "September",
          "October",
          "November",
          "December"
        ],

        datasets: [
          {
            label: "Bad Style",
            data: [40, 47, 44, 38, 27],
            backgroundColor: "#512DA8",
            hoverBackgroundColor: "#7E57C2",
            hoverBorderWidth: 0
          },
          {
            label: "Warning",
            data: [10, 12, 7, 5, 4],
            backgroundColor: "#FFA000",
            hoverBackgroundColor: "#FFCA28",
            hoverBorderWidth: 0
          },
          {
            label: "Error",
            data: [17, 11, 22, 18, 12],
            backgroundColor: "#D32F2F",
            hoverBackgroundColor: "#EF5350",
            hoverBorderWidth: 0
          }
        ],
        options: {
          scales: {
            xAxes: [
              {
                stacked: true,
                // gridLines: { display: true }
              }
            ],
            yAxes: [
              {
                stacked: true
              }
            ]
          },
          legend: { display: true }
        }
      };
    }
  }
};
</script>
22 Jul
3 weeks ago

deepu07 started a new conversation How To Block Some Specific Routes Exculesly In Prod Env

Hello guys, In my project I wanna block some specific routes exclusively in Prod Env. How can I achieve that? Any suggestions that would be great. TIA

21 Jul
4 weeks ago

deepu07 left a reply on Copy Or Move Storage/books/images Files To Aws S3 Bucket

I did like this

for ($x = 1; $x <= $totalPages; $x++) {
            $Imagepath = storage_path() . '/books/images/' . $yearMonth . '_' . $request->language . '/' . $yearMonth . '_' . $request->language . $x . '.jpg';
            $files = File::get($Imagepath);
            Storage::disk('s3')->put('images/' . $request->language . '/' . $yearMonth . '_' . $request->language . $x . '.jpg', $files);
        }

deepu07 left a reply on Copy Or Move Storage/books/images Files To Aws S3 Bucket

@rameezisrar I did like this so it is working fine

 $path = storage_path() . '/books/images/' . $yearMonth . '_' . $request->language . '/' . $yearMonth . '_' . $request->language. '1.jpg';
 $files = File::get($path);
   
 Storage::disk('s3')->put('images/'. $request->language . '/' . $yearMonth . '_' . $request->language.'1.jpg', $files);

Thank you so much now I have to do is foreach the images.

deepu07 left a reply on Copy Or Move Storage/books/images Files To Aws S3 Bucket

Apparently tried above suggested methods somehow getting an error. I don't understand how to get a single file content. it is throwing an error If tried to get content of file.

deepu07 left a reply on Copy Or Move Storage/books/images Files To Aws S3 Bucket

@rameezisrar ended up doing like this but still no luck

$path = storage_path() . '/books/images/' . $yearMonth . '_' . $request->language;
        $files = File::allFiles($path);
        if (sizeof($files) > 0) {
            $disk = Storage::disk('s3')->url('images/' . $request->language . '/' . $book->real_name);

            foreach ($files as $file) {
                $path_info = pathinfo($file);
                $file_name = $path_info['filename'] . '.' . $path_info['extension'];
                $disk->putFileAs($file_name, file_get_contents($file), 'public');
            }
        }
20 Jul
4 weeks ago

deepu07 started a new conversation Copy Or Move Storage/books/images Files To Aws S3 Bucket

Hello guys, In my project I'm trying to move/copy my storage/books/images has 60 images in it. I want to transfer all images to aws s3 bucket. I'm doing like this but somehow it is not working as expected. can anyone help me on this?

$path = storage_path() . '/books/images/' . $yearMonth . '_' . $request->language;
$files = File::allFiles($path);
        foreach($files as $file) {
            $imagefilePath = 'images/' . $request->language . '/' . $book->real_name;
            $image_destination_path = Storage::disk('s3')->url($imagefilePath);  
            Storage::disk('s3')->put($image_destination_path, $file);
        }

Thanks in advance

17 Jul
1 month ago

deepu07 started a new conversation Message: "Serialization Of 'Illuminate\Http\UploadedFile' Is Not Allowed"

Hello guys, In my project I'm trying to convert pdf to jpg and saving in aws (using spatie pdf to image package) so uploading pdf logic is in my controller after 10 mins delay I'm converting pdf to images by processing laravel job. here is my laravel-job logic

public function handle()
    {
        $filePath = 'images/' . $this->request->language . '/' . '_' . $this->request->language;
        $bookPath = $this->book->path;
        $destination_path = Storage::disk('s3')->url($filePath);
        
        $pdf = new Pdf($bookPath);
        $pdf->saveAllPagesAsImages($destination_path);
        return response()->json(['status' => 'True', 'msg' => 'Successfully converted']);
    }

somehow I'm getting Serialization of 'Illuminate\Http\UploadedFile' is not allowed" error. can anyone help me out? Thanks In advance.

31 May
2 months ago

deepu07 left a reply on Building Nested Array Within Nested Array .

@ncltours if you share in github I can take a look.

30 May
2 months ago

deepu07 left a reply on Building Nested Array Within Nested Array .

@ncltours from above post what I'm understanding is you wanna display a roomRates array under the accommodation array . so that means accommodation array may have more than one roomRates array in it? or single array??

deepu07 left a reply on Undefined Variable Count

@remanbala If you want you can this way as well.

$todo = Todo::all();
$todo->count();

try this one?

deepu07 left a reply on Laravel Queue Failure Does Not Trigger Failed() Method If There's An Exception, But RaiseFailedJobEvent() Works

@mkrell Thanks for reply. I figure it out that guy FYI. It is working for me. I'm just firing an event whenever job gets failed.

23 May
2 months ago

deepu07 started a new conversation How To Fire An Event Whenever Job Gets Failed

Hi guys I wanna fire an event whenever laravel job gets failed. I’m trying to use

public function failed(Exception $exception)
    {
        event(new JobFailed($exception));
    }

Somehow it is not firing. do you guys have any idea why it is not firing?

15 May
3 months ago

deepu07 started a new conversation Laravel Jobd

Hi guys, how to return/send response from job to controller in laravel?

11 May
3 months ago

deepu07 left a reply on Json API - $POST

without seeing code hard to debug the problem.

deepu07 left a reply on Json API - $POST

It should work. I did a couple projects with guzzle. what err you're getting? May be you need an API key to access the API rqst

deepu07 left a reply on Php Artisan Serve Not Working

what is the status code you are seeing in console?

deepu07 left a reply on Json API - $POST

Do you wanna save that results in your db or jus display?

deepu07 left a reply on Json API - $POST

can you elaborate more? do you want to display a response of textarea data?

deepu07 left a reply on Php Artisan Serve Not Working

@akaleniu Are you getting any err in console?

deepu07 started a new conversation Laravel Vue I.e. Data Passing From One Component To Another Component

Hi Guys, I want to pass data from one vue component to another vue component. Am I doing wrong here. This is what I'm doing in my code. Getting null in the response page i.e. /city. any help/suggestion that would be great. Thanks in advance.

HomeComponent.vue (i.e. POST input)

  export default {
    data() {
      return {
        form: {
          name: '',
          city: '',
          email: ''
        },
        show: true
      }
    },
    methods: {
      submit() {
       this.errors = {};
       axios.post('/input', this.form).then(response => {
            this.$eventBus.$emit('submit', response);
          if(response.status === 200) {
               this.$router.push({ path : '/city' , response});
            }
      }).catch(error => {
        if (error.response.status === 422) {
          this.errors = error.response.data.errors || {};
        }
      });
    }
  }
</script>

CityComponent.vue (i.e. GET /city)

  export default {
    data() {
      return {
        results: {}
        }
    },
    methods: {
      fetchData() {
       this.errors = {};
       this.$eventBus.$on('/city', (response => {this.results = response.data})
      ).catch(error => {
        if (error.response.status === 422) {
          this.errors = error.response.data.errors || {};
        }
      });
     }
    }
  }```
05 May
3 months ago

deepu07 left a reply on Passing Data From One Vue To Another (redirect And Display)

@mushood you are right. you got my point. I don't have any response/request for /city. Bcse I'm submitting form through /input. I'm getting response back from third party API. even I'm not saving the response in DB. I want to submit input through one route and display the response in another route. I'm pretty new to Vue Js.

deepu07 left a reply on Passing Data From One Vue To Another (redirect And Display)

@punksolid Not Really. I don't have any permissions stuff yet.

deepu07 left a reply on Passing Data From One Vue To Another (redirect And Display)

@punksolid yes. After redirecting to the /city i can able to see POST reqst response in dev tools. but unable get it..

deepu07 started a new conversation Passing Data From One Vue To Another (redirect And Display)

Hi Everyone, I have one quick question how to redirect to another page after clicking on submit and display a response. using Laravel and Vue. Here is my vue method for submit()

  submit() {
   this.errors = {};
   axios.post('/input', this.form).then(response => {
      if(response.status === 200) {
           this.$router.push({ path : '/city' });
        }
  }).catch(error => {
    if (error.response.status === 422) {
      this.errors = error.response.data.errors || {};
    }
  });
 }

Yes it is redirecting to new page but somehow unable to fetch response data. Laravel Route for form submit POST /input and redirecting to GET /city

  fetchData() {
   this.errors = {};
   axios.get('/city').then (response => (this.response = response.data)
  )
 }

Am I doing something wrong? New to vue. Any suggestions or help that would be great Thanks!

22 Apr
3 months ago

deepu07 started a new conversation Fetch Array Values Without Index Values

Hi This is my array

  0 => "5cb3f3df9b5d7e25d02faf"
  1 => "5cb545649b5d7e55807dc9"
  2 => "5cb696c55f43ef0e981415"
  3 => "5cb7e8623b3fd71157082e"
  4 => "5cb939e63b3fd740f93852"
]```
I want to fetch only values without indexes. How can I achieve that?
Anyhelp that would be great. Thanks!
03 Apr
4 months ago

deepu07 left a reply on Load Css From S3

It was auth problem. resolved.

deepu07 started a new conversation Load Css From S3

How to load CSS dynamically from AWS S3 Bucket. Somehow it is not rendering in the browser.

Any help that would be great. Thanks in advance.

01 Apr
4 months ago

deepu07 started a new conversation Laravel Validation

Hi guys, Somehow it is always displaying a validation err 'stylesheet' => 'nullable|mimes:text/css' Am I doing something wrong?? Thanks in advance

31 Mar
4 months ago

deepu07 left a reply on Laravel API Keys In AWS

@ricardo so let me ask in this way How to manage Laravel API keys securely in AWS ? any idea...

deepu07 started a new conversation Laravel API Keys In AWS

Hi Guys, How to/Where to store API keys in AWS?? any suggestions/help that would be great. Thanks!

28 Mar
4 months ago

deepu07 left a reply on Laravel Storage Files

Solved. Thanks!

deepu07 started a new conversation Laravel Storage Files

Hi guys, below code is working fine if I upload Image but my requirement is I want to upload .css or .php or .js file and save in my local. How can I do that?

            $image = $request->file('sheet');
            $filename = auth()->user()->name . '.' . $image->getClientOriginalExtension();
            \Image::make($image)->save( public_path().'/uploads/' . $filename );
        }```
Thanks!
26 Mar
4 months ago

deepu07 left a reply on Current User Details

@cronix thanks for reply. Here is my thing I'm using Laravel-backpack package in my project. My job is change css dynamically for the backpack dashboard based on logined user. rn Backpack has a file i.e. Config\backpack\base.php file here we can change the css for the dashboard So I want to find user details and based on user I want to apply css dynamically. Any ideas how to achieve this?