deepu07

Member Since 1 Year Ago

Experience Points 28,180
Experience Level 6

1,820 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 230
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.

10 Sep
5 days ago

deepu07 started a new conversation How To Get A Column Names By Using Model

Hi Folks, In my project, I wanna get all the table column names by passing the model name. How can I achieve that in Laravel? Any help that would be great. Thanks.

deepu07 left a reply on Laravel Search

Thanks @snapey

deepu07 started a new conversation Laravel Search

Hello mates, I have a quick question "is it a good choice to use cache system for search feature"? Any suggestion that would be great for me. Thanks!

deepu07 left a reply on Laravel Paginate With Limit

NVM I got this

$results = $query->orderBy($filter, 'DESC')->limit(500)->paginate(20);

deepu07 started a new conversation Laravel Paginate With Limit

Hello mates, In my project I'm writing a search functionality where I wanna Limit the results 500 and paginate first 20 results and send to UI. How can I do that? I'm doing like this but still getting all the 500 results set

$results = $query->orderBy($filter, 'DESC')->take(20)->limit(500)->get();

Any help that would be great. Thanks!

06 Sep
1 week ago

deepu07 started a new conversation Site Not Loading In AWS

Hello guys, A quick question I have deployed my site in aws (ec2-rds). it was working until yesterday somehow today onwards, if I hit domain name in browser it is keep loading all the time. whatā€™s causing this issueā€¦ any help/suggestions that would be great. Thanks!

29 Aug
2 weeks ago

deepu07 left a reply on Laravel Collection To Object

@hondnl Loop array and convert in looping from array to object i.e. $collection->first();

deepu07 left a reply on Update In Laravel API

@pn whenever user hit on Post update button you jus grab the id of the post and send it to the Backend. I believe without processing a Get request you have it id already with you.

deepu07 left a reply on How To Structure This Relation?

@ranx99 So here you need to check with every model before retrieving. I think create one to one model relationship and pass a string along with the input. so based on string it will go and display into that model.

20 Aug
3 weeks ago

deepu07 started a new conversation ERR_CONNECTION_RESET

Hi Guys, I have a quick question Iā€™ve created an admin panel(Laravel+vue) so admin will update a pdf document through panel so my logic will convert each pdf page into the image and save into AWS s3 bucket. everything woking great. but the problem is I can upload a document from my location (USA) it is going through. But If someone who is out of the USA he is not able to upload a document at all. He is getting an error like this `ERR_CONNECTION_RES. Do you guys have any idea why it is making noise / how to fix this issue? Any help/suggestions that would be great. Thanks!

19 Aug
3 weeks ago

deepu07 left a reply on Passing Data As Array

@sarahs74 try this

return Type::create([$client_id, $type, $name]);

deepu07 left a reply on How Should I Don't Show Login Form Of Teacher If Already Logged In As Student?

@afrasiyabhaider write a condition in your controller/route/blade if a logged user is student jus redirect to the home page. ^

even you can do like this pretty clean visit this https://stackoverflow.com/questions/30643810/restrict-route-access-to-non-admin-users

16 Aug
4 weeks 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
1 month ago
12 Aug
1 month 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 month 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 month 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
1 month 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
1 month 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
1 month 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
1 month 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
1 month 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
3 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
3 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
3 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
4 months ago

deepu07 started a new conversation Laravel Jobd

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

11 May
4 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 || {};
        }
      });
     }
    }
  }```