jlrdw

jlrdw

Member Since 5 Years Ago

Experience Points
629,970
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
253
Lessons
Completed
Best Reply Awards
718
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
629,970 XP
Oct
29
1 day ago
Activity icon

Replied to Multiple Database Consult In One

Agreed, you should set up some search queries and narrow down your results.

An example would be in books, searching by author, searching by title, searching by subject, etc.

I would say go to a book shop online and a auto shop online and get some ideas of how they use drill down searching.

The idea of efficient database use, is to only retrieve the results needed.

Activity icon

Replied to Need To Register/authenticate Two Types Of Users In The Same Laravel App

Use Authentication for login and use authorization to determine who can do what.

You can just make separate login panels depending on role.

To redirect depending on the role, see https://laracasts.com/discuss/channels/laravel/version-8-redirects

Activity icon

Replied to Getting Array From Db

If it is stored as string, to loop it, use explode function.

Just look this function up in the PHP manual it explains its usage.

Activity icon

Replied to How Do I Host Laravel And Inertiajs App In CPanel?

@gitwithravish here is correct, this guide is from @snapey website, secure and works:

http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

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

Notice in image "Main Laravel" is above, meaning outside of public_html.

Furthermore here is a guide from Laravel News:

https://laravel-news.com/subfolder-install

Activity icon

Replied to Getting Array From Db

Why not store the value in database fields, in related table.

Activity icon

Replied to Getting Array From Db

Why didn't you store as Json.

Oct
28
2 days ago
Activity icon

Replied to .env For Deployment

@lemmon I suggest looking at the deployment chapter.

https://laravel.com/docs/8.x/deployment

Activity icon

Replied to $image_tmp = Input::file('image');

Did you read the chapter on facade usage.

use Illuminate\Support\Facades\Request;

That is how you do a static looking Call.

In Laravel 8, Input is gone. Suggested to use $image_tmp = Request::file('image');

Your code was correct just missing that use statement.

Oct
27
3 days ago
Activity icon

Replied to Different Route, Same Controller Action: Why Is This Not Working?

@rodrigo.pedra did you see anything wrong with using a parameter for report type, I thought it would be the easy solution.

Especially since you want to cut down on the number of routes, not have more.

Activity icon

Replied to Different Route, Same Controller Action: Why Is This Not Working?

I would pass a parameter for the report type you want:

Route::get('/salesorders/{report}', 'Order\[email protected]');

then

  • if $report is shipping-report, run model shipping-report code with return.
  • if $report is daily-shipping-report, run model daily-shipping-report code with return.
Activity icon

Replied to What Would Be The Procedure To Update Data ? ? ?

I would store the data in regular database fields, not json. Then use regular crud (create, read, update, delete) techniques to handle this stuff.

I usually restrict a json field to simple data, like a small checkbox array where you might store:

["biking", "jogging", null, "baseball"]

Where someone checked biking, jogging, and baseball, and the null wasn't checked, in this case it was swimming not checked.

But just my opinion and just an example.

Activity icon

Replied to Different Route, Same Controller Action: Why Is This Not Working?

If you are using a query scope then only have one route and differentiate between your reports in the scope.

Activity icon

Replied to Different Route, Same Controller Action: Why Is This Not Working?

It would probably be easier just to have a different methough (function).

Oct
26
4 days ago
Activity icon

Replied to How To Guarantee Only One Record In The Database

Check the firstOrNew() method in eloquent docs.

Activity icon

Awarded Best Reply on How To Use Forked Repo In Composer....?

You need you repo url, not the authors.

Activity icon

Replied to How To Use Forked Repo In Composer....?

Could you show as solved.

Activity icon

Replied to How To Use Forked Repo In Composer....?

You need you repo url, not the authors.

Activity icon

Replied to How To Use Forked Repo In Composer....?

A fork will use your name. Is gocardless your Github repo.

And if you put in for a pull request I would wait and see if it goes through, that way you could just use the original.

Or fork and have your own to modify as you see fit.

Activity icon

Replied to How To Use Forked Repo In Composer....?

Can you share the link to that GitHub repository.

Activity icon

Replied to How To Use Forked Repo In Composer....?

When you click in the repo clone or download, the link should be there, that is the correct to pull it in.

Just use git to pull it in.

Git for url, composer is like this example:

   "laravel/framework": "^8.0",
Activity icon

Replied to Do You Really Like Tailwind And Livewire ?

Since @thewebartisan7 mentioned jquery, I'd like to add:

When I started to use fetch js instead of jquery, I learned quickly that jquery handles a lot for you.

