willvincent

willvincent

Member Since 5 Years Ago

Central Minnesota

Experience Points
363,245
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
1710
Lessons
Completed
Best Reply Awards
345
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
363,245 XP
Jun
24
2 weeks ago
Activity icon

Replied to String Back To Checked Checkbox

basically, yes.. But ideally that $t->teamexperience would already be an array so as not to have to be exploded on each iteration of the loop... and instead of manually defining each checkbox, you should use a loop :)

Activity icon

Replied to How Can Change The Database Status Value With Vue-js-toggle-button Plugin

Assuming the route is correct, and you don't have auth issues, that looks like it ought to work.

Jun
22
2 weeks ago
Activity icon

Replied to Is It Good Idea To Decrease BCRYPT ROUNDS?

Looking at this another way -- if you have 10k user's credentials in plain text in a csv, those passwords should all be considered compromised, and you'd want to enforce that they set new ones anyway

Activity icon

Replied to Is It Good Idea To Decrease BCRYPT ROUNDS?

I like snapey's solution.. generate a hash, once, for a value that is invalid based on the password validation, empty string or otherwise, and use it for every imported user.

They then will have to set a new valid password, via the "forgot password" functionality, to be able to login.

Activity icon

Replied to How Can Change The Database Status Value With Vue-js-toggle-button Plugin

It doesn't appear that that plugin provides a great method of maintaining state external to vue, so you'll want to pass your product record to your change handler, and then make an ajax call within the change handler to your backend to update the value.

So something like this:

<tr v-for="(product,key) in products">
  <td class="text-center">
    <toggle-button 
      @change="onChangeEventHandler(product)"
      :labels="{checked: 'Completed', unchecked: 'Open'}"
      style="margin-left: 20px" width="80" />
  </td>
</tr>
methods: {
  async onChangeEventHandler(product, $event) {
    const result = await axios.put(
            `https://your.api/products/${ product.id }`,
            {
              status: $event.value
            }
     );

    // Probably also want to display an alert here on success or failure
    // and toggle the thing back to its previous state as necessary.
  },
}

May also be better to have a specific route that only allows state toggling, rather than the same route that would be used for updating a record in general... but assuming the backend has appropriate auth in place, that may not be an issue. Of course there are also csrf concerns to deal with, but this is the general pattern you'll use.

Jun
19
3 weeks ago
Activity icon

Replied to Laravel Authentication

The fastest option of course is to use the --auth flag when creating a new install: laravel new blog --auth which will include all the auth scaffolding.

You can install boilerplate auth UI (and the requisite backend scaffolding) to an existing project by: php artisan ui --auth and there are many different options that can be used there, vue, bootstrap, react, tall, etc... (php artisan ui vue --auth for example)

Once you have the auth controllers and such installed you should be able to fairly easily change the hashing method, change the model used for authentication, etc.

Relevant portion of docs: https://laravel.com/docs/7.x/authentication

Activity icon

Awarded Best Reply on @willvincent Rateable

Install v2.2.0, just released.

Includes a bit cleaner rating syntax, and a way to enforce that users only rate once and any subsequent rating overrides (updates) their previous rating:

$post = Post::first();

$post->rate(5);


// on rating per user/model:

$post->rateOnce(3);

Also includes methods to get the number of times a thing has been rated by a unique user id:

$post->usersRated();

// And total rating, which is really just an alias for $this->ratings()->count()
$post->timesRated();

Enjoy :)

Jun
18
3 weeks ago
Activity icon

Replied to Why NoSql Still Not Popular Among Most Users Compare To Relational Database?

usually, a people without a complaint tend to design the worst database then throw the away their project mid way because. Seen a lot, especially the sql fan boy.

What language is this? Incoherent ramblings of a troll, I guess.

Activity icon

Replied to @willvincent Rateable

Install v2.2.0, just released.

Includes a bit cleaner rating syntax, and a way to enforce that users only rate once and any subsequent rating overrides (updates) their previous rating:

$post = Post::first();

$post->rate(5);


// on rating per user/model:

$post->rateOnce(3);

Also includes methods to get the number of times a thing has been rated by a unique user id:

$post->usersRated();

// And total rating, which is really just an alias for $this->ratings()->count()
$post->timesRated();

Enjoy :)

Activity icon

Replied to @willvincent Rateable

