deep88

deep88

Member Since 3 Years Ago

Experience Points
5,650
Total
Experience

4,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
33
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.

Level 2
5,650 XP
Jul
17
2 months ago
Activity icon

Replied to Nuxt Vs Laravel

Hi @panthro , I am using Nuxt on Frontend and Laravel on the backend in one of my projects, Nuxtjs is definitely not a bad choice, but I have to tell you, your workload is going to be increased a lot, Designing SPA/SSR brings a lot of responsibilities, you will spend lot of your time figuring out how to do the things in SPA/SSR. I wouldn't suggest you go for SSR/SPA if you are starting a project from scratch. Lastly, if you insist and going for a pretty big project, make sure to use Typescript with nuxtjs/vuejs. Debugging is hard with Vuejs/Next (JS)

Jul
16
2 months ago
Activity icon

Started a new Conversation Some Question About Graphic Design Princples

I know this forum is not suitable for Graphic design questions, I could not find any forum to ask that question. hope someone can answer it, maybe using his/her Common Sense if not a designer by himself.

As a Viewer, I can feel some graphic design elements look beautiful, but I want to know why and how they contribute to the overall design?

As a coder, I learned the graphic design using these 5 principles

  • Alignment.
  • Repetition.
  • Contrast.
  • Hierarchy.
  • Balance

: But following stuff does not come under these principles:

  1. Why need gradients in Graphic Design, What is governing graphic design principle for it.
  2. Why we need to to put texture images or background texture, what purpose that serves, for example putting a few star icons at the bottom right of a web page etc.
  3. What purpose do shadows serve, why they are required in web design?

You can answer any of the questions of your choice

Activity icon

Replied to HOw Can I Write Extensible Code In PHP

@ishra Yes, you are right I guess. that's how they do it. Thanks.

for anyone coming to read it later. follow these to better understand the inner working on Laravel Events

https://symfony.com/doc/current/components/event_dispatcher.html

https://www.youtube.com/watch?v=q3hfa3wdT0s

Activity icon

Replied to Configure Settings And Sending Mails?

Not to mention, mail server config can be saved in a database

Activity icon

Replied to Configure Settings And Sending Mails?

You can set config values dynamically at runtime with config() helper:

config(['services.mailgun' => $arrayWithNewSettings]);

and logic to set the dynamic config can be added in Some Service provider

TO Creat Custom service provide, follow this tutorial https://code.tutsplus.com/tutorials/how-to-register-use-laravel-service-providers--cms-28966

Activity icon

Replied to HOw Can I Write Extensible Code In PHP

Hi @sergiu17, I know about helpers and Events thing used in Laravel, Let's say, we want to add additional functionality the existing code, without editing it, but by executing an additional piece of code when that existing code is called, Governing Principle: OPEN FOR EXTENSION CLOSED FOR MODIFICATION

Activity icon

Replied to HOw Can I Write Extensible Code In PHP

Thanks for reply @ishra and @sergiu17, actually I want to learn the design pattern around those hooks thing used in WordPress

Activity icon

Replied to How Can I Achieve Method Overloading In PHP

Copied from StackOverflow for those who are reading it in future, In PHP 5.6 you can use the splat operator ... as the last parameter and do away with func_get_args() and func_num_args():

function example(...$args)
{
   count($args); // Equivalent to func_num_args()
}

example(1, 2);
example(1, 2, 3, 4, 5, 6, 7);

You can use it to unpack arguments as well:

$args[] = 1;
$args[] = 2;
$args[] = 3;
example(...$args);
Is equivalent to:

example(1, 2, 3);

https://stackoverflow.com/questions/4697705/php-function-overloading

Activity icon

Started a new Conversation HOw Can I Write Extensible Code In PHP

I want to allow additional code execution at specific points of time. for example (WordPress)

function pw_edd_track_cart_add() {
// additional code to be executed
}
add_action('edd_add_to_cart', 'pw_edd_track_cart_add');
Jul
15
2 months ago
Activity icon

Replied to How Can I Achieve Method Overloading In PHP

Great, Thanks Ishra

Activity icon

Started a new Conversation How Can I Achieve Method Overloading In PHP

Controller.php

protected function respondError($message, int $statusCode=400) {

        return $this->apiResponse(
            [
                'success' => false,
                'message' => $message ?? null,
            ], $statusCode
        );
    }

I want to be able to embed the exception as well into this function as a parameter, that will be appended to 'message' key value only when the local environment is development.

Something like below will do the job, but PHP does not support the same method names in one class

protected function respondError($message, $exception=null, int $statusCode=400) { }

Any suggestion/help will be appreciated.

Jul
12
2 months ago
Activity icon

Started a new Conversation How To Check If Variable Or Object Property Is Not Undefined Or Null Efficiently

Below is a code,

if (notUndefinedAndNull(this.user.recruiter.location.city)) {
          this.form.location = this.user.recruiter.location.city
 }

