edoc

Hire Me

Experience

67,040

76 Best Reply Awards

  • Member Since 2 Years Ago
  • 179 Lessons Completed
  • 0 Favorites

16th June, 2018

edoc left a reply on Laravel Active Menu Item For Url Included Parameters • 6 days ago

should be like this

 class="list-group-item{{ request()->is('articles') ? ' active' : '' }}"

9th June, 2018

edoc left a reply on No Idea Why File Is Not Uploading. • 2 weeks ago

Do you have enctype="multipart/form-data" on your form element?

<form action="/action_page_binary.asp" method="post" enctype="multipart/form-
</form>

2nd June, 2018

edoc left a reply on How To Get Cities On The Basis Of Country Id • 3 weeks ago

you can use a hasMany relation

App\Country


    public function cities()
    {
        return $this->hasManyThrough('App\City', 'App\State');
    }

And then you can eager load cities like this

Country::with('cities')->get();]

27th May, 2018

edoc left a reply on Call To A Member Function GetClientOriginalName On Null • 3 weeks ago

1enctype="multiform/form-data"1

shouldn't this be

enctype='multipart/form-data'?

10th April, 2018

edoc left a reply on Why My Laravel Website Is So Slow? • 2 months ago

Just let you know some of the pages on the pac page return this

url="https://www.m5idoingit.com/uk-gb/products/cloud/cloud-servers"

5th April, 2018

1st April, 2018

edoc left a reply on Hey Guys I'm Making Company Project In Laravel 5.4 Where User Can Create Company And Change The Company Image I'm Able To Save The Image Into Public But It's Not Changing I'm Facing This Error • 2 months ago

$company =company::where('user_id', Auth::user()->id)->get();

should be if you want to update a certain model.

$company =company::where('user_id', Auth::user()->id)->first();

21st February, 2018

edoc left a reply on Preserve The Dynamic Input Tag If Validation Error Occur? • 4 months ago

no need to bump an old thread

edoc left a reply on Flash Session Data In Blade Without Passing From Controller • 4 months ago

dd(session()->get('count'))

edoc left a reply on Flash Session Data In Blade Without Passing From Controller • 4 months ago

I read the view composers but it is saying there needs to be a route to the view

No you should be able to do something like this in a file such as AppServiceProvider

  view()->composer('partials.nav', function ($view) {
            $messages= Message::get();
           
            $view->with('messages', $messages));
        });

Then in your nav you can access this $messages variable

edoc left a reply on Strange Insert Error..Integrity Constraint Violation • 4 months ago

This should be

$message->fill(['from'=>auth()->user()->id],
            ['to_'=>$id],
            ['message'=>'kkssd'],
            ['date'=>date('Y-m-d')]);

this

$message->fill([,
            'to_'=>$id,
            'message'=>'kkssd',
            'date'=>date('Y-m-d'),
            'from'=>auth()->user()->id
]);

edoc left a reply on Strange Insert Error..Integrity Constraint Violation • 4 months ago

$message->fill(['from'=>auth()->user()->id, 'to_'=>$id])->save(),

7th February, 2018

edoc left a reply on Trying To Get Property 'name' Of Non-object • 4 months ago

$rooms = Room::with('roomcat')->get();

        foreach($rooms as $room){
          echo  $rooms->roomcat->name;
        }

edoc left a reply on Trying To Get Property 'name' Of Non-object • 4 months ago

try $rooms->room_cats->name;

6th February, 2018

edoc left a reply on Specifying Columns For Eager-loaded Relationships • 4 months ago

The same. If I specify any columns for that relationship, it returns no results. It doesn't matter what the column is.

Does it happen even after adding thread_id to posts like this?

$threads = Thread::latest('updated_at')
        ->with([
            'author:id,username',
            'forum:id,name,ic',
            'posts:id,thread_id,created_at'
        ]);
    

27th January, 2018

edoc left a reply on Laravel: Fetch Data Inside A Vue Component • 4 months ago

use props

26th January, 2018

edoc left a reply on MethodNotAllowedHttpException • 4 months ago

you don't wanna share the solution?

edoc left a reply on MethodNotAllowedHttpException • 4 months ago

please paste your route file

24th January, 2018

