mac03733

mac03733

Member Since 9 Months Ago

Experience Points 4,980
Experience Level 1

20 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 1
Lessons
Completed
Best Reply Awards 4
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

28 Mar
4 weeks ago

mac03733 left a reply on Weekly Schedule / Timetable

@LADYDEATHKZN - hi ..not those ones ... i have a lessons ( id , subject, day_of_week , start_time , end_time ,teacher ) table on my database

so i need a plugin that can help generate a weekly timetable using such info

     | Mon | Tue | Wed | thur | friday

7am | | . | | 7:30 | 8am |

somthing along those lines

mac03733 started a new conversation Weekly Schedule / Timetable

i am trying to implement a class timetable , and was wondering if anyone has used a light plugin i could use

27 Mar
4 weeks ago

mac03733 left a reply on What Do I Need To Change Auth Table?

here is a guide on adding an extra user

https://devmarketer.io/learn/setting-multi-authentication-laravel-5-4-part-1/

so in your case , the guide can show you all the place you need to modify from User to Member

21 Mar
1 month ago

mac03733 left a reply on Many To Many On Same Model ??

incase anyone ever runs into this situation

here is how i solved mine

in the user model ..i made th following changes

    public function guardians()
    {
      return $this->belongsToMany('App\User','student_guardians','student_user_id','guardian_user_id');
    }

    public function children()
    {
      return $this->belongsToMany('App\User','student_guardians','guardian_user_id','student_user_id');
    }

so far this works perfectly , incase this type of relationship might have any side effects i am not noticing kindly let me know

mac03733 started a new conversation Many To Many On Same Model ??

assumings its possible. how would i do it

i have a users model , it stores both parents and guardian records.i would like to create a many to many realtions( guardian can have many childern "student" and vice verse )

so i tried using a custom pivot model

custom pivot model

<?php

namespace App;

use Illuminate\Database\Eloquent\Relations\Pivot;

class StudentGuardian extends Pivot
{

    public $incrementing = true;
}

user model


class User extends Authenticatable
{
    use Notifiable;


    public function guardians()
    {
      return $this->belongsToMany('App\User','guardian_user_id')->using('App\StudentGuardian');
    }

    public function children()
    {
      return $this->belongsToMany('App\User','student_user_id')->using('App\StudentGuardian');
    }
}

pivot table schema

  Schema::create('student_guardians', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('student_user_id');
            $table->integer('guardian_user_id');
            $table->string('relationship');
            $table->timestamps();
        });

could this approach be modified to work .. or its not possible

19 Mar
1 month ago

mac03733 left a reply on It's Possible To Pass An Extra Parameter To The Create View?

can u post the structure of your create route ,

and can i recommend you use named routes

mac03733 left a reply on Return View('departments.index') VS Return Redirect()->route('departments.index')

my main interest in using the named route, eg -> route('department.index') was to avoid modifying view('bluh bluh ') if i change folder structure.

mac03733 started a new conversation Return View('departments.index') VS Return Redirect()->route('departments.index')

is there any difference beside syntax , or does one have any side effects or recommenced use cases

08 Mar
1 month ago

mac03733 left a reply on CSRF Token Not Found --> ( When I Use @include Directive)

@SNAPEY - the token is there in the browser

mac03733 started a new conversation CSRF Token Not Found --> ( When I Use @include Directive)

#structure

master.blade.php

create.blade.php

( this is just the body of a modal with a form )

index.blade.php

@extends('master')

@include('create')

when i comment out @include('create') ,the error goes away

22 Feb
2 months ago

mac03733 left a reply on Multiple User Types

@SNAPEY - just thought i was drawing some attention to the question ... but ya i get you ..can be discouraging ,ddnt think it through.. sorry

wont putting all the attributes in one model be wasteful and result in unnormalised tables concidering that teachers,student, parents may have different attributes

mac03733 left a reply on Multiple User Types

@snapey @bobbybouwmann @tykus @Cronix some direction would be much appreciated

21 Feb
2 months ago

mac03733 left a reply on Display An Image

have you tried ''' '''

mac03733 started a new conversation Multiple User Types

i am planning out a school management system, the main actors are ( Teachers ,Students , Parent ).

i though i will simply have

User Model -> will have attributes common to ( Teachers ,Students , Parent ).

Teacher Model -> will have user_id and teacher specific attributes.

Student Model -> will have user_id and student specific attributes

Parent Model -> will have user_id and parent specific attributes

Now i realised that a single user can have multiple roles ,example a Teacher can also be a parent ,this brings up the question of which dashboard to direct them to when they login, how to control / manage their different permissions between the accounts and so forth.