Like https://laracasts.com/discuss/channels/javascript/jquery-td-to-javascript-td

It was a little more involved in fetch js and plain js.

I would suspect that jquery will be around a long time and maybe even out last some of the others, it still does so much for you.

Activity icon

Replied to Taylor Discusses Jetstream And Laravel UI

Just remember you can redesign those screens anyway you like. For example in one app I have admin and bookkeeper roles. I redirect to their area depending on role.

It's a little involved, I won't go into details, but you might have one person who is admin and bookkeeper.

In such a case they are redirected to admin area, but a link is shown to bookkeeping. The link is only shown if they have both roles. Nothing a small if statement doesn't take care of.

You have to remember also that when the scaffolding takes place, it's only meant as a starter, I'm sure Taylor figured Developers would redesign to their custom needs.

I find it pretty easy to take one panel, duplicate it, and do the final design in one for admin, and the other bookkeeper.

Also I definitely use Authentication for a login is required, and use authorization to determine what that logged in person can or cannot do.

Activity icon

Replied to Do You Really Like Tailwind And Livewire ?

I use fetch js and regular js. Tailwind of course is css. I normally write my own CSS where needed and use bootstrap.

I don't see why any of this stuff is scaffolded or included. If a developer wanted to use livewire, they could install it.

I like the PHP framework I'll leave it at that.

And I know you've been around since the beginning also since the version 4 good ole days.

And to answer your original question, no.

Activity icon

Replied to Do Industry Professionals Really Use UML Diagrams Before Coding?

Many application types such as supply, inventory, bookkeeping and accounting, income and expense reports, locistics with dispatch software, these are much the same techniques over the years. I just tailor to the companies custom needs.

It helps when you have worked in these industries with paper and pencil and file cabinets as well, which I have. It helps to understand what is needed in a program.

Basic bookkeeping has been the same for generations. But just requires some custom code, I.e., it's a little different for a non profit.

A good real life example, when I had to program for a non profit, I did not go to a forum. Rather I set up several in person meetings with a CPA to learn exactly what is needed for the IRS concerning this non profit, etc. So that's where I began.

I believe:

Do industry professionals really use UML diagrams

No. someone may flash one around, but probably not a programmer.

Oct
25
5 days ago
Activity icon

Replied to Blade Problem

Glad to hear you solved it.

Activity icon

Replied to Blade Problem

Is the file named whatever.blade.php?

Activity icon

Replied to Count Even Days And Not Even Days In A Date Range

Was hoping carbon docs would be used as isMonday, etc is right in the docs. That way @kalimeromk would learn carbon usage. But great answer.

Activity icon

Replied to Count Even Days And Not Even Days In A Date Range

Some if constructs and look at carbon examples:

https://carbon.nesbot.com/docs/

Activity icon

Replied to Is It Possible Send Direct Print To Printer In Laravel

You could search for some JavaScript functions that handles that I've seen a few but haven't saved the links.

Activity icon

Replied to Timestamp Format Invalid, Only When Past Year 2038??

Use a date field in MySQL.

Oct
24
6 days ago
Activity icon

Replied to Change Jetstream Laravel 8 Register Field From Email To Cellphone

@farshadf there are tutorials on sms like https://laravel-news.com/sending-receiving-sms-laravel-nexmo

But what if someone doesn't have a cell phone.

Even some sites that send a verification token sms will also allow via email as alternative.

Just something to think about.

Activity icon

Replied to Laravel Fortify With Laravel Socialite

@martinbean isn't passport targeted more to API's.

I can login on stackoverflow (regular web pages) with facebook, non api.

But I don't know if @foks meant api, or traditional web app.

Activity icon

Awarded Best Reply on Update Quantity In Darryldecode/laravelshoppingcart

Ok here is the update code from your package, it should guide you:

    public function update($id, $data)
    {
        if ($this->fireEvent('updating', $data) === false) {
            return false;
        }

        $cart = $this->getContent();

        $item = $cart->pull($id);

        foreach ($data as $key => $value) {
            // if the key is currently "quantity" we will need to check if an arithmetic
            // symbol is present so we can decide if the update of quantity is being added
            // or being reduced.
            if ($key == 'quantity') {
                // we will check if quantity value provided is array,
                // if it is, we will need to check if a key "relative" is set
                // and we will evaluate its value if true or false,
                // this tells us how to treat the quantity value if it should be updated
                // relatively to its current quantity value or just totally replace the value
                if (is_array($value)) {
                    if (isset($value['relative'])) {
                        if ((bool)$value['relative']) {
                            $item = $this->updateQuantityRelative($item, $key, $value['value']);
                        } else {
                            $item = $this->updateQuantityNotRelative($item, $key, $value['value']);
                        }
                    }
                } else {
                    $item = $this->updateQuantityRelative($item, $key, $value);
                }
            } elseif ($key == 'attributes') {
                $item[$key] = new ItemAttributeCollection($value);
            } else {
                $item[$key] = $value;
            }
        }

        $cart->put($id, $item);

        $this->save($cart);

        $this->fireEvent('updated', $item);
        return true;
    }