edoc left a reply on WISIWYG Editor • 4 months ago

tinymce is shit

4th January, 2018

edoc left a reply on How To Add A Querystring With A Blade Variable From Foreach ? • 5 months ago

<a href="{{ action("Ulbgt\[email protected]", ['stations' => $details->stations[0]['transfer_request_id]) }}">

9th December, 2017

edoc left a reply on Having Doubts With The Laracasts Series Steps • 6 months ago

just start coding.

what are you doing? lol

edoc left a reply on Stuck With Type Error: Argument 1 Passed... • 6 months ago

I think you have to return the User model instance

20th October, 2017

edoc left a reply on Model Passed To Controler • 8 months ago

id

But you can change that. For example, if you have an Article model and you wanna use a slug column to be used for route model binding.

Article.php

public function getRouteKeyName()
{
    return 'slug';
}

edoc left a reply on Grid Template Compatibility • 8 months ago

????

edoc left a reply on File Upload/edit Form. • 8 months ago

First of all, do you know the route model binding? and what is the slug for?

edoc left a reply on File Upload/edit Form. • 8 months ago

I am not bitching at all but, code examples would be much more efficient if you wanna get help from fellow Laracasts members

edoc left a reply on What I Select The Ramdom 8 Records In Laravel ? • 8 months ago

YourModel::inRandomOrder()->take(8)->get();

Like that?

edoc left a reply on What I Select The Ramdom 8 Records In Laravel ? • 8 months ago

without model what do you mean?

15th October, 2017

edoc left a reply on How To Get Answers To The Questions ? • 8 months ago

@ChristophHarms You are on point!!

12th October, 2017

edoc left a reply on Select Columns From Eager Loaded Tables • 8 months ago

that's because you didn't select the foreign key

edoc left a reply on Date Field (Form::date) Not Showing Value On Mobile Version • 8 months ago

fffffffffffffffffffffffffffffffffff

11th October, 2017

edoc left a reply on FatalThrowableError In Pages.php Line 14: • 8 months ago

I am pretty sure you have $table->timestamps() is your migration file

edoc left a reply on FatalThrowableError In Pages.php Line 14: • 8 months ago

can you create another topic if you solved your first question?

edoc left a reply on FatalThrowableError In Pages.php Line 14: • 8 months ago

$

10th October, 2017

edoc left a reply on Select Columns From Eager Loaded Tables • 8 months ago

Hi, thx for your replies but both don't work....

Don't you think you need to explain why that does not work??

edoc left a reply on Select Columns From Eager Loaded Tables • 8 months ago

I wonder why i pent my time for this

9th October, 2017

edoc left a reply on How Can I Get The Last Key? • 8 months ago

You want the last key in the collection right? try if this works

$sessions->count() - 1

7th October, 2017

edoc left a reply on Return Instance With Relationships After Saving It. • 8 months ago

        return $savedRequest->load('cropInputMaterial');

6th October, 2017

edoc left a reply on How Does Auth::user()->name And Auth::user()->email Work • 8 months ago

Probably it's hidden isn't it??

protected $hidden=['email', 'password'] on you User model

edoc left a reply on $errors->has('something') With Array • 8 months ago

@if ($errors->haAnys(['name', 'email', 'password']) )

edoc left a reply on $errors->has('something') With Array • 8 months ago

$errors->has('name', 'email', 'password')

5th October, 2017

edoc left a reply on Vue Error Every Time App.scss Is Compiled • 8 months ago

@goatshark Yea I was actually about to tell you the same. The error seems to be fixed after updating Laravel Mix.

Thanks for letting me know! Have a good one

edoc left a reply on Select Columns From Eager Loaded Tables • 8 months ago

Did you know you can do this?

$result = OrderRelation::where('relation_id', $relation_id)->with('articles:articles_id,price')->get()

Instead of this

$result = OrderRelation::where('relation_id', $relation_id)->with(['articles' => function($query) {
    $query->select('article_id', 'price');
}])->get()

4th October, 2017

edoc left a reply on GroupBy Relation Returns Empty • 8 months ago

public function answersCount(){
        return $this->answers()->select('answer')->selectRaw('count(*) as aggregate')->groupBy('answer');
    }

select stack_id as well

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.