notUndefinedAndNull this functions never get called, I get the error city cannot be called on undefined.

I know there is try and catch for it, is there any other alternative like isset in PHP

I realized, Try catch is only viable solution

Jun
30
2 months ago
Activity icon

Replied to How Can I Organize The Graphic Design Files For Big Project

yes, It's part of GIT repository

Activity icon

Replied to How Can I Organize The Graphic Design Files For Big Project

@bugsysha one of the reasons for putting a list of questions here was to think of answers myself. You confirmed me by saying the same thing that I myself realized, Thank you, I am going to put all the XD Design files in One Folder and prefixing the Wireframe files with wireframe__ prefix and Design near about finishing design to mockProto__ (Mockup and Prototype). Going to use Separate directory for assets and archives. Going to make prototyping the part of my design process where possible.

For page design, I am going to use a component-based design process

Jun
29
2 months ago
Activity icon

Started a new Conversation How Can I Organize The Graphic Design Files For Big Project

Hello everyone, hope you are having a great day, Can you please do me a favour by expressing your experience about how can I organized the XD design files for wireframes and Final Design.

I am working on a personal project (30+ dynamic pages (FE-VueJs, BE-Laravel), Upwork type of project), for which I constantly design new wireframes, Design Files for the website components (developing the site feature by feature).

I am a backend developer by religion, and learned some graphic design in last 12 months and doing okay at graphic design, but I have to do it step by step or very slowly and sometimes I mix up the process because I cannot think about the workflow of UI design in my mind yet in absence of GD experience. I am using XD, I sometimes skip the wireframes part for some parts of the page, and starts to directly do HTML/CSS which takes a lot of my time. So in my scenario, I have a few unanswered questions.

Should All wireframes go in One XD Documents or Create the XD File for Each Page. how about different iterations of a wireframe

How should I organized the Final Designs for a Page

Is the Prototyping necessary for me?

What should be the directory structure of a project?

Jun
28
2 months ago
Activity icon

Replied to How Can I Handle A Big Project As Single Full Stack Developer

@martinbean I guess, you are right, I am making it too complex in my mind, I need to improve upon that, Thanks for the advice

Activity icon

Started a new Conversation How Can I Handle A Big Project As Single Full Stack Developer

I am designing a large personal Project (Upwork type of Project), I am having to wear all different hats such as Software Tester, UI Designer, Backend Developer, Frontend Developer, Project Manager etc, More Often than not, I got puzzled, and feel very overwhelmed thinking the amount of work left. From your experience, Can you suggest me a Workflow and Tools which can help me to work on that project efficiently?

I am using Laravel for backend (API Only),

Vuejs (with Nuxtjs, Vuex etc) For Frontend ( Totally separate from Backend ). Bulma CSS Framework.

Here are some of my duties:

Deciding the Content Deciding the Layout Designing UI Designing Interactions Converting the Design Into Html/CSS Code, Converting The HTML/CSS code into Vuejs Components Adding Interactivity, Adding the Code to interact with backend Full Software Testing including Browser, Security, UI Testing all kind of Stuff,

I learned about agile Project management, It does not seem to be much helpful.

Please suggest me the best approach for scheduling different tasks and in what order they should be developed

Jun
19
3 months ago
Activity icon

Replied to Simple Syntax Question

thank you, thanks a lot @michaloravec

Activity icon

Started a new Conversation Simple Syntax Question

getConfig() {
  // now returns an Observable of Config
  return this.http.get<Config>(this.configUrl);
}

https://angular.io/guide/http

Can anyone tell me what <Config> is doing here, What it is, I know it is something related to return type, but can anybody explain in plain English

Jun
18
3 months ago
Activity icon

Started a new Conversation JavaScript Promise Code Refactoring

Hello guys, I am having problems with Code Refactoring, I am thinking that my code is being messy,

return new Promise((resolve, reject) => {
// Request 1
$axios
    .post('refresh-token', {
    refresh_token: app.$cookies.get('refresh_token')
    })
    .then(async (response) => {
    if (response.status === 200) {
        const token = response.data.result.access_token

        await app.$axios.setToken(token, 'Bearer') // this thing is working

        // Request 2
        await app.$axios.get('/authuser').then(
        async function(response) {
        },
        async function() {
        }
        )
    }
    resolve(response)
    })
    .catch((e) => {
    // Request 1 error handling
    // refrsh token request did not go okay, may be refrsh_token was invalid
    reject(e.response)
    })
})
.then((res) => {
    do something after promise is resolved
})
.catch((e) => {
    do something if promise is rejected
})

Jun
11
3 months ago
Activity icon

Started a new Conversation Need Help With Blade Component Syntax

Hi, can anybody tell me what is the meaning of the first line (@component('mail::message')), where is it looking for the blade file and which one? I am trying to customize the Action email Email Template

vendor/notifications/email.blade.php

