Tangente

Tangente

Senior Fullstack Engineer at Seattle

Member Since 5 Years Ago

Seattle, WA

Experience Points
31,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
342
Lessons
Completed
Best Reply Awards
18
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.

Level 7
31,310 XP
Jan
14
1 week ago
Activity icon

Replied to Add Values On Two Arrays

The quickest way would be (if they are the same length:


$array_new=[];

for($i=0; $i<array1.length; $i++)
{
$array_new[$i]=$array1[$i]+$array2[$i];
}

Jan
02
3 weeks ago
Activity icon

Replied to Connect Laravel With Firebase Real Time Database

What problems are you getting?

Nov
19
2 months ago
Activity icon

Awarded Best Reply on .env File And Config Keys Not Updating After Change.

By the way, every time you change .env file, make sure you clear cache

php artisan cache:clear
php artisan config:clear
php artisan route:clear

I'm not sure if that is the problem, but make sure you do that every time you change values in .env file

Activity icon

Replied to .env File And Config Keys Not Updating After Change.

By the way, every time you change .env file, make sure you clear cache

php artisan cache:clear
php artisan config:clear
php artisan route:clear

I'm not sure if that is the problem, but make sure you do that every time you change values in .env file

Nov
14
2 months ago
Activity icon

Replied to Upload Image

@ain , what error are you getting? Need to see the error so we can debug from there

Nov
13
2 months ago
Activity icon

Commented on Build A Registration System In Mere Minutes

There are probably tons of people with same issue! Maybe build a package and share?

Activity icon

Replied to Upload Image

From that picture, it looks like the image is part of restocks table. so, one restock has exactly one image from that image (one to one). Well, a user may have one or more restocks (one to many) but a restock has one image. therefore

  1. Save user record (create) for example:
$user = User::create(['name'=>$request->get('name'),  'address'=>$rquest->get('address')]);

now you have the user saved.

  1. save restock (without image, therefore make image column nullable) (create)

example:

$restock = new Resocks();
$restock->address=$request->get('address');
$restock->phone=$request->get('phone');
.
.
.
$restock->restock_user_id=$user->id;//because you saved the user
$restock->save();

then you go to upload section. This is where you do the edit, because you are going to add image location after you upload

example:


$restock = findOfFail($request->get('restock'));
 if(isset($request->get('image))
        {


            $image=$$request->get('image');

            $extension = $image->getClientOriginalExtension();
            $storage = '/app/Pictures/';
            $fileNameNoStorage= str_random(100).$image->getFilename() . '.' . $extension;
            $fileName = $storage.$fileNameNoStorage;
            $image->move(storage_path() . $storage, $fileName);

            $restock->image=$fileNameNoStorage;
        $restock->save();

        }

That's how I would do that

Activity icon

Replied to Upload Image

It would depend on how you structured your database. Personally I would do this. Each record has an image, so we have one to one relationship.

Image would be part of the record, and it would be nullable. That way, you can add all record information, save, then when you go to upload the image, all you would do is update instead of create.

If you were to do many-to-many relationships though, like a record may have one or many uploads, in that case you would do 'create' each time you save the upload, and associate the record id to each upload entry.

Activity icon

Replied to Multi Step Form Laravel

if you do not want to reload the page here is what I would do. East step, use ajax to submit the data and the step number you are at. the back end validates the request data depending on the steps. for example:

switch ($request->step)
{
    case 1:
        $request->validate([

            'Name' => 'required',
         'email' => 'required|email
         ]);
    break;
    case 2: 
$request->validate([

            'Phone' => 'required',
         'username' => 'required
         ]);
break;
default:
//default to 1 or something
break;

}

That way if the validation fails, you get the ajax errors on the page, and enable next step only if the previous step returned OK.

Oct
24
3 months ago
Activity icon

Commented on Handling Unique Slugs In Laravel

Thank you

Oct
22
3 months ago
Activity icon

Commented on Reduce Duplication

Would be nice if the model extends request and make chained calls like this:

$article->validate()->save(); 

Sep
29
3 months ago
Activity icon

Replied to API GET By Email

public function show(User $user)
{
    return $user;
}

This by default translates to

public function show( $id)
{
    return User::where ('id', $id);
}

so, if you want to load the user by email, do this:

public function show( $user_email)
{

     return User::where('user_email', $user_email)->firstOrFail();

}

Sep
04
4 months ago
Activity icon

Replied to XML To PDF

Use this package. It uses DomPDF, which in convert HTML to pdf. In Theory, it should deal with XML as well.

https://github.com/vsmoraes/pdf-laravel5