MathewHany

MathewHany

Member Since 4 Years Ago

Experience Points 4,025
Experience Level 1

975 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 15
Lessons
Completed
Best Reply Awards 2
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.

23 Jan
3 years ago

MathewHany started a new conversation 3-way Pivot Table

I'm working on a recipe-box application, and I have 4 tables in my database:

recipes

  • id
  • name

ingredients

  • id
  • name

measures

  • id
  • name

ingredient_recipe ( I don't like this name, can you suggest a better name?)

  • id
  • recipe_id
  • ingredient_id
  • measure_id

And here is the problem, how can I make this 3-way pivot table?

26 Dec
3 years ago

MathewHany started a new conversation How To Store How Long Does It Take To Cook A Recipe In The Database?

Hay guys!

I'm working on a Recipe Box project, and in the recipes table, I want to store the name, description, servings count, calories count and the ready-in time

But I'm stuck with the ready in time. How can I store it? What type should it be? Integer? Or what?

The only way that can work is to store how many seconds does it take to cook the recipe and then when I need to fetch this field I can convert the seconds into hours and minutes.

What is the best practice?

Sorry for my bad English

01 Nov
3 years ago

MathewHany left a reply on Is Vue.js Just For Single Page Applications?

Does that mean I can't use it in a big laravel application?

MathewHany started a new conversation Is Vue.js Just For Single Page Applications?

Is Vue.js just for single page applications?

30 Oct
3 years ago

MathewHany left a reply on Getting Error When Try To Open Register Form

We can't help you without the code. I think you forgot to import the Guard class.

MathewHany left a reply on Check Whether User Is Active/blocked

Why don't you add it to the Kernel class?

class Kernel extends HttpKernel

{ /** * The application's global HTTP middleware stack. * * @var array / protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \App\Http\Middleware\Active::class, ]; /* * The application's route middleware. * * @var array */ protected $routeMiddleware = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, ]; }

MathewHany left a reply on Why Don't You Use FormRequests?

@bestmomo https://github.com/laravelio/laravel.io https://github.com/BootstrapCMS/CMS https://www.youtube.com/playlist?list=PLfdtiltiRHWGGxaR6uFtwZnnbcXqyq8JD .. He didn't use FormRequests in this tutorial.

Don't get me wrong, I don't mean they are bad, I think FormRequests are one of the best features of Laravel 5, but I can't find a good open source project that uses them.

29 Oct
3 years ago

MathewHany left a reply on L5.1 Call To A Member Function Update() On A Non-object

{!! Form::model($broadcast, array('action' => array('BroadcastController@update', $broadcast->id), 'class' => 'form-horizontal form-bordered')) !!}

MathewHany left a reply on Why Don't You Use FormRequests?

I think that they just want to validate some simple forms, so they find that it's easier to do that directly in the controller method, instead of creating an entirely separate class.

But I'm not sure, maybe they have another reason. I just want to understand their point of not to use FormRequests.

MathewHany left a reply on Why Don't You Use FormRequests?

Yeah that might be the reason, but I'll wait for other opinions.

MathewHany started a new conversation Why Don't You Use FormRequests?

I saw lots of open source projects that were built with Laravel. And I really wanna know, why don't people use FormRequests? Are they a bad practice? Or WHAT?!

Sorry for my bad English.

27 Oct
3 years ago

MathewHany started a new conversation @forelse Does It Define A Global Variable?

@forelse($post->replies as $reply)
    {{-- Showing the reply --}}
@empty
    No posts, yet!
@endforelse

{{ $reply }}

This code shouldn't work, because the $reply variable is undefined.

However, it actually works? It gives me the last reply??!! Is this a bug? Did I do something wrong?

26 Oct
3 years ago

MathewHany left a reply on Middlewares Vs FormRequest Vs $this->authorize()

@bobbybouwmann I know how to use them, but in some cases all of them can be used in doing the same thing, which should I use in these cases?

MathewHany started a new conversation Middlewares Vs FormRequest Vs $this->authorize()

Middlewares vs FormRequest vs $this->authorize()

15 Jul
3 years ago

MathewHany left a reply on Always 404 - Sorry, The Page You Are Looking For Could Not Be Found

I found this conversation, you can see it if you wanna know more about this problem: https://github.com/laravel/lumen/pull/28

MathewHany left a reply on Store Likes And Dislikes In One Table.

@brti So when I count the dislikes I will do something like: Post::first()->likes()->where('liked', 1)->count() ? But this is a long line of code! I was wonder if I can do something like this: Post::first()->likes()->count() and Post::first()->dislikes()->count()

MathewHany left a reply on Always 404 - Sorry, The Page You Are Looking For Could Not Be Found

Edit your index.php file

$app->run();

to

$app->run($app['request']);

MathewHany left a reply on Store Likes And Dislikes In One Table.

@brti I know how to define a model, I wanna know how can I make the relationship between the likeable models and the Like model? Something like that:

Like model public function model() { return $this->belongsTo(...); }

Post model public function likes() { return $this->hasMany(Like::class); }

MathewHany left a reply on Store Likes And Dislikes In One Table.

How can I write that model class ? And I also wanna add the user_id foreign.

MathewHany started a new conversation Store Likes And Dislikes In One Table.

How can I store all the likes and the dislikes in one table?

12 Jul
3 years ago

MathewHany started a new conversation Use One Table To Store All Comments

I'm working on questions & answers application. And I wanna add the ability to comment on both questions and answers, but I wanna use one table to store all the comments, What's the best way to do that?

15 Jun
4 years ago

MathewHany left a reply on Which Terminal Does Jeffrey Way Use?

@jgreen Ya, I tried it, it's awesome, but PHPStorm is a bit laggy on my computer, so I use Sublime Text.

MathewHany left a reply on Which Terminal Does Jeffrey Way Use?

Is there an alternative for Windows?

MathewHany started a new conversation Which Terminal Does Jeffrey Way Use?

Which terminal does Jeffrey Way use?

11 Jun
4 years ago

MathewHany left a reply on Include View That Extends Layout

OK, Thanks! I just thought that I can do something like @include('posts.create::section_name') for example.

MathewHany left a reply on Include View That Extends Layout

@mstnorris I know that I can make another view to fix this, but I don't like this way, is there another way without creating this other view?

MathewHany started a new conversation Include View That Extends Layout

I have 3 views:

  1. posts/create.blade.php
  2. app.blade.php
  3. home.blade.php

In my create.blade.php, I have this code: @extends('app')

@section('content')
    {!! Form::open(['method' => 'post', 'route' => 'posts.store']) !!}
        @include('posts._form', ['buttonText' => 'Post ยป', 'textareaLabel' => 'Share something: '])
    {!! Form::close() !!}
@stop 

And in my home.blade.php I wanna include create.blade.php view, but without the layout! I just need the content section, How can I do that!

MathewHany started a new conversation Generating Optimized Class Loader

When I run laravel new command, I always get this error:

[Symfony\Component\Process\Exception\ProcessTimedOutException]
    The process "php artisan optimize" exceeded the timeout of 300 seconds.
12 Apr
4 years ago

MathewHany left a reply on Best Way To Check Permissions

If I use middleware, how can I get the question id from the uri? Note: I use route model binding?

MathewHany left a reply on Best Way To Check Permissions

The owner is only who can edit or delete

MathewHany started a new conversation Best Way To Check Permissions

How can I secure the edit & destroy actions in QuestionsController to check if the user who created the question is the only who can edit or delete it?