jlrdw

jlrdw

Member Since 4 Years Ago

Experience Points
520,570
Total
Experience

0 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
178
Lessons
Completed
Best Reply Awards
580
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

Level 50
520,570 XP
May
28
3 hours ago
Activity icon

Replied to Pay What You Want Functionality

Maybe a SaaS setup.

Activity icon

Replied to Limit Output Length Of Crypt Or Hash

Try to devise a one time pin number that you have associated with id, but let it be temporary, it expires after a certain time.

May
27
1 day ago
Activity icon

Replied to Javascript Stopped Working

See if the user was using Firefox, one of the latest versions it's having problems on certain transactions. Meanwhile see if Chrome works that's what I had to do.

I've turned off use Hardware acceleration, but still troubleshooting to see what is going on.

In my case I was trying to do a transfer but the transfer would not work, but it worked on Chrome.

I could login just no transfer.

Activity icon

Replied to Is Laracasts Is A Good Place To Learn PHP?

The basics yes but not the kind of knowledge that the writer, Taylor knows who wrote the framework.

But yes take some of the basic videos, as you learn look up other tutorials online. But as you learn practice the code and don't just watch videos only.

you really begin learning when you write the code yourself and work out problems.

May
26
2 days ago
Activity icon

Replied to Composer Is Not Working?

Just run composer by itself and you should see a list of composer commands. If you see that list then you have composer installed.

Let that be step 1 make sure you have composer working.

Activity icon

Replied to Prevent Duplicate Record Insertion On Browser Refresh

That's fine, I was just trying to help. Just follow what @snapey suggested.

Activity icon

Replied to Prevent Duplicate Record Insertion On Browser Refresh

From your original question, why does someone wait on a price (or order), just have a "lookup" table of prices, give the price right away, ant let the person continue. I shop online often and never wait on a price.

Wouldn't a price be the same for Tom as it would be for Sally?

Look at how some of the shopping carts are setup online, at use some of those ideas.

Edit: You may even consider using a shopping cart package, I believe there are some based on laravel. Or at least look at some on Github and get a few ideas of how an order is put together and completed.

Activity icon

Replied to Prevent Duplicate Record Insertion On Browser Refresh

Just suggestion, but there's not a way you could do some sort of popup modal for this? Some sort of listener would have to be in place.

I've never seen any site where you have to "refresh a page" to complete something. Seems there has to be a better way.

Activity icon

Replied to I Have An Old Project Using Laravel 5.5 Should I Upgrade To 6.0 Or 7.x?

Also have a look at the link I'm giving there are differences in 6 and 7 you will need the UI.

https://laracasts.com/discuss/channels/laravel/updated-from-6-to-70

I'd go with 7 because 6 to 7 is not that much difference.

Just make sure you hit everything in those upgrade guides just pay close attention.

Activity icon

Replied to Customize Pagination

And for an example of customizing a template see this:

https://laracasts.com/discuss/channels/guides/paginator-another-episode

Bottom line which some Style you can have your presenter anyway you desire.

May
25
3 days ago
Activity icon

Replied to Is There A Way To See What Laravel Is Expecting For The Magic Behind The Scenes?

@chrisgrim conventions like:

model is automatically assumed to have a user_id

Is in the chapter on https://laravel.com/docs/7.x/eloquent-relationships.

From your question, it sounded like you wanted the "behind the scenes" php code Taylor uses.

So I am sorry if I answered wrong, or did not understand what you were after.

Activity icon

Replied to Login With Ajax

I don't use ajax for login, but for some things, a simple example:

    public function petUpdate(Request $request)
    {

        if (!Auth::chklog('user')) {  // ignore, custom RBAC
            abort(403);
            
        }
        $request->validate([
            'species' => 'required'
        ]);
        $petid = $request->input('petid');
        $species = $request->input('species');
        $postdata = [
            'species' => $species
        ];
        
        DB::table('dc_pets')
                ->where('petid', $petid)
                ->update($postdata);
        return Response::json(['success' => 'all okay']);
        
    }

