mac03733

mac03733

Member Since 1 Year Ago

Experience Points 6,050
Experience Level 2

3,950 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 4
Lessons
Completed
Best Reply Awards 5
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 Jul
1 month ago

mac03733 left a reply on Mb_strpos() Expects Parameter 1 To Be String, Object Given

@johnef_sh please mark this as solved so others can easily know a solution was found

04 Jul
1 month ago

mac03733 left a reply on 413 Request Entity Too Large ( When Uplaoding Image )

after a bit of reading, i realised that editing the php.ini is acutally optional since the message is coming from nginx so i went back and increase to a higher value

client_max_body_size 100M;  

ill read some more and see what are suitable values.

but at-least now it makes it to controller validation

THANKS FOR YOU HELP GUYS

mac03733 left a reply on 413 Request Entity Too Large ( When Uplaoding Image )

so far my current configurations meet what you are saying, but for some reason i still keep getting 413 Request Entity Too Large

mac03733 left a reply on Chaining Relationship

take it step by step

  • try
$auctionX->bids;

if this get correct results

  • then focuse on fixing the relationship between bids and user models
$auctionX->bids->user;

i reccomend you stick to laravels recoments ways of naming models and attributes, that way relastionships will be easier for you

https://laravel.com/docs/5.8/eloquent-relationships

mac03733 left a reply on Chaining Relationship

do you already have relationships set up on your models

if yes you should be able to do somthing like

$users = $auctionX->bids->user;

or

$users = User::whereHas('bids', function($bid) use ( $acution_id) {
        $bid->where('auction_id', $acution_id);
})->get();

if you dont have relationships set up, i recomment you look at

https://laravel.com/docs/5.8/eloquent-relationships

and things will be easier

mac03733 left a reply on .ENV DEPLOYMENT FOR PRODUCTION SERVER

so far iv just been using git hooks to push to production, this way i only setup th .env manually once .. then for all future changes i make it uses the same .env

  • cant you have a script that copies the .env file everytime the new server is created

mac03733 left a reply on Making Imported Vue Components Accessible Throughout My Laravel App

if you want to access a vue component gloably all you have to do is register it in app.js

the syntax looks somthing like

import MyiView from './components/IViewUI.vue';

Vue.component('myiView', MyiView);

now you can use component anywhere in your project , aslong as ther is a vue root id="app" <--somthing like

<myiView></myiView>

for more details https://vuejs.org/v2/guide/components-registration.html

hope that helps

03 Jul
1 month ago

mac03733 left a reply on 413 Request Entity Too Large ( When Uplaoding Image )

@MARKUS.HEB - i dont think thats a good idea, if u set upload_max_filesize = 2m and post_max_size = 2m, you might have a problem when u try to send a file with 2mb size and other content increasing the post size.

mac03733 left a reply on 413 Request Entity Too Large ( When Uplaoding Image )

@WILK_RANDALL - i think believe so , it should be th one under

/etc/php/7.2/fpm/php.ini

if am not mistaken

mac03733 left a reply on 413 Request Entity Too Large ( When Uplaoding Image )

@MSTRAUSS - the image is 5MB , the post_max_size is higher than allowed. but for some reason its still not working.

mac03733 left a reply on 413 Request Entity Too Large ( When Uplaoding Image )

@MUNAZZIL - yes , i mentioned that in the question

mac03733 left a reply on 413 Request Entity Too Large ( When Uplaoding Image )

@MUNAZZIL - still get 413 Request Entity Too Large

mac03733 started a new conversation 413 Request Entity Too Large ( When Uplaoding Image )

i have validation in control

$this->validate($request,[
              'member_image' => 'mimes:jpeg,jpg,png|image|max:3000'
            ]);

validation works on local ,but on sever i get 413 Request Entity Too Large error

what i hav tried:

i set upload_max_filesize in php.ini and i set client_max_body_size in nginx.conf

then i restart them , still same problem

28 Mar
4 months 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 months 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

but like @Kisiara said it would be better to use the user auth as is

another option

add this to your user model

protected $table = 'members';

this way your will maintain the User auth as is, but your records will be stored in a table called members,and you can still do things like Auth::

you can have a look at this https://laravel.com/docs/5.8/eloquent#

21 Mar
4 months 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 student and guardian records.i would like to create a many to many relationship( 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
5 months 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

this will work if u replace variables to match yours and use named route

first change button to

<a  href="#" class="btn btn-outline-primary" id="my_btn" onclick="return getUrl()">
    <i class="fas fa-folder-plus"></i>
    Cargar Producto
</a>

then

  <script type="text/javascript">

    function getUrl()
    {
      var selected = document.getElementById( "rubro" ); // this is the name of your select tag
      selected = selected.options[ selected.selectedIndex ].value; //this will get selected $rubro->id


      var url = "{!! route('rubro.create','replace_me') !!}";
      url =  url.replace("replace_me", selected); //append $rubro->id to url
      
      document.getElementById("my_btn").href= url;  //correct url with parameter is added to th link

      return true; //tell link to continue , false = dont execute
    }
  </script>

good luck

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
5 months ago

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

@MUNAZZIL - already solved it

thanks

in my case the @include was not within the @section

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

@SNAPEY - the token is there in the browser

looks like its including the create.blade out of the html tag

thanks

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
5 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
5 months ago

mac03733 left a reply on Display An Image

have you tried

<img src="{{ asset( $upload->filename ) }}" />

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
6 months ago

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

@MARTINZELTIN - can i see your table structure

-what exactly are u 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.php is correct

#####but

  • your blade.php needs a bit of tweaking
<a href="
    {{ route('media.edit',['media' => $results->id, 'type' => $type]) }}">
    <i class="fa fa-fw fa-edit"></i>
</a>

because u have more than one value /{media/{type} .. in the code below ...that mean in your blade.php you have to use an array as shown in the code above

Route::get('media_edit/{media}/{type}','[email protected]')->name('media.edit');

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]) }}"> 
Edit Media
</a>

Hope that helps

05 Feb
6 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
6 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
7 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
7 months ago

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

@PatrickSJ 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
7 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
7 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
8 months ago

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

i recomend you use this syntax

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

as suggested by @markll

if the above doesnt work

inspect th link in your browser where the image is suppose to be ...and check if its geting th correct url ..with a name of an image thats actually in you cover_images folder

30 Nov
8 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

are u trying to upload the image manually by just putting it in a folder then pushing??

or

are u uploading through ur project??

on your server ..try running the following command

php artisan storage:link

then try upload

29 Nov
8 months ago

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

THE ANSWER TO YOUR QUESTION IS 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