ctyler

ctyler

Member Since 2 Years Ago

Experience Points
17,740
Total
Experience

2,260 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
166
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 4
17,740 XP
May
01
3 months ago
Activity icon

Started a new Conversation Need Help Syncing Users Table From Two Sources

I am looking for some suggestion.

I have a database on an internal network that is not accessible to the internet. It stores company users from multiple places.

I have a Laravel application that is publicly accessible that has a user’s table. Users can register and create accounts.

What I want to do is pull in specific data from the internal database into the public one and sync it, as necessary. I am thinking that I might be able to create a Laravel application on the internal network that can access the internal database and export it to the external Laravel application over an API connection. Would that be the best way to do it? This would need to be done securely.

Mar
24
4 months ago
Activity icon

Replied to MSSQL Getting Segmentation Fault With Foreign Key

I was able to solve this. I ended up following the directions here:

https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#redhat17

It seems to be working without issue. I guess I will no longer be using freetds.

Activity icon

Replied to MSSQL Getting Segmentation Fault With Foreign Key

if it helps here is my freetds.conf for the server

[REED]
        host = xx.x.x.x
        port = 1433
        tds version = 8.0

Activity icon

Started a new Conversation MSSQL Getting Segmentation Fault With Foreign Key

Having trouble with Foreign key constraints with MSSQL Here is my setup: Laravel 7, PHP 7.3, Laravel on Centos 7, MSSQL 14 on Windows Server, FreeTDS version 1.12 2007-12-25 06:02:36

Everything is working great except the migration:

public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('guid')->unique()->nullable();
            $table->string('domain')->nullable();
            $table->string('firstName');
            $table->string('lastName');
            $table->string('displayName');
            $table->string('password');
            $table->unsignedBigInteger('title_id')->nullable();
            $table->string('username')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();

            $table->foreign('title_id')->references('id')->on('titles');
        });
    }

The foreign key constraint seems to be causing the issue. If I run the migration I get:

[[email protected] dev-cls-admin-com]$ php artisan migrate:fresh
Dropped all tables successfully.
Migration table created successfully.
Migrating: 2013_03_19_190016_create_cache_table
Migrated:  2013_03_19_190016_create_cache_table (0.01 seconds)
Migrating: 2014_10_12_000000_create_users_table
Segmentation fault

If I comment the constraint the migrate works with out issue. Also, you can see the migration stops at the users_table migration. I am not sure how to fix this. Does anyone have any ideas? All queries work without issue so for.

Feb
14
5 months ago
Activity icon

Replied to How To Sort In A Foraech Statement

@talinon Perfect! That's exactly what I was looking for!

Activity icon

Started a new Conversation How To Sort In A Foraech Statement

Good morning all, I have something that I want to do but I am having an issue thinking through this and was hoping someone can help me.

So I am working on my permissions page and I have quite few for each role:

assignment_add
assignment_delete
assignment_update
assignment_view
attendance_add
attendance_delete
attendance_ipdate
attendance_view
attendanceSession_add
attendanceSession_delete
attendanceSession_update
attendanceSession_view
certificate_add
certificate_delete
certificate_update
certificate_view
course_add
course_close
course_delete
course_open
course_update
course_view
courseCategory_add
courseCategory_delete 

Just to name a few. On the page they are in 4 rows not in a single list. Anyway, I would like to break these up a little based on the string before the "_". So once the assignment_ is done I would like to insert a break or maybe even create a header before each one. Just to add some separation. Any ideas?

Feb
13
5 months ago
Activity icon

Replied to Attach And Detaching To Quickly Results In A Constraint Violation

@bobbybouwmann ,

Sorry it took me so long to get back to you.

I ended up enclosing the Enrollment method in a try catch block.

try {
            Enrollment::enrollUser($enrollment, $user, $enrollmentId);
        } catch (\Illuminate\Database\QueryException $e) {
            if($e->errorInfo[0] == '23000') {
                $message[] = 'You are already enrolled in this course.';
                return $message;
            } else {
                $message[] = 'There has been an error! Please try again.';
                return $message;
            }
        }

This has fixed this issue. There is no error being reported no matter how fast you click the enroll and un-enroll.

You wouldn't happen to know why this was an issue in only explorer by any chance would you?

Feb
09
6 months ago
Activity icon

Started a new Conversation Attach And Detaching To Quickly Results In A Constraint Violation

Hello All, I am having an interesting issue in Internet Explorer 11. I have an application where student can enroll and un-enroll themselves in class. This is done via attach and detach statement:

Enrolling

$enrollment->users()->attach($user->id, ['enroll_code' => $enrollmentId]);

Un-enrolling $user->enrollments()->detach($enrollment->id);

If the user is enrolled an un-enroll button is shown

If the user is not enrolled an enroll now button is shown.

I have a unique index set up on user_id and the course_id on the enrollment table.

Now, in Chrome, Firefox, and Edge I can click this button as fast as I can without issue. However, in IE 11, if I do that I get a constraint violation:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '91-6' for key 'PRIMARY' (SQL: insert into `enrollment_user` (`created_at`, `enroll_code`, `enrollment_id`, `updated_at`, `user_id`) values (2020-02-09 10:40:07, 916Q1FGO, 91, 2020-02-09 10:40:07, 6))

I tried adding javascript to the page to make sure the buttons (both enroll and un-enroll) are disabled until the page loads via:

setting the buttons to disabled and then adding:

$(document).ready(function(){
            $('.prevent-dbl-submit').attr('disabled',false);
        });

I still get the error.

In the Controller is there anyway to make sure the query has completed before calling:

return back();

or is there another way to handle this?