jlrdw

jlrdw

Member Since 4 Years Ago

Experience Points
446,770
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
152
Lessons
Completed
Best Reply Awards
480
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.

Level 50
446,770 XP
Jan
25
1 day ago
Activity icon

Replied to Role Permission

Also https://laracasts.com/discuss/channels/laravel/multi-auth-on-laravel-using-the-same-login-page

Plus learn how to properly apply HIPAA in your code. (Health Insurance Portability and Accountability Act).

There are Federal rules of how data is transmitted, stored, what can and cannot be emailed, etc.

Activity icon

Replied to Open Folder/file In Editor From Page

If you mean a webpage, I've never heard of doing that. Your project is a web app. But I suppose there is a way to call exec. https://www.php.net/manual/en/function.exec.php

See also https://laracasts.com/discuss/channels/general-discussion/run-bat-with-full-control

Activity icon

Replied to Open Folder/file In Editor From Page

Can you rephrase what you are trying to do.

Jan
24
2 days ago
Activity icon

Replied to Checkbox Save Laracast

Also if a checkbox is not checked, nothing is passed in the request (post, put, patch, get). See

https://laracasts.com/discuss/channels/laravel/show-if-checkbox-is-checked-or-unchecked-in-edit-view

https://laracasts.com/discuss/channels/general-discussion/blade-checkbox-and-eloquent

In laravel use the request has method: https://laravel.com/docs/6.x/requests

Excerpt from docs:

if ($request->has('name')) {
    //
}

You can use a ternary.

Activity icon

Replied to Define Eloquent Relationships For Tables

A good start would be to work some of the examples in the documentation. Just set up a practice project just to work examples.

Activity icon

Replied to Can Convert To Eloqoent

Also why convert if it's working, see:

https://laracasts.com/discuss/channels/laravel/sql-native-to-query-builder

And converting some queries to eloquent has been covered many times right here.

All you have to do is punch into Google an expression like:

site:laracasts.com convert query to eloquent

There are many pages that come up with excellent examples.

Activity icon

Replied to Image Upload

See https://laracasts.com/discuss/channels/laravel/file-storage-3

And

https://laracasts.com/discuss/channels/general-discussion/uploading-an-image-in-laravel

Notice the

$file->move($destinationPath, $newname);

Make sure where you place file has proper permissions.

Jan
23
3 days ago
Activity icon

Replied to Authetication Tutorial

You all set then Jeffrey has authorization videos, but an easier system might be spatie permissions for you.

https://github.com/spatie/laravel-permission

Look it over. You will still need query scopes at places.

Activity icon

Replied to Authetication Tutorial

5.7 from scratch series he has one free authorization video, that will get you started.

Also learn query scopes. See https://gist.github.com/jimgwhit/ed44a6c81815804f1ab910ce9eb88d84

Has a scope example.

Jeffrey also has paid videos on authorization, but don't know if you want to pay right now or not.

Activity icon

Replied to Different Result In Array Depending On The Server?

See https://stackoverflow.com/questions/3406171/php-var-dump-vs-print-r Has difference in print_r and var_dump.

I wonder if it's a MAC thing. I got curious myself and have been searching, but haven't found a solid answer yet.

I use windows 10 local, linux production.

Activity icon

Replied to Question About Laravel And Controllers

You have a controller for the main topic at hand for example one application I have a bookkeeping controller and another user controller, etc

And no it's not good to cram everything like whole application into one controller.

Activity icon

Replied to How Do You Publish Laravel Project ?

Also there are tutorials on this. GitHub also has tutorials, plus digitalocean has guides.

Or use laravel Forge. I'd start with watching a free tutorial on this whole process.

Practice it first on just a test project to get the feeling of how it all works.

I would also urge Taylor to make the entire Forge videos free, since it's a paid product, the nova ones are free.

But just my opinion.

Activity icon

Replied to Different Result In Array Depending On The Server?

Perhaps do some searches and see if php 7.2 handled array results differently. But that is weird.

Activity icon

Replied to Laravel Upgrade

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

Sometimes it's just as easy with a new install, then migrate over your models, views, controllers, etc

Activity icon

Replied to Laravel Permission

You don't, they are specific to use case.

Activity icon

Replied to Different Result In Array Depending On The Server?

Try getting results with a normal query. Use DB facade.

Jan
22
4 days ago
Activity icon

Replied to Different Result In Array Depending On The Server?

I did a quick test:

        $employees = collect([
            ['id' => 4, 'email' => '[email protected]', 'position' => 'Developer'],
            ['id' => 7, 'email' => '[email protected]', 'position' => 'Designer'],
            ['id' => 9, 'email' => '[email protected]', 'position' => 'Developer'],
            ['id' => 2, 'email' => '[email protected]', 'position' => 'boss'],
        ]);
        $plucked = $employees->pluck('id');
        
        var_dump($plucked->all());
        die;

Results give:

array(4) { [0]=> int(4) [1]=> int(7) [2]=> int(9) [3]=> int(2) }

A dd gives:

array:4 [▼
  0 => 4
  1 => 7
  2 => 9
  3 => 2
]

How are you getting [1,2,3,4] without keys?

Activity icon

Replied to Different Result In Array Depending On The Server?

I'm not sure if there's a PHP array setting but it seems like the local is treating them as numbers and the other is treating them as strings.

What's the difference in the local and the production. I mean operating system.

Activity icon

Replied to How Do You Publish Laravel Project ?

Plus it depends on what you are going to do a small site for shared hosting or something like digital ocean.

Usually shared hosting will be FTP, some shared hosting you can use GitHub, and to the host via git.

There are tons of past answers on this, if you punch the following into Google

site:laracasts.com deploy laravel

Of course feel free to punch in other Search terms.

