Cruorzy

Cruorzy

Alkmaar

Member Since 4 Months Ago

Experience Points 19,380
Experience
Level
Lessons Completed 105
Lessons
Completed
Best Reply Awards 12
Best Answer
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.

08 Nov
1 week ago

Cruorzy left a reply on Call To A Member Function Where() On Null

True about what the guys above are saying i missed that, also 1 of your forelse has no empty, its probably throwing an error because of that.

@forelse ($requisitions as $requisition)
    @forelse($requisition->activities as $activity)
        <tr>
            <td>{{ $requisition->schools->school_name }}</td>
            <td class="translate">{{ $requisition->id  }}</td>
            <td class="translate">{{ $requisition->schools->national_number_founder  }}</td>
            <td>{{ $activity->group->group_name  }}</td>
            <td>{{ $requisition->schools->type  }}</td>
            <td class="translate">{{ $requisition->schools->phone  }}</td>
            <td>{{ $requisition->schools->type }}</td>
            <td>
                <div class="btn-group btn-group-xs">
                    <a  class="btn btn-success btn-xs" data-toggle="modal" data-target="#requisition">Approved</a>
                    <form class="btn-group" action="{{ route('requisitions.unapproved', ['id' => $requisition->id]) }}" method="post">
                        {{ method_field('PATCH') }}
                        {{ csrf_field() }}
                        <button type="submit" class="btn btn-danger btn-xs">Disapproval</button>
                    </form>
                </div>
            </td>
            @empty
                No activities for this requisition
        </tr>
    @endforelse 
@empty 
No requisitions
@endforelse

Cruorzy left a reply on Call To A Member Function Where() On Null

In your blade template do this