Truth be told I haven't touched the package in a while... but I think I might be able to improve the experience a bit. Hadn't accounted for the restriction of only being able to rate once/user, but that's definitely a valid use case. I'll see if I can add that in an easy to use manner... need to update the codebase a bit anyway, so this gives me an excuse to do so.

As for number of users that voted, I believe it would need a groupBy user_id clause otherwise in the case a rating isn't constrained to one per user, you would be getting a count of all ratings, rather than the count of unique users that rated the model

Both of those are probably worthwhile additions though.

Activity icon

Replied to How To Handle Session? (not User Authentication Session)

not to mention any app of reasonable size almost certainly has jobs that need to run periodically anyway, so running cron on a regular basis to ensure scheduled tasks fire is always a good thing.

Activity icon

Replied to Why NoSql Still Not Popular Among Most Users Compare To Relational Database?

any small to medium app is better off with NoSql than RDBMS.

No. Most apps have no real use for nosql, and shouldn't be using it in the first place.

It's hugely widespread because a bunch of jackasses promoted it as the best thing since sliced bread, and somehow convinced swarms of (largely javascript) developers to reach for mongo first, rather than ascertain the actual needs of their product/app/whatever and make an informed decision. This often (generally) leads to wildly inefficient data backends that are thrown together on the fly with no care given to what the structure of the data actually ought to be.. not just right this second, but in a week, a month, 5 years.

The complete lack of forethought and foresight that plagues developers lately is endlessly frustrating.

Stop chasing "the shiny" .. think about what you want to do, plan your move(s), and implement with purpose.

Or don't I guess.. but please keep your lazy schema design and cowboy coding at home. There's already far too much of it in the wild.

Jun
14
3 weeks ago
Activity icon

Replied to Are The Laracasts Php Tutorials Enough To Learn Php?

PHP practitioner is a general intro to php. Obviously it won't cover the full breadth of the language, but the basics of what different variable types are/etc..

The real meat here comes in other series like the laravel from scratch series. But you really need a reasonable familiarity and understanding of the language to really get the most from those other series.

Depending on what you're hoping to build, it's entirely possible that one of the series; laravel from scratch, lets build a forum, etc.. would provide enough info to be able to productively build your own thing, but it's really impossible to say without knowing what you already know, what sort of learner you are, etc.

I, personally, think Jeffrey is one of (if not the) best instructors online.

What do you mean by "only on the first part" -- like, just the first video, or...?

Activity icon

Replied to How To Post Code Snippets On The Forum?

As is says in the footer of the comment editor...

You may use Markdown with GitHub-flavored code blocks

The link takes you to the github documentation covering precisely this ;)

May
31
1 month ago
Activity icon

Replied to Advanced DB Structure Philosophy Example

Gonna involve a lot of unnecessary joins. You'd be better off just using enums

As for how to embed images, it's standard markdown format...