And error part

error: function (data, ajaxOptions, thrownError) {
                    var status = data.status;
                    alert(status);
                    if (data.status === 422) {
                        $.each(data.responseJSON.errors, function (key, value) {
                            $('#msg').append('<div>' + value + '</div>');
                        });
                    }

                    if (status === 403 || status === 500) {
                        $('#msg').text("Not Auth");
                       
                    }
                    //window.location.href = '<?//= DIR . "indexbl" ?>'; // or redirect
                }

In the above I display errors in a div. Validation just automatically works for me, if it fails I get the message in the div. I never need to use:

return \response()->json(0, 500); // your code

Jut let the validator do it's job.

Activity icon

Replied to How Can I Fetch A Php Class To A Laravel Project

If no one else responds shortly, I suggest start a new topic, something like:

I need help using Kenyan payment gateway

Something like that.

Activity icon

Replied to How Can I Fetch A Php Class To A Laravel Project

Which payment system are you using so others can get involved and maybe help.

Activity icon

Replied to Quit Laravel

First, do not give up. Everything seems hard at first until you are on other side.

Take a young person who just joined the Air Force, and they're going to find out they are going to be a jet engine mechanic. They are probably scared to death that they will never learn how to rebuild a jet engine.

Day one is hard, month Number 5 seems better one year seems even easier.

In other words they went to tech school learned the basics then got to their first base and went to on-the-job training with a technician learning a little at a time.

That's what you need to do a little at a time.

Activity icon

Replied to How Can I Fetch A Php Class To A Laravel Project

Have you looked over the chapter in the documentation on front end it explains how to set up assets. But anything PHP can be used in laravel since it's a PHP framework, also JavaScript and just about any JavaScript library you choose to use.

I noticed the word check out in your code is this some sort of a shopping cart. Anyway if that is the case whichever payment system you are using they will also have instructions on using their API.

Activity icon

Replied to While Installing Laravel Composer

I think it's sudo apt-get install php7.4-zip or your version. But I also noticed something else, in the Install chapter he doesn't mention the zip extension is required.

I don't use the installer, I usually use composer like the example:

composer create-project --prefer-dist laravel/laravel blog  // your project here.

But with above guides mentioned, you should be good to go now. If I get time I will put in a PR for the docs to include a statement that the zip ext is required for the installer.

Good luck getting set up.

Activity icon

Replied to Call To Undefined Function GetUser() After Deploy On Heroku Serve

@spiral glad you got it, that was a good catch on the autoload-dev.

Activity icon

Replied to Middleware Check Login Not Working

You can verify if someone is logged in via a route group, just example:

Route::middleware(['auth'])->group(function () {
    Route::get('dog/add', '[email protected]');
    Route::get('dog/delete', '[email protected]');
});

Anything in that group has to be logged in.

See my above edited reply, I use authorization to determine what a logged in user can or cannot do.

Jeffrey has several free videos on authorization in the from scratch video series.

Activity icon

Replied to Middleware Check Login Not Working

Did you put:

use Illuminate\Support\Facades\Auth;

But yes I'd handle that in route or controller, I use out of box authentication and I've never needed to add middleware.

Many times I like protecting a method, just example:

public function update(Request $request, Post $post) {
    if ($post->author !== auth()->user()->id || auth()->user()->cannot('edit posts'))
        abort(403);// or some other 
    }
    // rest of method if okay....
}
   
Activity icon

Awarded Best Reply on Is Laravel Mvc Knowledge Helpful When Moving To Another Technology?

You could also explore some examples for yourself, for example take a look at asp.net core it has two main ways now of doing things. MVC or razor pages with a model behind.

Wouldn't hurt to just browse over one of the free tutorials.

Java technology is similar it's already MVC, but you could also use just servlet, jsp, which is CV.

