DaGenius

DaGenius

Member Since 2 Years Ago

Experience Points 720
Experience Level 1

4,280 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 6
Lessons
Completed
Best Reply Awards 0
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.

08 May
2 months ago

DaGenius left a reply on Can't Login To Admin Section On Server

@SNAPEY - I called

use App\Father; use App\Mother; use App\RegisteredBy; in my controller, is there something else I need to do?

07 May
2 months ago

DaGenius left a reply on Can't Login To Admin Section On Server

@SNAPEY - This is what the fathers and mothers table look like

public function up() { Schema::create('fathers', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('profession'); $table->string('office_address'); $table->string('residential_address'); $table->string('phone'); $table->string('email'); $table->string('photo'); $table->integer('student_id')->unsigned(); $table->timestamps(); $table->foreign('student_id')->references('id')->on('students')->onDelete('cascade'); }); }

This is for registered_bies

public function up() [registered_bies] { Schema::create('registered_bies', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('email'); $table->string('relationship'); $table->integer('user_id')->unsigned(); $table->timestamps(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');

    });
}

And this for the students

public function up() [students] { Schema::create('students', function (Blueprint $table) { $table->increments('id'); $table->string('surname'); $table->string('firstname'); $table->string('othername'); $table->string('intending_class'); $table->string('last_class'); $table->string('last_school'); $table->string('nationality'); $table->text('reason_for_living'); $table->string('date_of_birth'); $table->string('sex'); $table->string('special_needs'); $table->string('special_needs_comment')->nullable(); $table->string('photo'); $table->integer('admission_fee'); $table->string('reference_code'); $table->integer('registeredBy_id')->unsigned(); $table->timestamps(); $table->foreign('registeredBy_id')->references('id')->on('registered_bies')->onDelete('cascade'); }); }

DaGenius left a reply on Can't Login To Admin Section On Server

@snapey @tisuchi Thanks for your help. Now I have updated my codes, established relationships where necessary but it outputs null for relationships so, that $student->mother->name, $student->father->name and $student-registeredBy->name all outputs null.

DaGenius left a reply on Can't Login To Admin Section On Server

@TISUCHI - I do not have any relationship now. I will appreciate ideas about how I should do this.

DaGenius left a reply on Can't Login To Admin Section On Server

@SNAPEY - So I tried your solution but I got another error...

[2019-05-07 08:10:30] local.ERROR: Call to undefined relationship [mother] on model [App\Student]. {"userId":1,"exception":"[object] (Illuminate\Database\Eloquent\RelationNotFoundException(code: 0): Call to undefined relationship [mother] on model [App\Student]. 

DaGenius left a reply on Can't Login To Admin Section On Server

@SNAPEY - I'm grateful for your answers. Will make the necessary corrections and give a report on how it goes. @tisuchi already mentioned the N+1 issue, to be candid I am just learning what it is. I am a beginner but I will read on how to resolve n+1 issues and about carbon too. Thanks once again.

06 May
2 months ago

DaGenius left a reply on Can't Login To Admin Section On Server

@TISUCHI - Thank you @tisuchi, the thing is everything works fine on my local machine, I only have this issue on my hosting server

DaGenius started a new conversation Can't Login To Admin Section On Server

Admin section works fine on my local machine but when I upload to my hosting, trying to access the admin backend using username and password combination returns 500 error. When I checked the log files, here is what I saw:

ERROR: Trying to get property of non-object (View: /../resources/views/admin/students.blade.php) {"userId":1,"exception":"[object] (ErrorException(code: 0): Trying to get property of non-object (View: /../resources/views/admin/students.blade.php) at /../app/Student.php:46, ErrorException(code: 0): Trying to get property of non-object at /../app/Student.php:46)

Here's what my students.blade.php looks like:

          @if(!empty($students))
            @foreach($students as $key => $value)
           
            <tr>
              <td>{{$key+1}}</td>
              <td>{{$value->surname . " " .$value->firstname . " " . $value->othername}}</td>
              <td>{{$value->getRegisteredBy($value->registeredBy_id)}}</td>
              <td>{{$value->getMother($value->id)}}</td>
              <td>{{$value->getFather($value->id)}}</td>
              <td>{{date_format(date_create(substr($value->created_at,0,10)),"d-m-Y")}}</td>
              <td><a href="{{url('/admin/viewStudent/'.$value->id)}}" class="btn btn-info btn-sm">View details</a></td>
            </tr> -->
            @endforeach
          @endif

          </tbody>

And the Student.php line 46:

public function getMother($id){ $parent = Mother::where('student_id', $id)->first();

    return $parent->name; // line 46

}