deepu07

deepu07

Member Since 3 Years Ago

Experience Points
46,220
Total
Experience

3,780 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
275
Lessons
Completed
Best Reply Awards
15
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.

Level 10
46,220 XP
Aug
25
1 month ago
Activity icon

Replied to How To Use GroupBy Property In Nested Object And Arrays In Laravel Collection

@fadiramzimohammed from where you're getting that collection? if you're getting that collection from any query why don't run groupBy on that query?

Aug
15
2 months ago
Activity icon

Replied to Lumen To Create Site?

@zmeufioros Lumen is a framework and WordPress is CMS. If you wanna do more customization go with lumen if not WordPress.

Jul
30
2 months ago
Activity icon

Replied to Select Statement Column Cast String To Integer

@jbloomstrom so I wanna use that accessor but still, I'm getting a string type in response

Activity icon

Replied to Select Statement Column Cast String To Integer

@snapey here subjects is the JSON type column in DB. I just wanna return subject5_number is an integer. I have added casts attribute to the model like this

protected $casts = ['subject5_number' => 'integer'];

but still, I'm getting value as string type.

Jul
28
2 months ago
Activity icon

Started a new Conversation Select Statement Column Cast String To Integer

Hi Mates, I'm in a scenario where I need to cast from string to integer in Select statement. I tried a couple of ways but it didn't work out for me. any help/suggestion that would be great. TIA

$students = Student::select([
            'id',
            'name',
	    'year',
            'subjects->subject5_number as subject5_number'
        ])
        ->where('year', 2019)
        ->orderBy('subject5_number')->get();
Jul
27
2 months ago
Activity icon

Replied to 404 Error When Testing Stripe Webhooks With Ngrok

@gabotronix add this line to your web.php file

Route::stripeWebhooks('stripe-webhook');
Jul
21
2 months ago
Activity icon

Replied to Npm Run Dev Problem In Fresh Laravel Project

@fajar do like this

npm install
npm run dev
Jul
20
3 months ago
Activity icon

Replied to Trying To Follow Vue.js Tutorial And Getting An Error I Can't Figure Out

@dsim did you create Message.vue component file? it seems like it is not able to find that component. also, did you add this component in public/app.js file?

Activity icon

Replied to How To Make Stripe Invoices Downloadable For My Users?

@smoketm I'll say why don't give the option to download from the stripe customer dashboard portal. FYI https://stripe.com/docs/api/customer_portal if you do that you don't need to do any customization. It's a cool feature rolled by Stripe. Hope it'll help you! Cheers!

Activity icon

Replied to Laravel Excel Format Table FromView

@msslgomez registerevents() will work with fromView() try like this


