Member Since 2 Years Ago
320 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
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.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
The way I've done it in the past from the controller is like this:
return view('users.edit', [ 'user' => $user, 'js' => [ 'assets/js/users-edit.js', 'assets/js/sortable.js', 'https://some-external-cdn/something.js' ] ]);
Then in my master
app.blade.php I'll output each item in the
Yes, stuff like
edit-users.js and perhaps additional libraries like
In the case of
edit-users.js that would only be used on the Edit Users view, but some libraries like
sortable.js might be used by multiple views, that require dynamic sort functionality.
I've approached this a few different ways, and I'm not sure which I like the most.
Let's say I have a particular controller and method, for example a
users controller and an
edit method along with an
The 2 main approaches I've used:
I'm leaning towards option 2 but can't decide what's best. What do you think?
Thanks for your advice, and sorry it has taken me a year to reply!
I sucessfully built this application, and created an API where the non-Laravel website can connect and insert orders into the Laravel app. Since it's imperative that no orders are ever lost, I also created a logging and notifcation system. If ever an order fails to be added due to a validation error, the error is logged and an email is sent to the administrator. After running it for 5 months there have been one or two failed orders due to bad data at the website end. So all in all, it has worked out really well.
Creating an API also means we could in theory move the app to a different server from the website, if we wanted to.
Thanks - one thing I notice is that the videos by Jeffrey for getting started with Vue cover Vue 2. I know there are videos for Vue 3 but it looks as though they assume you already have a reasonable understanding of Vue. Would it be wrong to start with Vue 2? I'd prefer not to have to learn everything twice.
Started a new Conversation JS Framework For Multi-page Laravel Application
I've built a few Laravel applications now which generally consist of both a front-end and back-end. Whilst they work beautifully they generally work the "old fashioned" way where each section of the app makes a request to the server, reloads the page and Laravel splits out a Blade view.
Occassionally I use a bit of jQuery to make some ajax calls if I want to update something on the page dynamically.
Lately I've been thinking about using Vue or React to make an application more dynamic. For example, add an item to a list without the page having to reload. However, all the examples and tutorials I find online seem to be exclusively related to building a Single Page Application (SPA). Perhaps I'm living in the dark ages, but this seems like an overkill for my needs.
I know it's a broad question, but I'm wondering how to get started using something like Vue or React but with a Laravel MPA rather than SPA.
I guess I envisage having my usual CRUD routes for a particular section of the app, but with some Vue components mixed in. I keep reading about routing in Vue and React, and I'm not sure that is at all relevant to what I'm trying to do.
Started a new Conversation Telescope Shows Query Escaped Incorrectly
Please observe the following query, equivelant to the user input being
Entity::selectRaw('MATCH (name, seo_title) AGAINST (?) AS relevance', ["Crotchet's"])->get();
Telescope shows the query as:
select MATCH (name, seo_title) AGAINST ('crotchet\'s') AS relevance from `entities` where `entities`.`deleted_at` is null
All good so far.
However, let's say the user input is entered as
Crotchet\'s and for reasons unknown to us, the user has placed a slash before their apostrophe:
Entity::selectRaw('MATCH (name, seo_title) AGAINST (?) AS relevance', ["Crotchet\'s"])->get();
The query runs fine so I belive it is escaped correctly. However, Telescope reports the query as:
select MATCH (name, seo_title) AGAINST ( 'crotchet\\' s ') AS relevance from `entities` where `entities`.`deleted_at` is null
Actually this is wrong, and if you copy and paste the above directly into the database engine of your choice, it will come back as a syntax error. The correct query should actually be:
select MATCH (name, seo_title) AGAINST ( 'crotchet\\\'s') AS relevance from `entities` where `entities`.`deleted_at` is null
Is this simply a bug with Telescope and the way the output is presented? Or something I'm overlooking?