trungtranqn91

trungtranqn91

Member Since 3 Weeks Ago

Da Nang

Experience Points
1,310
Total
Experience

3,690 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
0
Lessons
Completed
Best Reply Awards
2
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 1
1,310 XP
May
28
3 days ago
Activity icon

Replied to Join Query Error

what is the result or error did you get? Could you show the database or some table structure, exp: users, ..

May
22
1 week ago
Activity icon

Awarded Best Reply on Validation Rules, Compare Input To Some Strings

you can try:

public function rules()
    {
        return [
            ...
            'tipo' => 'required|in:UR,UCIR,USB',  
     
        ];
    }
Activity icon

Replied to Validation Rules, Compare Input To Some Strings

you can try:

public function rules()
    {
        return [
            ...
            'tipo' => 'required|in:UR,UCIR,USB',  
     
        ];
    }
Activity icon

Replied to How To Link Up Storage Files

@icelander try this:

public function download(Slide $slide)
    {
    	return response()->download(asset("storage/images/{$slide->slide}"));
    }

Activity icon

Replied to Production.ERROR: SQLSTATE[42000]: Syntax Error Or Access Violation: 1055 Expression #1 Of ORDER BY Clause Is Not In GROUP BY In Ubuntu

Could you dump query and run it directly in DB prod for test? I thought the issue cause the data different from local and prod. And you can not group the data when it have null data. Just my opinion

May
19
1 week ago
Activity icon

Replied to Where Are You All From?

Da Nang, Viet Nam

Activity icon

Replied to How To Load Data With Ajax


$.ajax({
                 
                    url: '/search',
                    type: 'GET',
               
                    data:{departmentId:departmentId},
                    dataType: 'JSON',
                   
                    success: function (data) { 
                       console.log(data); // See the data responsed in here, you can do anything with the data you got
			$('#id_attribute').attr(data[.....]}) //example you can set data to  html by attr() method
		........... 
										 
                    }
                }); 
May
15
2 weeks ago
Activity icon

Replied to Eager Loading Issue With Laravel 7

@kamalhasni In the first part of result,

`company_position_employment_info`.`company_position_id` in (9223372036854775807)

The id 9223372036854775807 seem was assigned directly in some where. where is the Id 9223372036854775807 come from? I don't see enough source code related , so can not guess

Activity icon

Replied to Eager Loading Issue With Laravel 7

Could you make sure the relation in your models is the same between source 5.7 and 7?

May
14
2 weeks ago
Activity icon

Replied to How To Create A Function And Automatically Called In Every Function Block?

Your mean you need to call the function in every funciton or every class is call?

Activity icon

Replied to I Want To Get Properties Of A Column From A Table With Same Id From Another Table

$products->id

The $products is an array or an object?

May
12
2 weeks ago
Activity icon

Replied to Problem Updating Data In Database In Laravel

@dr24 Can you make sure $request->date_of_birth is not null ?

May
11
2 weeks ago
Activity icon

Awarded Best Reply on MakeVisible With Relationships

the makeVisible method only make visible for the attribute already hidden by hidden attributes

Activity icon

Replied to Only First Data Is Showing In Attiutes Table,

because you use ->first(), that limit 1 record you get from DB. Do you want to show data from $productdetails in form passed from controller?

Activity icon

Replied to MakeVisible With Relationships

the makeVisible method only make visible for the attribute already hidden by hidden attributes

Activity icon

Replied to MakeVisible With Relationships

you can try:


class UserAddress extends Model 
{
protected $hidden = ['something_want_to_hide'];
}

or


class UserAddress extends Model 
{
protected $visible = ['address_one', 'address_two', 'address_three', 'address_four', 'address_five', 'users.contact_no', 'users.company_name'];
}

or you can use for temporarily modify: ->makeHidden instead, because I think all the attributes default is visible.

$locations->makeHidden('attribute_want_to_hide')->toArray();
May
10
3 weeks ago
Activity icon

Replied to Mocking Authorization Can Method

Method can() came from which class? I think that should be :

 $this->mock('Class method Can came from ')->shouldReceive('can')->withArgs(['update', $user])->andReturn(true);
Activity icon

Replied to Laravel: HasMany Doesn't Return Everything From The Specified Model

You can you $event->load('posts'); to get the relation with post from the event instance

May
09
3 weeks ago
Activity icon

Replied to Zip Files And Download The Zip.

@saileshbro My code is working well:

class CompressFileTask
{
    /**
     * Compress file and return file name.
     *
     * @param string $path      Path
     * @param string $file      file name
     * @param string $extension extension
     *
     * @return string
     */
    public function handle(string $path, string $file, string $extension)
    {
        $zip = new \ZipArchive();
        $fileName = pathinfo($file, PATHINFO_FILENAME);
        $zip->open($path.$fileName.$extension, \ZipArchive::CREATE);
        $zip->addFile($path.$file, $file);
        $zip->close();

        return $fileName.$extension;
    }
}


 

Call it

 app(CompressFileTask::class)->handle($path, $fileName, '.gz');
Activity icon

Replied to Isssue With Php Artisan Migrate

As edoc said: what error do you get when running php artisan migrate? And if you already ran php artisan migrate without any error but the migration not yet applied to your DB, you can check the connection between your project and your database. Did you using two different database?