You do know you can search a github repo for methods, right.

In above see this line:

relatively to its current quantity value or just totally replace the value

Activity icon

Replied to Laravel Authentication

The problem is that I need to login two times to enter my site

Are you saying:

  • login two times to enter my site (is that intended behavior?)

or

  • Are you expecting just one login, but two is a mistake?

I would use the authenticated method of the login controller for this, part of the trait.

I have redirected depending on if admin, if bookkeeper, etc and never had to touch middleware.

Comment out

// protected $redirectTo = '/polizza';  not needed.
Activity icon

Replied to Update Quantity In Darryldecode/laravelshoppingcart

Can you show as answered, thanks.

Activity icon

Replied to Update Quantity In Darryldecode/laravelshoppingcart

Ok here is the update code from your package, it should guide you:

    public function update($id, $data)
    {
        if ($this->fireEvent('updating', $data) === false) {
            return false;
        }

        $cart = $this->getContent();

        $item = $cart->pull($id);

        foreach ($data as $key => $value) {
            // if the key is currently "quantity" we will need to check if an arithmetic
            // symbol is present so we can decide if the update of quantity is being added
            // or being reduced.
            if ($key == 'quantity') {
                // we will check if quantity value provided is array,
                // if it is, we will need to check if a key "relative" is set
                // and we will evaluate its value if true or false,
                // this tells us how to treat the quantity value if it should be updated
                // relatively to its current quantity value or just totally replace the value
                if (is_array($value)) {
                    if (isset($value['relative'])) {
                        if ((bool)$value['relative']) {
                            $item = $this->updateQuantityRelative($item, $key, $value['value']);
                        } else {
                            $item = $this->updateQuantityNotRelative($item, $key, $value['value']);
                        }
                    }
                } else {
                    $item = $this->updateQuantityRelative($item, $key, $value);
                }
            } elseif ($key == 'attributes') {
                $item[$key] = new ItemAttributeCollection($value);
            } else {
                $item[$key] = $value;
            }
        }

        $cart->put($id, $item);

        $this->save($cart);

        $this->fireEvent('updated', $item);
        return true;
    }

You do know you can search a github repo for methods, right.

In above see this line:

relatively to its current quantity value or just totally replace the value

Activity icon

Replied to Update Quantity In Darryldecode/laravelshoppingcart

Use their example as guide

Cart::update($rowId, 2); // Will update the quantity

So in yours retrieve the new quanatity in request and perform an update then display cart with updated information.

No different that other updates.

In your package is the quantities held in session, or where. Either way you should be able to perform the updated quantity.

Activity icon

Replied to Update Quantity In Darryldecode/laravelshoppingcart

This line here:

Adding an item to the cart is really simple.......

Cart::add('293ad', 'Product 1', 1, 9.99);

Looks like they add one item. So if one was in cart, now it's two. Or am I reading it wrong.

Activity icon

Replied to Update Quantity In Darryldecode/laravelshoppingcart

I shop online often, usually when updating quantity, you are adding the amount you want to add.

  • I have currently one.
  • If I want to have two, then add one.

That is pretty standard.

But you could put a screen shot here, use imgur. And standard img tag in text area.

Activity icon

Replied to Update Quantity In Darryldecode/laravelshoppingcart

You could setup another laravel project, and use the demo for learning:

https://github.com/darryldecode/laravelshoppingcart-demo

Activity icon

Replied to Why After Post Request My New Blade File Is Not Open....

If you are new to shopping carts, I would suggest you look over the code on a couple on Github and get some ideas of how things are done. Just a suggestion.

But here:

public function storeValue(Request $request)
{
    $data = $request->all();

    // do what you need here

  return Response::json(['success' => 'all okay']);
// replace with what you need to do.
}

If you need to redirect, you can do it in js

window.location.href = "your_url";  // route

And above, don't forget to validate data.

Activity icon

Replied to Why After Post Request My New Blade File Is Not Open....

@araw because you are using ajax, it expects a response. The network tab is the way to troubleshoot ajax request and response.