By the way digitalocean has tutorials if you do not want to use Forge, of course this stuff is up to you.

Activity icon

Replied to Getting Different Results In PhpMyAdmin AND Laravel With Same Query

Do a

echo '<pre>';
print_r($your qyery here);
echo '</pre>';
exit();

May help you see results better.

Jan
21
5 days ago
Activity icon

Replied to Form Inside A Form With Post And Get Method Not Working (Nested Form)

You can have more than one form on a page, just don't nest them.

Play and experiment around a little bit to get what you need working that's what most of us have to do.

Sometimes basic trial and error.

Jan
20
6 days ago
Activity icon

Awarded Best Reply on File Storage

See https://laracasts.com/discuss/channels/laravel/next-issue-fonts-and-images-arent-visible

I have images under assets, all is fine.

I would only be concerned where you place images if they are private customer images only.

Activity icon

Replied to File Storage

See https://laracasts.com/discuss/channels/laravel/next-issue-fonts-and-images-arent-visible

I have images under assets, all is fine.

I would only be concerned where you place images if they are private customer images only.

Jan
19
1 week ago
Activity icon

Replied to Best Way To Sway Clients Away From Using WordPress

I would just say if you know WordPress and the client wants WordPress then use WordPress.

But at least Enlighten them as to alternatives and other ways you could program what they want.

But let the client make the final decision.

Activity icon

Replied to Deny Table Acces In Database

God speed in your future career.

Activity icon

Replied to Safari Is Stripping Data From My Response Object

All I can think of is look at some axios tutorials that is actually working and compare your code to the good working code.

Also try to send a request, just a practice one., with no middleware or nothing extra in laravel to see if it works.

Because if this was a common problem there would be a lot more post on it.

Also try not having the last forward slash.

And this was in reference to the other link.

Jan
18
1 week ago
Activity icon

Replied to Recursive Select Option Dropdownlist

Are you sure your fullName function is working, I may be wrong but it doesn't seem like it's setup as an assessor.

Activity icon

Replied to Bootstrap Process

If you install a package with composer you shouldn't need to require it again as laravel takes care of that, classes will be Auto loaded.

After a new installation of a package it doesn't hurt to run composer dumpautoload. But usually not necessary.

Activity icon

Replied to Deny Table Acces In Database

@pain12 I would also suggest you make up a "learning" project, and just play around with various things, middleware, query scopes, some query builder, some eloquent, db facade, Auth, play around with manipulating date, practice some queries with date like getting data between two dates, things like that. That way you can test out techniques on a "practice" project first.

Activity icon

Replied to Advice: Handling Viewing Old Form Entries

@dutchfiddle I only do business apps. So an example, Income and Expense at a non profit for a year is archived in another backup database. But still can be retrieved and viewed if ever needed. Especially if for some reason the IRS needed greater detail, I.e., A detailed transactions report.

Activity icon

Replied to Deny Table Acces In Database

You could still write a query scope for that.

A scope does not have to be eloquent it can be regular SQL.

That's your choice. But a scope would be a great place to narrow something like that down.

Activity icon

Replied to Sql Injection In Laravel

Eloquent will protect but not raw statements inside of eloquent.

Behind the scenes eloquent does proper bindings.

Taylor has a passage on this in the documentation.

You can also study the API documentation to see more.

Jan
17
1 week ago
Activity icon

Awarded Best Reply on Select On Table

Activity icon

Replied to How To Set Role From Employee Controller

They have very terse, expressive docs: https://docs.spatie.be/laravel-permission/v3/basic-usage/role-permissions/

https://docs.spatie.be/laravel-permission/v3/introduction/

https://github.com/drbyte/spatie-permissions-demo/blob/master/app/Policies/PostPolicy.php

https://github.com/spatie/laravel-permission/blob/master/docs/best-practices/roles-vs-permissions.md

    public function update(User $user, Employeedata $employeedata)
    {
        if ($user->can('edit own employeedata')) {
            return $user->id == $employeedata->user_id;
        }
        if ($user->can('edit all employeedata')) {
            return true;
        }
    }  // just example
Activity icon

Replied to Store Function Doesn't Work

@pain12 earlier when I mentioned:

Make sure you use the request has method to verify checkbox data was sent.

An unchecked checkbox, nothing is sent.

I was hoping you would look up that method in the docs.

https://laravel.com/docs/6.x/requests

Taylor has an example.

Sorry in my earlier post I didn't give the link to the documentation on request.

Activity icon

Replied to How To Set Role From Employee Controller

Look at more spatie examples. They have links to examples, i.e.,

public function update(Request $request, Post $post) {
    if ($post->author !== auth()->user()->id || auth()->user()->cannot('edit posts'))
        abort(404);// or some other 
    }
}

Also https://gist.github.com/jimgwhit/ed44a6c81815804f1ab910ce9eb88d84 not spatie, but at times a scope and Auth work together.

Activity icon

Replied to Update Record Using Modal Popup

In the images I have the table.

A click event takes place on a table row.

Which loads the hidden division in your case you want a modal

The modal fields data is got from either Ajax finding the ID or directly from the table your choice.

You type in whatever updates

You use Ajax to reload the table on screen, and close modal.

It all starts with

$("#myTable td:nth-child(1)").click(function (event) {
Jan
16
1 week ago
Activity icon

Replied to Store Function Doesn't Work

Make sure you use the request has method to verify checkbox data was sent.

An unchecked checkbox, nothing is sent.

Activity icon

Replied to Composer Being A Knob!

Did you clear composer cache, and perhaps update composer.

Activity icon

Replied to How To Use Authorization For Custom Guard

What is "Auth::guard('admin')->user();" suppose to do. I use custom stuff, but you did not show much code.

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