my initial solution was to prompt the any user with multiple roles which account they want to use upon login.

######How would you guys tackle this ?????????? whats the best way ...

06 Feb
2 months ago

mac03733 left a reply on Return Count: 0 If Nothing Was Found

@MARTINZELTIN - can i see your table structure

mac03733 left a reply on Return Count: 0 If Nothing Was Found

what exactly are you trying to do

mac03733 left a reply on Return Count: 0 If Nothing Was Found

@MARTINZELTIN - try

$sms_count = SentItems::selectRaw('SenderID')
                      ->whereIn('SenderID', ['modem1', 'modem2', 'modem3', 'modem4', 'modem5'])
                      ->whereBetween('SendingDateTime', [$date_from . ' 00:00:00', $date_to . ' 23:59:59'])
                      ->groupBy('SenderID')
                      ->count();

mac03733 left a reply on Return Count: 0 If Nothing Was Found

try

$sms_count = SentItems::
                      whereIn('SenderID', ['modem1', 'modem2', 'modem3', 'modem4', 'modem5'])
                      ->whereBetween('SendingDateTime', [$date_from . ' 00:00:00', $date_to . ' 23:59:59'])
                      ->groupBy('SenderID')
                      ->count();

->count() should return the number of items matching the query even if its 0

mac03733 left a reply on How To Pass Multiple Variable Throuth Route

@TANVEERKHANWD - your route needs a bit of tweaking

<a href="
    {{ route('media.edit',['media' => $results->id, 'type' => $type]) }}">
    <i class="fa fa-fw fa-edit"></i>
</a>

mac03733 left a reply on How To Pass Multiple Variable Throuth Route

in your blade file you will have somthing like

<a href="{{  route('media.edit',['media' => $value_u_want_1, 'type'=> $value_u_want_2]) }}">Visit Edit Media</a>

Hope that helps

05 Feb
2 months ago

mac03733 started a new conversation Logging Errors On Production Server

can anyone recommend the best free way to keep track/log errors users may or may not report

21 Jan
3 months ago

mac03733 started a new conversation SSL + Laravel Project + Digital Ocean

Hi guys .. i just activates the COMODO PositveSSL certificate using DNS method on name cheap ...it says its active ..

but the site is still saying not secure .. wat am i missing.

i am using digital ocean and namecheap incase relevant.

15 Jan
3 months ago

mac03733 left a reply on Return User To Page They Logged In From

@SNAPEY - the answer marked as Best on that thread ..is VERY good #BUT it may cause the application to crush if the last url accessed before trying to login is a result of a search query

09 Jan
3 months ago

mac03733 left a reply on Product Launch Preparation "your Experience"

thanks for the reply ..you'v given me somthing to look on ..am totally new to this.

u mentioned Laravel Forge, iv been setting up my servers manually all along and using git hooks for zero down time,

--> besides deploying for me and free ssl ,

does it cover server maintenance , or maybe backups

if not ,whats your advise on that

08 Jan
3 months ago

mac03733 left a reply on Sequel Pro Stuck On Loading Database “db_name"

for now iv

uninstalled sequel pro

and installed

sequel-pro-nightly #####brew cask install homebrew/cask-versions/sequel-pro-nightly

seems to be working so far ...

for more info you can read up on the link provided by @realrandyallen

https://github.com/sequelpro/sequelpro/issues/2699#issuecomment-421767625

a couple of solutions where suggested ..just choose whichever suits u

mac03733 left a reply on Sequel Pro Stuck On Loading Database “db_name"

@REALRANDYALLEN - mysql v8.0 ... let me try reseach if downgrading would come back to bit me in th ***

07 Jan
3 months ago

mac03733 left a reply on Sequel Pro Stuck On Loading Database “db_name"

@realrandyallen ..those where th first thing i tried ,,,,didnt work for me ...thanks though

mac03733 started a new conversation Sequel Pro Stuck On Loading Database “db_name"

after selecting database ..sequel pro just gets stuck on loading database ...

mac03733 started a new conversation Product Launch Preparation "your Experience"

dont know how to best phrase this ..so please bare with me ...

assuming you'v created a laravel project such as QuickBooks or any large project, what steps or preparations does one need to consider for successful launch and maintenance

EG.. .in terms of :

-> customer support *considering chatbots

-> testing *plan to have Alpha ( 2 weeks ) and beta (1 month )

-> Hosting *currently using digital ocean

even info . on common mistakes and how to avoid them.

hopefully someone understands what am trying to ask ... any help would be much appreciated

12 Dec
4 months ago

mac03733 left a reply on Laravel Does Not Display Images In The View From Storage Folder