So in all the Technologies there are combinations of the MVC pattern.

May
24
4 days ago
Activity icon

Replied to I Work By Framework Like Laravel 6

Does the framework that is like laravel 6 have a forum. What framework are you using.

Activity icon

Replied to Is There A Way To See What Laravel Is Expecting For The Magic Behind The Scenes?

There should be a reference to the actual GitHub code.

https://github.com/laravel/framework/blob/7.x/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php

When all is said and done it reduces down to normal PDO SQL.

Activity icon

Replied to Laravel Saving Pages

Could you elaborate, by giving a little more detail.

Activity icon

Replied to Call To Undefined Function GetUser() After Deploy On Heroku Serve

Have you tried using the browser developer tools to see what's going on with response and request. And I am guessing from the question it works in local development, but not in production. Perhaps show the method.

Activity icon

Replied to Call To Undefined Function GetUser() After Deploy On Heroku Serve

Did you do a dumpautoload?

Did you check letter case?

Helpers verses helpers is case sensitive on linux.

Activity icon

Replied to Laravel Paginate Cashier Invoices

Not sure of how you have things setup. But here are a couple links showing paginating a relation.

Normally you:

yourquery->paginate(2);  

https://laracasts.com/discuss/channels/eloquent/how-to-paginate-relations-in-laravel

https://laracasts.com/discuss/channels/laravel/how-to-paginate-eloquent-hasmany-relation

These should give you an idea. Also review https://laravel.com/docs/7.x/pagination#paginating-eloquent-results

Activity icon

Replied to Is Laravel Mvc Knowledge Helpful When Moving To Another Technology?

You could also explore some examples for yourself, for example take a look at asp.net core it has two main ways now of doing things. MVC or razor pages with a model behind.

Wouldn't hurt to just browse over one of the free tutorials.

Java technology is similar it's already MVC, but you could also use just servlet, jsp, which is CV.

So in all the Technologies there are combinations of the MVC pattern.

Activity icon

Replied to What Is The Good Mobile Framework To Connect With Laravel Project

Are you wanting a mobile app or just mobile-friendly.

Activity icon

Replied to Multi Authentication Vs Role Based Access Level

Authentication means yes someone has logged in, but now the question what can that logged-in user do or not do see or not see. How do you prevent someone from changing an ID in the URL manually.

It takes a well-rounded Authentication and authorization system or RBAC to handle it all

I use Query scopes for fine tuning for example an admin can see everything but a user sees only their data.

May
23
5 days ago
Activity icon

Replied to Laravel Migration

See https://laravel.com/docs/7.x/eloquent#defining-models

Once you define models and put what's fillable they are going to communicate with existing tables. That's a first step later as you learn more start defining relationships.

Activity icon

Replied to While Installing Laravel Composer

First do you have composer installed. Once properly installed.

composer global require laravel/installer

 just go through the installation steps again you might have missed something.

May
22
6 days ago
Activity icon

Replied to Count(): Parameter Must Be An Array Or An Object

Is this