public function registerEvents(): array
    {
        return [
            AfterSheet::class    => function(AfterSheet $event) {
                $cellRange = 'A1:W1'; // All headers
                $event->sheet->getDelegate()->getStyle($cellRange)->getFont()->setSize(14);
                $to = $event->sheet->getDelegate()->getHighestRowAndColumn();

                $event->sheet->styleCells(
                    'A1:C1',
                    [
                        'font' => [
                            'name'  =>  'Calibri',
                            'size'  =>  30,
                            'bold' => true
                        ]
                    ]
                );

                $event->sheet->styleCells(
                    'A2:C2',
                    [
                        'font' => [
                            'name'  =>  'Calibri',
                            'size'  =>  20,
                            'bold' => true
                        ]
                    ]
                );
               
                    $event->sheet->setCellValue('K' . $stbCellValue, "=SUM(K$sum:K$stbCellCount)");
                    $event->sheet->setCellValue('M' . $stbCellValue, "=SUM(M$sum:M$stbCellCount)");

                
                $event->sheet->styleCells(
                    'A2:'.$to['column'].$to['row'],
                    [
                        'font' => [
                            'name'  =>  'Calibri',
                            'size'  =>  15,
                        ]
                    ]
                );

                $event->sheet->getStyle('A1:C1')->getAlignment()->applyFromArray(
                    array('horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS,)
                );

                $event->sheet->getStyle('A2:C2')->getAlignment()->applyFromArray(
                    array('horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS,)
                );

                $event->sheet->styleCells(
                    'A2:'.$to['column'].$to['row'],
                    [
                        'borders' => [
                            'allBorders' => [
                                'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
                            ],
                        ]
                    ]
                );
            },
        ];
    }
Activity icon

Replied to Factory Foreign Key Passed As Parameter

@marouanaf try this

'article_id' => rand(1,3)

Jul
17
3 months ago
Activity icon

Awarded Best Reply on Call To Undefined Method Maatwebsite\Excel\Excel::load() Laravel Uploading With Excel Data Into Table

@abdulbazith I'll say read this https://docs.laravel-excel.com/3.1/imports/collection.html and in collections, you shud write custom logic to create records in your DB. Hope it'll help you. Cheers!

Activity icon

Started a new Conversation ZipArchive::close(): Failure To Create Temporary File: Permission Denied

Hi Mates, working locally but not working on the server. also, I gave permissions (Chmod -r 777) at the container level using docker. TIA.

ErrorException (E_WARNING)
ZipArchive::close(): Failure to create temporary file: Permission denied
Jul
15
3 months ago
Activity icon

Replied to Call To Undefined Method Maatwebsite\Excel\Excel::load() Laravel Uploading With Excel Data Into Table

@abdulbazith so in this case what error you are getting? did you check Laravel storage/logs?

Jul
14
3 months ago
Activity icon

Replied to Call To Undefined Method Maatwebsite\Excel\Excel::load() Laravel Uploading With Excel Data Into Table

@abdulbazith I'll say read this https://docs.laravel-excel.com/3.1/imports/collection.html and in collections, you shud write custom logic to create records in your DB. Hope it'll help you. Cheers!

Activity icon

Replied to Do You Move Controller Methods To Models Or Not?

@jeroenvanrensen I do when controller logic is long enough so I'll move to model to make controller clean.

Jul
13
3 months ago
Jul
10
3 months ago
Activity icon

Awarded Best Reply on Php Artisan Route:list -v Through Errors

@alokdev it seems like you're missing the passport oauth keys in your storage direc. make sure you do have both OAuth public and private key.

Activity icon

Replied to FormRequest For Update Call

@aurawindsurfing yeah somehow If I hit put update request in postman it is showing the homepage. looks like I'm missing something here. my validation is getting failed somehow

Activity icon

Replied to Php Artisan Route:list -v Through Errors

@alokdev it seems like you're missing the passport oauth keys in your storage direc. make sure you do have both OAuth public and private key.

Activity icon

Replied to Getting An Array Of Related Collections

@megaman try this

	$relatedRows = [];

        foreach ($model->related as $related) {
                array_push($relatedRows, $related);
        }
Activity icon

Replied to Class 'App\Http\Controllers\API\GuzzleHttp\Client' Not Found"

@msh seems like your namespace is wrong

Class 'App\Http\Controllers\API\GuzzleHttp\Client' not found

also you can do like this also

$client = new \GuzzleHttp\Client();

or import class like this use GuzzleHttp\Client;

Activity icon

Started a new Conversation FormRequest For Update Call

Hi Mates, I'm using Laravel FormRequests for validations. I'm using form-request for update request somehow it is redirecting to the homepage. also, I'm using a passport for auth. any help that would be great. TIA.

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;

class ClientUpdateRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        $user = Auth::user();
        if ($user->user_type == 'client') {
            return true;
        }
        return false;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $client_id = Auth::user()->user_type_id;
        return [
            'first_name' => 'required|string',
            'middle_name' => 'string|nullable',
            'last_name' => 'string|required',
            'phone_number' => 'required|string',
            'email' => 'required|unique:email'.$client_id,
            'street_address' => 'required|string'
        ];
    }
}
Jul
09
3 months ago
Activity icon