DID YOU DO

php artisan storage:link

thn i recomend you use this syntax

 <img src="{{ asset('storage/cover_images/'. $book->image) }} ... >

as suggested by @markll

30 Nov
4 months ago

mac03733 left a reply on How To Find Number Of Mondays (or Any Particular Day) In A Month?

HERE IS A QUICK SOLUTION ..there are probably cleaner ways ...but this works perfectly

function numberofDays($dayName,  $monthName, $year ){

//$dayName = "monday";
//$monthName = "december";
//$year = "2018";

$month_number = date("m",strtotime($monthName)); //converts the month to a number
$numberOfDays=0;
  
 $month_day_in = date("m", strtotime("first ".$dayName." ".$year."-".$month_number));
if($month_day_in == $month_number){  //check if the following $dayName is in $monthName 
  
 $numberOfDays++;
}

 $month_day_in = date("m", strtotime("second ".$dayName." ".$year."-".$month_number));
if($month_day_in == $month_number){
  
  $numberOfDays++;
}

 $month_day_in = date("m", strtotime("third ".$dayName." ".$year."-".$month_number));
if($month_day_in == $month_number){  
  
  $numberOfDays++;
}

 $month_day_in = date("m", strtotime("fourth ".$dayName." ".$year."-".$month_number));
if($month_day_in == $month_number){
  
  $numberOfDays++;
}

 $month_day_in = date("m", strtotime("fifth ".$dayName." ".$year."-".$month_number));
if($month_day_in == $month_number){  
  $numberOfDays++;
}

    return $numberOfDays;
}

mac03733 left a reply on Issue With Gitignore When Pushing Laravel Site To Server

on your server ..try running the following command

php artisan storage:link

then try upload

29 Nov
4 months ago

mac03733 left a reply on How Do You Deploy Your Laravel Project To Your Self Hosted Server?

THE ANSWER TO YOUR IS QUESTION DEFINITELY HERE

--> https://devmarketer.io/learn/deploy-laravel-5-app-lemp-stack-ubuntu-nginx/

what u are looking for starts at STEP 11

but u can consider reading the other steps just for better understanding of th setup

mac03733 left a reply on Laravel Style File

i would be helpful if u showed some code on how u implemented this ...

have you tried running

npm run dev

assuming you imported ur styles file into app.scss

28 Nov
4 months ago

mac03733 started a new conversation Charts And Graphs

can anyone recommend a way or best package to implement graphs or charts in laravel .

05 Nov
5 months ago

mac03733 started a new conversation Calendar Show Events Based On DB ( RECOMMEND)

can someone recommend an easy to implement but good calendar that can allow me to show events on th calendar based on dates from the database

01 Nov
5 months ago

mac03733 left a reply on Need To Learn Date Range Filter In Laravel

#####so which date picker is recommended !

22 Oct
6 months ago

mac03733 left a reply on Server Concern "Digital Ocean"

@click

and create a "snapshot" of your server before you do this. This way you can easily switch back to the previous settings if something does fail and you are unable to fix or rollback it in short time.

ya ill definitely look into that ..sounds handy

mac03733 started a new conversation Server Concern "Digital Ocean"

i have a digital ocean droplet ..and every time i log onto it there is always an update was wondering if it is really necessary for me to keep updating it .or if there is a way this can just be make automatic ..or perhaps someone could point me to a good serve management tutorial

thanks

18 Oct
6 months ago

mac03733 left a reply on What Am I Doing Wrong? Arrrgggh Trying To Get Property Of Non-object

try this ...

UserController

public function show(User $user)
    {
        return view('user')->with('user',$user);
    }
15 Oct
6 months ago
04 Oct
6 months ago

mac03733 left a reply on Get Records From Db BUT Without Repeating A Specific Column

solutions i ended up with

$users = DB::table('users')
        ->select('id','name', 'email')
        ->get();

foreach($users->unique('name') as $user){
  //....
}

or

$users = User::groupBy('name')->get();
       

mac03733 left a reply on Get Records From Db BUT Without Repeating A Specific Column

@petritr the structure of the DB is perfect ..i expect it to repeat the value. what i need help with is wat i stated in the question

please let me know in case the question is not clear , THANK 4 attempt though

mac03733 left a reply on [Vue Warn]: Unknown Custom Element: <example-component> - Did You Register The Component Correctly?

and go to where u import your app.js ...if there is a defer attribute on the script tag .remove the "defer" ..

recompile and test

mac03733 left a reply on [Vue Warn]: Unknown Custom Element: <example-component> - Did You Register The Component Correctly?

can u also check your browser console and see if there is any message