@forelse($requisitions as $requisition)

  • {{ requisition }}
  • @empty

    There are no requisitions, please go back

    @endforelse

    06 Nov
    1 week ago

    Cruorzy left a reply on Sudo Command Not Found

    @imre08 when you reply try to tag the user.

    Also the hardware doesn't matter, in my experience when you hire a dedicated server you should have access to the root user to indeed install 'sudo' and configure it if you like to.

    If you don't have access to the root user you are way to limited and i'll also suggest moving, because you are simply restricted from doing almost anything.

    So ask how you can find the root credentials.

    Cruorzy left a reply on Sudo Command Not Found

    Are you currently logged in as a normal user or as root? Which dist of linux is it?

    01 Nov
    2 weeks ago

    Cruorzy left a reply on SQLSTATE[42S02]: Base Table Or View Not Found

    have you created a migration for that table and ran php artisan migrate

    29 Oct
    2 weeks ago
    25 Oct
    3 weeks ago

    Cruorzy left a reply on Check Box Is Selected

    Do you mean in js validation or laravel validation?

    else if you mean the issue where you don't have the value at all when it is not checked then simply make a hidden input, when the checkbox is checked it overwrites the hidden one.

    <input type="hidden" name="agreed" value=0>
    <input type="checkbox" name="agreed" value=1>
    
    22 Oct
    3 weeks ago

    Cruorzy left a reply on Why Doesn't Jeff (Way, Not Bridges) Use UserController In Auth Tutorial?

    Not sure which episode it is, but he probably makes the AuthController because when you run php artisan make:auth it creates that controller for you.

    Just to keep it simple

    18 Oct
    4 weeks ago

    Cruorzy left a reply on Why Do We Have To Execute Make:auth On A Fresh Installation?

    git commit -m "I might break stuff so i'll use git to be safe" then php artisan make:auth

    If you enabled it from your editor you can see all the changes that the command made, it basicaly does some in the web.php create a few views and controllers.

    Cruorzy left a reply on Create Vendor Folder

    composer install for development composer install --no-dev for production

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

    make sure you use views according to the action like 'user.show' or 'user.create' like the resource routes. (https://laravel.com/docs/5.7/controllers#resource-controllers)

    public function show(User $user)
        {
            return view('user.show', ['user' => $user]);
        }
    

    Cruorzy left a reply on Get Tasks That Has Multi Tags

    $tasks = Path::withCount('pathtags.Tasks.tasktags')->having('pathtags.Tasks.tasktags','>',1)->get();

    15 Oct
    1 month ago

    Cruorzy left a reply on Barryvdh/laravel-debugbar Does Not Appear In Laravel5.6

    dd(App::environment());

    If that echo's local then i'm not sure. maybe a whole fresh vendor folder

    08 Oct
    1 month ago

    Cruorzy left a reply on Test

    Staat de microfoon aan?

    Cruorzy left a reply on Inserting Data To User

    $input = $request->all();
    if(null != $input && '' != $input) {
    
    $data['name'] = $input['name'];
    $data['email'] = $input['email'];
    $data['password'] = $input['password'];
    $data['first_name'] = $input['first_name'];
    $data['middle_name'] = $input['middle_name'];
    $data['last_name'] = $input['last_name'];
    $data['city'] = $input['city'];
    $data['role_id'] = $input['role_id'];
    
    dd($data);
    
    $createUser = User::create($data);
    

    See if the role_id has an actual value?

    02 Oct
    1 month ago

    Cruorzy left a reply on Laravel App Working Fine On Live Server, But Not On Localhost

    Does artisan serve throw any errors when a new request is made?

    Also try to setup a route with a dd('Hello world'); and see if its get loaded.

    Cruorzy left a reply on Form Submition To The Wrong Route

    Maybe some changes made in the login controller? mind showing your blade file?

    28 Sep
    1 month ago

    Cruorzy left a reply on Form Validation

    Been a while for me but it seems like you can upload multiple files and your validation expect a single file, unless you foreach en then check the validation but I don't think so.

    I'm not sure if the following thing is even possible but maybe...

    return [
         '*.filename' => 'required|mimetypes:image/jpg',
    ];
    
    27 Sep
    1 month ago

    Cruorzy left a reply on How Can I Call An Method Inside Another Just One ?

    Show us some code, this is very little information

    Cruorzy left a reply on How To Store Row Id In Laravvel

    @Punksolid Is also a way to solving it, be aware that people can actually change the URL in the element inspector to what URL the form should submit.

    So if they change the ID of the school, it will save to a different school if you don't use check against it.

    Cruorzy left a reply on How To Store Row Id In Laravvel

    Since you don't give an ID to the function you can't do that. It has no idea which School you want to get, assuming the user is bound to a school you can do the following if the relation is setup.

    public function store(Request $request)
    {
        $requisition = new Requisition();
        $requisition->user_id = auth()->user()->id;
        $requisition->school_id = Auth::user()->school->id;
        $requisition->type = $request->application;
        $requisition->status = 0;
        $requisition->approved = 0;
        $requisition->save();
    
        return redirect(route('requisitions.show'));
    }
    

    Personally I like the mass assignment way more

    public function store(Request $request)
    {
        // Do Validation assign it to $data and pass that intp the create method.
       // If you don't have validations yet do it as following
    
        Requisition::create($request->all(), [
        'user_id' => Auth::id(),
        'school_id' => Auth::user()->school->id,
        'status ' => 0,
        'approved ' => 0,
        ])
    
        return redirect(route('requisitions.show'));
    }
    

    Cruorzy left a reply on Laravel Paginate Links Not Work

    When the pages show up and its clickeable then it doesn't sound like a pagination issue to me. what method is he talking about "Method Not Found"

    10 Sep
    2 months ago

    Cruorzy left a reply on How To Disable User Registration In Laravel 5.7

    If you ever ran the php artisan make:auth command then I would personally do the same thing in a new repo with git setup, see exactly which files are modfied and created and roll that back in the project where you want to disable it.

    If you never ran the command then it is not enabled.

    Cruorzy left a reply on 1234

    Hoedje van papier.

    05 Sep
    2 months ago

    Cruorzy left a reply on How Do I Normalize This Case Into Database?

    Save it as a json object?

    And maybe only the "TRUE" on the months so you save space by not saving the FALSE

    Cruorzy left a reply on Other Way On Logging Out Specific User?

    Why keep maming new posts if you had solutions for it that will work for sure @Cronix gave some really good solutions in your case. That you don't get them to work then comment without any information where you got stuck is all on you.

    if (!Auth::user()->isActive()) {
        Auth::logout();
    }
    

    or

    if (Auth::id() == 1) {
        Auth::logout();
    return redirect('/somewhere/else');
    }
    

    Will work just fine, YES it will logout the current user IF the isActive field is set to TRUE! Then reset it to false piece of cake....

    AND lets make this clear.

    "Is there other way on logging out a specific user? This been an issue for this for a year now and there's no appropriate response to this problem."

    We are not your payed servicedesk, when you think there is no answer then there is none. we are not required to give you a solution at ALL.

    04 Sep
    2 months ago

    Cruorzy left a reply on Sample

    a small amount of something that shows you what the rest is or should be like.

    This ain't the dictionary.

    Cruorzy left a reply on Getting ERROR 500 In Ajax Call (Laravel Project)

    A decent browser has network tools from there you can select the 500 return and actually see the error message

    Cruorzy left a reply on How To Add External Css File Into Laravel-mix S

    in resources/css/app.scss

    @import "yourfile";
    

    Cruorzy left a reply on Showing Latest Project

    @newbie360 I found that somewhere not tried it yet, does this also trigger on create/delete or only update?

    03 Sep
    2 months ago

    Cruorzy left a reply on Showing Latest Project

    @alanholmes Could be wrong but I think he is aware of that, what I get out from the question is that he saves several relation ships like Task/Credential/Wiki

    And he wants to show he latest project with the latest change to one of those relationships.

    The updated_at of the parent project does NOT update when a relation is saved, i'm guessing he wants something like this.

    The problem when updating a relation and setting the updated_at of the parent to NOW() would be that any changes to the project itself also updates the updated_at.

    In some cases this is not wanted at all so a seperate column could be created for it.

    It really depends on the project but you could simply listen for a update/create/remove and $parent->touch() when that is called

    Cruorzy left a reply on Showing Latest Project

    I get the question and currently thinking about a solution myself since I have a similair issue, Personally I think updating the updated_at on the task when the relation is saved. This can be done with a trait the exact way I still have to research.

    Anyway my contribution would be for others browsing through the posts and seeing "important" instead of a title that matches the question. Basic form rules you know.

    Cruorzy left a reply on Showing Latest Project

    I'd call it improvement.

    Cruorzy left a reply on Important

    Incorrect title, don't really find this important

    30 Aug
    2 months ago

    Cruorzy left a reply on HOW CAN I REDUCE EXECUTION TIME OF THESE SCRIPT

    HOW CAN I INCREASE THE INFORMATION ABOUT WHAT HE IS TALKING ABOUT ON THIS POST.

    Cruorzy left a reply on How To Do Fast Pagination

    Yes it only gets 20 users instead of all, behind the scenes its just a sql query with an offset.

    Cruorzy left a reply on Insert Multiple Rows Data Into Database

    Might be helpful if you give us some code on the ways that did not work for you.

    24 Aug
    2 months ago

    Cruorzy left a reply on Show Relation Field On Resource Index

    No idea what you mean with not only in the details view but also directly on the index. if you talking about showing it on the indes.blade.php then you surely can.

    23 Aug
    2 months ago

    Cruorzy left a reply on Override Laravel Forgot Password Redirect

    @martinbean I think his issue is if he is logged in and tries to go to that page is redirects since it only accepts guest users, so the middleware is the issue

    The middleware can be found in App\Http\Middleware\RedirectIfAuthenticated.php

    return redirect('/');
    

    Cruorzy left a reply on Problem With Sending Mail, Credentials Are Not Read From .env-file

    Great make sure you dind't commi the info with git, else it will be saved forever.

    Cruorzy left a reply on Override Laravel Forgot Password Redirect

    Original code can be found in

    vendor/laravel/framework/src/Illuminate/Foundation/Auth/SendsPasswordResetEmails.php

    But I only see redirect backs, so not sure why you would get redirected to /home