Started a new Conversation JQuery Display Selected Tag For Options

Hi Mates, I was appending options like this by using jQuery. how can I pass the selected tag for options in this case? cause I have some values in my session when my session value matches multi-select value I wanna show that option is selected. TIA

$.each(res, function (data, value) {                            
     $("#student").append($("<option></option>").val(value.id).html(value.name));                       
 ) 
Jul
08
3 months ago
Activity icon

Started a new Conversation DB Design Best Practice

Hi Mates, in my project I have a requirement like counselors and clients related website. so coming to DB design I wanna create a three table one table for clients, a second table for counselors and a third table is the users. in the users' table, I just want to save the username/email/password/user_type_id. I'm just trying to understand what is the best practice for this scenario. also thinking to use a passport package for auth. so do you think is it best practice?

Activity icon

Replied to Maatwebsite/excel Create Columns Dynamically Depending On Data

@msslgomez try this and modify based on your requirements

    <body>
        <h2>{{$name}}</h2>
        <div class="row">
                <div class="table-responsive col-md-6">
                    <h2>Residential</h2>
                    <table>
                        <tr>
                            <th>First Name</th>
                            <th>Last Name</th>
                            <th>Email</th>
                            <th>Street Address</th>
                            <th>City</th>
                            <th>State</th>
                	</tr>
          
                                <tr>
                                    <td>{{ $user->first_name }}</td>
                                    <td>{{ $user->last_name }}</td>
                                    <td>{{ $user->email }}</td>
                                    <td>{{ $user->street_address }}</td>
                                    <td>{{ $user->city }}</td>
                                    <td>{{ $user->state }}</td>
				</tr>
                    </table>
                </div>
                <br>
            @endif
</div>
</body>
Activity icon

Started a new Conversation Laravel ManyTOMany Eager Loading Where Cond

Hey Mates, I'm trying to do where condition in many to many relationships on eager loading but getting an err.

$user->colleges()->with([
            'departments.subjects' => function (Builder $query) {
                $query->where('is_active', 'yes');
            }
        ])->paginate(10);

getting an err. IDK what I'm doing wrong. any help that would be great. Thanks!

Activity icon

Replied to Why I Am Getting %7D At The End Of Url By Creating A Link With Named Routes

@umairparacha can i see your routes file? anyways route should be like this

Route::get('/user/{userId}', '[email protected]');
Jul
07
3 months ago
Activity icon

Replied to How To Delete Price Of Product In Stripe By Using Api Call

@shanebarron yeah so you can't delete the price which is attached any active user/subscription. but you can archive it if you want.

Activity icon

Replied to Two Tables With Sometimes Relationship?

@ajsmith_codes seems like a fun task. but yeah my thought is to create a column type in the event table. and write rule/checks if event type is met absence conditions create a record in absence table else don't create a record in the absence table. Cheers!

Activity icon

Replied to How To Check If A URL Is An Article Or Just A Web Page?

@jeroenvanrensen if you think you can get URL extensions I guess you can write custom validations based on the extensions.

Activity icon

Replied to Laravel: One File With Two Classes?

@ninjajoe why you wanna create two classes in one file? why not two files?

Activity icon

Replied to Laravel Authentication With Username/ Email Doesn't Work

@ionpop did you check the developer console network tab too? No errors?

Activity icon

Replied to Search A List In One Input Form

@emfinanga idts cause I'm not user how many numbers he is going to enter. if not maybe you can tell the user like enter this limit of numbers or any specific format. yeah it's all custimaztion

Activity icon

Replied to Search A List In One Input Form

@emfinanga you can use ajax call whenever user enter a text in search form do ajax call get input data and add to serach box and send a submit call?

Activity icon

Replied to How Do I Extract All Tag Ids From A List Of Posts

@siempie93

$tags = $posts->pluck('tags.id');

what are you getting in result? and did you created a relationship btw posts and tags?