![optional alt text](https://url.to.your/image)
May
07
2 months ago
Activity icon

Replied to Modify Sql Query To Eloquent Query

it's in the ballpark.. you just need to work through it.. I don't have your DB, so am mostly shooting in the dark.

Activity icon

Replied to Modify Sql Query To Eloquent Query

Try it without the groupBy

May
05
2 months ago
Activity icon

Replied to Is Laravel A Good Choice For A Startup?

@gthell If you prefer node, AdonisJS is very laravel-like.. I can honestly say though, having migrated an application from meteor to adonis, and maintaining it daily, I should've gone with laravel instead. The 'async everything' approach tends to be more of a hindrance than a help in most cases. Two specific examples; file i/o and DB queries.

But, Adonis is modeled on Laravel, it's orm is modeled on eloquent.. it's very similar, primary difference being the underlying programming language.. the newest version, 5.0, with a complete rewrite of core code in typescript, is nearly complete.

However -- laravel has a much larger community, and frankly the node ecosystem is no better than PHP.. just different.

Activity icon

Replied to How To Set Many 301 Redirects In Laravel?

Unless you need to be able to configure misc redirects from the UI, you're definitely better off configuring them within your apache/nginx config or .htaccess file so that the redirect happens without having to bootstrap the app and evaluate the routes, etc. Let the webserver handle it directly.

Activity icon

Replied to Modify Sql Query To Eloquent Query

$startOfWeek = Carbon::now()->startOfWeek();
$endOfWeek = Carbon::now()->endOfWeek();

$week_data = DB::table('products')->select(
        'products.id',
        'products.name',
        DB::raw('ifnull(sum(stocks.qty),0) as sqty_curr'),
        DB::raw('ifnull(sum(loadings.qty),0) as lqty_curr'),
        'products.open_stock',
        DB::raw('ifnull(sum(ifnull(sum(stocks.qty),0) + open_stock - ifnull(sum(loadings.qty),0)),0)'))
    ->join('stocks', 'stocks.pid', '=', 'products.id')
    ->join('loadings', 'loadings.pid', '=', 'products.id')
    ->whereBetween('stocks.Indate', [$startOfWeek, $endOfWeek])
    ->whereBetween('loadings.Outdate', [$startOfWeek, $endOfWeek])
    ->groupBy('products.id')
    ->get();

This should be in the right ballpark, and fetch all the info you're looking for in a single query.

Apr
30
2 months ago
Activity icon

Replied to Need Npm Run Dev Before Npm Run Prod?

So (almost?) everything in my devDependencies should by in dependencies, then, right?

These for sure:

  • axios
  • bootstrap
  • font-awesome
  • imagemin
  • jquery (if you're actually using it.. should just use vue instead though really)
  • lodash (if using it within your vue components, otherwise no)
  • pace
  • popper.js
  • simple-line-icons
  • sweetalert
Apr
29
2 months ago
Activity icon

Replied to Doing A Sort/orderBy But Ignoring An Apostrophe At The Start?

Before worrying about how to sort dirty data... why do you have dirty data in the first place?

Activity icon

Replied to How I Can Write This Shorter?

multiple endpoints instead of one controller method for all of these various situations... query scopes..

Apr
23
2 months ago
Activity icon

Replied to Vue

You'll probably get more assistance if you ask a specific question, rather than just state that you have a problem.

Probably also would help to post said question in English. :)

Apr
22
2 months ago
Activity icon

Replied to Composer Are Idiot ?

Snapey already gave you the answer.

pragmarx/tracker v3.5.0 requires laravel/framework ~4|~5|~6 -> satisfiable by laravel/framework[4.0.x-dev, 4.1.x-dev, 4.2.x-dev, 5.0.x-dev, 5.1.x-dev, 5.2.x-dev, 5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.x-dev, 5.8.x-dev, 6.x-dev]

That's the issue. either downgrade laravel, or get pragmarx to upgrade tracker (or fork and do it yourself, and preferably submit a PR)

Activity icon

Replied to Lumen / Vapor - Is It Possible

Why not just turn off the parts of laravel you don't want (views, for example) and save yourself large amounts of frustration?

Apr
15
2 months ago
Activity icon

Replied to I Want To Display Only Users That Have A Certain Role

$users = User::where('role_id', 2)->paginate(4);

All very clearly documented... https://laravel.com/docs/7.x/queries

Activity icon

Replied to S3 File Upload Issue

Just a hunch, but ... docx, xlsx, pptx, etc are zip files.. so if you're detecting the mime type automagically, it's probably seeing the zip header in the file and treating it accordingly, you may have to explicitly define the mime type instead of detecting the mime type. Try getClientMimeType() instead of getMimeType might be more reliable

Apr
14
2 months ago
Activity icon

Replied to Laravel Rating Stars Package

@philipo you must be mistaken.. my laravel-rateable package doesn't provide any UI elements whatsoever. It's just the polymorphic relationship, and some calculation methods to retrieve rating values.

Apr
11
3 months ago
Activity icon

Awarded Best Reply on Some Fields Save Null To The Database In My Laravel Project

I see the problem.. hadn't noticed before that these fields are disabled

That's problematic if you need them to submit.. instead you should use readonly or optionally remove the 'disabled' attribute on submit otherwise a disabled input does not post ... this is explicitly part of the html4 spec.

Apr
10
3 months ago
Activity icon

Replied to Making HTML File Work With The Application In The Blade

Ugh. Godaddy is awful.

In any case.. for a properly functional laravel deployment the http server docroot should point to the laravel app's public directory.

Not sure if you can alter the docroot config that way on godaddy.. you'd be much better off just moving it elsewhere.

Activity icon

Replied to Exceeds Your Upload_max_filesize Ini Directive (limit Is 2048 KiB)

Possible you updated the wrong php.ini file, create a route that returns phpinfo() so you can see what the active config really is. I've also seen issues with file size limits come from nginx, if you happen to be running it.. but an error that explicitly references upload_max_filesize does sound like a php config issue.

Verify your php.ini changes are in place, etc by looking at the output of phpinfo, best way to know for sure what's going on under the hood.

Activity icon

Replied to QR Code In Laravel

Seems a pretty easy problem to solve.. Generate a QR code that points to a URL with a time-constrained token.

  1. So first, create a new token in the DB with an expiration 3min in the future, or whatever.
  2. Setup a route that takes a token as a parameter: my-qr-route/{token}
  3. Look up the token, validate it's not yet expired, allow submittal.
  4. Remove expired tokens with a cron job.
Activity icon

Replied to Some Fields Save Null To The Database In My Laravel Project

I see the problem.. hadn't noticed before that these fields are disabled

That's problematic if you need them to submit.. instead you should use readonly or optionally remove the 'disabled' attribute on submit otherwise a disabled input does not post ... this is explicitly part of the html4 spec.

Activity icon

Replied to Some Fields Save Null To The Database In My Laravel Project

Are you sure your ajax request is working, and actually populating values?

Activity icon

Replied to Laravel-Mix | Double Slash "//" Comments In SCSS

You could try reverting to an earlier version of laravel mix

Activity icon

Replied to Stop Adding Poor Quality Laravel Addons

Looked at the issue.. appears that the most recent comments offer solution(s), and indicate "it should be added to the docs"

Great. add it to the effing docs then.

https://laravel.com/docs/7.x/contributions

Rather than bitching about "shit doesn't work" or "documentation is shit" ... submit fixes, and better documentation. That's literally the point of open source.

Activity icon

Replied to How To Added The @Symbol Before Username Of Profile

About an hour ago you said

I have applied all of these ideas and adjustments and they are working well

Now you say you're stuck... so... which is it?

Activity icon

Replied to Laravel-Mix | Double Slash "//" Comments In SCSS

Unless something has changed, I seem to recall there being known issues around style extraction from vue files with the latest version(s) of laravel-mix. Might be related

Activity icon

Replied to Package Development Nested Resources Route Model Binding

Yeah, that was in the link I shared :D

Activity icon

Replied to How To Added The @Symbol Before Username Of Profile

But again.. What's the purpose of using both a slug AND id in the path? That's redundant

If you don't care about the slug, and are always going to look up via the last param anyway, then instead of doing route model binding just use a regex that accepts basically anything beginning with an @ as that param, and then ignore it in your controller I guess... but.. still, redundant, why...

Activity icon

Replied to Combine Js File And Have A Single File, Does It Exist?

I don't want to use webpack

Activity icon

Replied to Take Variable From Map Function

Frank's is simpler, assuming there will only ever be one result to the stock level query.

Activity icon

Replied to Take Variable From Map Function

If I'm reading this correctly, $closing_balance would be set on each item in the collection $check_balance. So yea, you certainly wouldn't be able to just directly access $closing_balance as a standalone variable outside of that map function.

Instead you'd need to do something like:

if (!empty(array_filter($check_balance, function ($item) use ($qty) {
  return $item->closing_balance >= $qty;
}))) {
  return redirect()->back()->withErrors(...)
}
Activity icon

Replied to How To Added The @Symbol Before Username Of Profile

can you rewrite the code with this new Ideas please

It's not my project... so untested, but something like this..

Profile route:

Route::get('profile/@{user}', 'Backend\[email protected]')->name('profile');

User model should include:

/**
 * Get the route key for the model.
 *
 * @return string
 */
public function getRouteKeyName()
{
    return 'slug';
}

UserController:

class UserController extends Controller
{
    public function UserProfile(User $user)
    {
        return view('profile', compact($user));
    }
}

Link to profile, see Snapey's response on your Stackoverflow

personally, I'd just leave off the @ .. seems wholly unnecessary. :)

Activity icon

Replied to How To Added The @Symbol Before Username Of Profile

protected $primaryKey = 'slug';

That's incorrect. you instead want implement the getRouteKeyName() method thusly to bind to something other than the id:

/**
 * Get the route key for the model.
 *
 * @return string
 */
public function getRouteKeyName()
{
    return 'slug';
}

slugs generally are, and should be, separate from primary keys.