<?php
            $args = array(
                    'posts_per_page'=> 3,
                    'offset'=> 0,
                    'category' => '',
                    'category_name' => '',
                    'orderby' => 'post_date' ,
                    'order' => 'DESC',
                    'include' => '',
                    'exclude' => '',
                    'meta_key' => '',
                    'meta_value' => '',
                    'post_type' => 'post',
                    'post_mime_type' => '',
                    'post_parent' => '',
                    'post_status' => 'publish',
                    'suppress_filters' => true,

            );
                $my_posts = query_posts($args);
                foreach ($my_posts as $post){

            ?>

word press code. I don't understand how the the code interferes with a style you are using. Sorry if I misunderstand.

Activity icon

Replied to Laravel Version Upgrade From V4.0 To V7.0

It's probably possible, but honestly in my opinion it would be easier creating a new project and start updating your models, views, controllers to newer code as needed. That is a huge jump.

You could see if laravel shift will help, it cost. Just search web for laravel shift.

Good luck.

Activity icon

Replied to Eloquent Relationship, Group By

@yusuf375 did you figure it out, @ggio put in some effort to try to help you. At least let us know.

May
21
1 week ago
Activity icon

Replied to Production.ERROR: SQLSTATE[42000]: Syntax Error Or Access Violation: 1055 Expression #1 Of ORDER BY Clause Is Not In GROUP BY In Ubuntu

That'sounds okay, I agree I would look at reworking the query first but if it works fine at least there's a way to use it. Many of these type of queries worked in older versions of MySQL.

I am sure many developers in older applications have code that did not have such a restriction I myself did and that's why I discovered the above, and figured I would share it with others.

Activity icon

Replied to Production.ERROR: SQLSTATE[42000]: Syntax Error Or Access Violation: 1055 Expression #1 Of ORDER BY Clause Is Not In GROUP BY In Ubuntu

Why would you change that permanently when you can change it for just one single query.

config()->set('database.connections.your_connection.strict', false);

// change your_connection to actual connection

// then run your query

The link explains this.

Also study this and get a better understanding of what is actually happening.

https://dev.mysql.com/doc/refman/8.0/en/group-by-handling.html

Activity icon

Replied to Select SUM From Aliased Column

See image in this post: https://laracasts.com/discuss/channels/laravel/sort-a-column-of-calculated-value

I normally I have an extra query to do the final sum. In other words I have a running sum on each column and that query is separate from the final totals query.

And I apologize if I didn't understand exactly what you are after.

Activity icon

Awarded Best Reply on Authentication Question

Just example

public function update(Request $request, Post $post) {
    if ($post->author !== auth()->user()->id || auth()->user()->cannot('edit posts'))
        abort(404);// or redirect, or whatever action 
    }
    //rest of method if all okay
}

Also see https://gist.github.com/jimgwhit/ed44a6c81815804f1ab910ce9eb88d84

There is a scope example. Use your authorization I use custom.

Also Jeffrey has three or four free authorization videos in the free from scratch series.

Activity icon

Replied to Laravel 7.0 Validation In Log In Form

Okay, my laravel 7 is working, is this a new install or an upgrade you are having the problem.

If an upgrade re go over the upgrade guide.

And run

composer require laravel/ui "^2.0"

And look at https://laracasts.com/discuss/channels/guides/update-upgrade-laravel-then-framework

Activity icon

Replied to Gate 403 Vs 401

403 for not logged in, 401 not authorized to do something, but you are logged in.

But some folks use 403, it depends on how you set any custom messages for user.

Activity icon

Awarded Best Reply on Help, I Get An Error In My Database After I Have Deployed The Application

If it was working in local development, check your letter case, Linux case sensitive. Also make sure the table got uploaded (imported) to the production server.

Activity icon

Replied to Help, I Get An Error In My Database After I Have Deployed The Application

postController and PostController are not the same. That's just one thing to check, just trying to help but it could be something else.

So check your class and filenames for wrong letter size.

Activity icon

Replied to How To Use Guard In Laravel

Like:

public function update(Request $request, Post $post) {
    if ($post->author !== auth()->user()->id || auth()->user()->cannot('edit posts'))
        abort(404);// or redirect, or whatever action 
    }
    //rest of method if all okay
}

Look at guards or policies as fine tuning who can and cannot do what.

You have authentication which means someone is logged in.

However use authorization to determine what the logged in user can or cannot do.

Also use Query scopes to determine which user is seeing what data.

Example, you may have an admin who can see anybody's data, but a certain logged-in user can only see their data. you can use a query scope for this.

Activity icon

Replied to Help, I Get An Error In My Database After I Have Deployed The Application

If it was working in local development, check your letter case, Linux case sensitive. Also make sure the table got uploaded (imported) to the production server.