@component('mail::message')
{{-- Greeting --}}
@if (! empty($greeting))
# {{ $greeting }}
@else
@if ($level == 'error')
# Whoops!
@else
# Hello!
@endif
@endif

{{-- Intro Lines --}}
@foreach ($introLines as $line)
{{ $line }}

@endforeach

{{-- Action Button --}}
@if (isset($actionText))
<?php
switch ($level) {
    case 'success':
        $color = 'green';
        break;
    case 'error':
        $color = 'red';
        break;
    default:
        $color = 'green';
}
?>
@component('mail::button', ['url' => $actionUrl, 'color' => $color])
{{ $actionText }}
@endcomponent
@endif

{{-- Outro Lines --}}
@foreach ($outroLines as $line)
{{ $line }}

@endforeach

<!-- Salutation -->
@if (! empty($salutation))
{{ $salutation }}
@else
Regards,<br>{{ config('preferences.SITE_NAME') }}
@endif
<!-- Subcopy -->
@if (isset($actionText))
@component('mail::subcopy')
If you’re having trouble clicking the "{{ $actionText }}" button, copy and paste the URL below
into your web browser: [{{ $actionUrl }}]({{ $actionUrl }})
@endcomponent
@endif
@endcomponent

May
27
4 months ago
Activity icon

Replied to Missing Required Parameters For [Route: Users.show] [URI: {locale?}/users/{user}]

just to give you heads up, you are supposed to pass language parameter as well as user id, to generate the URL for users.show

Activity icon

Replied to Missing Required Parameters For [Route: Users.show] [URI: {locale?}/users/{user}]

Please share the code, where you are trying to generate the URL in user/index.blade.php

May
18
4 months ago
Activity icon

Replied to Predefining Nested Factory Attributes

How about creating User first, Then Campaign and then post. Code will look something like that

factory(App\User::class)->create()->each(
            function ($user) {
              factory(App\Compaign::class)->create()->each(function($compaign){
                  factory(App\Post::class,10)->create([ 'user_id' => $user->id, 'compaign_id' => $compaign->id]);
              });
            }
        );
May
11
4 months ago
Activity icon

Replied to Any Way To Nest The Model Factory A 3rd Level Deep

@vaughany Hello sir, Can you tell me, why you have overwritten the attributes inside create method instead of using relationship. Doesn't those attributes get overwritten while using relationship with factories? I am curious about what is happening behind the scenes.

May
03
4 months ago
Activity icon

Started a new Conversation How To Use Google Maps In Nuxt.js Project

Hi, i want to use integrate google city name autocomplete to Nuxtjs app without including google maps api or any heavy plugin in all pages, Instead just want to use google maps within few components.

How can i do that, thanks

Activity icon

Replied to 2 Controllers With Same Namespace In Laravel

First of all, you are not supposed to keep same name of two classes within one namespace, as composer which is reponsible for autoloading classes finds the classes by namespace and class name instead of filename.

Secondly, Dump autoload will clear the composer cache and remake the class definations(Not recommend approach though)

Apr
27
5 months ago
Activity icon

Commented on Arrow Functions

🀣🀣he showed thug life at the end while saying, give it a 5 or 10 mins instead of suggesting any solution. πŸ˜‚πŸ˜‚ Not sure anybody felt that way.? πŸ™ˆπŸ™ˆ

Activity icon

Replied to Laravel Resource Collection Behaves As Normal Resource When Wrapped Inside Json Response

Hello everyone, got just the solution in another laracasts discussion. ✌️✌️

$resourceObject->response()->getData()

https://laracasts.com/discuss/channels/laravel/pagination-data-missing-from-api-resource

Activity icon

Replied to Pagination Data Missing From Api Resource.

thank you sir, you saved my life. 😊 I was also having almost the same issue

Activity icon

Started a new Conversation Laravel Resource Collection Behaves As Normal Resource When Wrapped Inside Json Response

Hello everyone, I am developing an API and trying to keep the API response uniform throughout the application. To achieve that, I am wrapping response from every controller with custom apiResponse method.

While using it with Api Resources, Response for normal Single Api Resource works fine.

However, Resource collection gives only one result just like a normal resource would do instead of a collection of resources. Code is given below; any help will be appreciated.

	
public function index() {

        try {
            $jobs = Job::paginate(1);
        if (!$jobs) {
                throw new \Exception('No Job Found');
            }
            return $this->apiResponse(
                [
                    'success' => true,
                    'status'  => 200,
                    'result'    => new JobResourceCollection($jobs)
                ]
            );
        } catch (\Exception $exception) {
            return $this->apiResponse(
                [
                    'success' => false,
                    'message' => $exception->getMessage(),
                    'status' => 400

                ]
            );
        }

    }

protected function apiResponse($data = []) {

        $data['status'] = 200;
        return response()->json(
            [
                'success' => $data['success'],
                'message' => $data['message'] ?? null,
                'result'    => $data['result'] ?? null,
            ], $data['status']
        );
    }