Member Since 1 Year Ago
4,310 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.
Awarded Best Reply on Laravel Mix Does Not Pull In CSS
@vincej Okay I think have a solution: In your resources/sass/app.scss file (make sure it's .scss and not .sass), put this:
@import "../css/default";
Your webpack.mix.js will looks like:
mix.js(['resources/js/app.js', 'resources/js/functions.js'], 'public/js')
.sass("resources/sass/app.scss", "public/css/");
This will combine both into a single css file, and then you bring in your main layout file
<link href="{{ asset('/css/app.css') }}" type="text/css" rel="stylesheet">
OR
Upgrade to laravel-mix version 6 and update your webpack.mix.js file to :
mix.js(["resources/js/app.js", "resources/js/functions.js"], "public/js/app.js").vue()
.sass("resources/sass/app.scss", "public/css")
.css("resources/css/default.css", "public/css");
If you upgrade to laravel-mix 6, you might need to get rid of --hide-modules in your npm script "npm run development" and "npm run production"
Replied to Laravel Mix Does Not Pull In CSS
@vincej Okay I think have a solution: In your resources/sass/app.scss file (make sure it's .scss and not .sass), put this:
@import "../css/default";
Your webpack.mix.js will looks like:
mix.js(['resources/js/app.js', 'resources/js/functions.js'], 'public/js')
.sass("resources/sass/app.scss", "public/css/");
This will combine both into a single css file, and then you bring in your main layout file
<link href="{{ asset('/css/app.css') }}" type="text/css" rel="stylesheet">
OR
Upgrade to laravel-mix version 6 and update your webpack.mix.js file to :
mix.js(["resources/js/app.js", "resources/js/functions.js"], "public/js/app.js").vue()
.sass("resources/sass/app.scss", "public/css")
.css("resources/css/default.css", "public/css");
If you upgrade to laravel-mix 6, you might need to get rid of --hide-modules in your npm script "npm run development" and "npm run production"
Replied to Laravel Mix Does Not Pull In CSS
Can you show your package.json as well as the structure of your resources directory?
Replied to Laravel Mix Does Not Pull In CSS
What happens if you add a trailing /
to 'public/css'
?
Like this:
mix.js(['resources/js/app.js', 'resources/js/functions.js'], 'public/js')
.css('resources/css/default.css','public/css/');
.sass('resources/sass/app.sass','public/css/');
Notice the change, 'public/css/'
from 'public/css'
.
Anything?
Replied to Vue Gives Error On Page Unrelated To Template
type="checkbox"
class="custom-control-input"
:id="child.child_id"
v-model="child.status"
@change="updateChild(child)" >
I don't remember about Vue, but at least in React you have to close single tag elements such as input. So <input>
would have to be <input/>
.
Is your file a .vue file? Most likely can't have another script tag other than the script to define the component, etc. Also, is jQuery really necessary for what you're doing?
Replied to Computed Value Not Returning Correctly
Your method currentMonthPrice(material)
isn't returning anything, just the returning in the callback function (forEach).
But on a side note, why mix var and let??
Replied to Module Not Found: Error: Can't Resolve
You can try updating your laravel-mix to version 6. And then changing your webpack.mix.js file to
mix.js("resources/js/app.js", "public/js")
.vue()
.sass("resources/sass/app.scss", "public/css");
(default mix file that comes with laravel/ui) I just did a fresh install now and seems to be working.
Replied to Module Not Found: Error: Can't Resolve
require('./...').default
You're missing the .default
Replied to Materialize On Laravel 5.5.50, Php 7.4.14. Outdated?
There should also be a javascript file if you want to be able to use the interactivity. Is that in the project at all?
Replied to Sum Of Subelements Of Array
Look into Array.prototype.reduce()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
Awarded Best Reply on Eloquent Question
If you want your pivot to contain additional information add ->withPivot('user_name')
where you defined your relationships.
https://laravel.com/docs/8.x/eloquent-relationships#retrieving-intermediate-table-columns
Replied to Update In Laravel VueJs
@rod2rick
In your put call (axios), switch your config and request data.
axios.put('/url', { ...your_data }, config);
Replied to Update In Laravel VueJs
@rod2rick
What happens when you replace $produit->update();
with $produit->save();
?
I believe the [model]->update()
method is for mass assignment updates, e.g., $produit->update(['name' => 'new name']);
.
Replied to Eloquent Question
If you want your pivot to contain additional information add ->withPivot('user_name')
where you defined your relationships.
https://laravel.com/docs/8.x/eloquent-relationships#retrieving-intermediate-table-columns
Replied to Laravel Doesn't Load Tailwind Styles
Try right-clicking on the browser's refresh button and select empty cache and reload.
Replied to When To Use $request->all()?
^ https://www.youtube.com/watch?v=QQS5oEOguRU
This will help explain.
Awarded Best Reply on Composer Global Require Enlightn/security-checker - Laravel/installer V3.1.0 Requires Php ^7.2.9 -> Your Php Version (8.0.2) Does Not Satisfy That Requirement.
Why not try to update laravel/installer?
Why not try to update laravel/installer?
Replied to Update In Laravel VueJs
Pass an Id parameter to this.getProduit() in your mounted(). I don't think you produit in props either. Are you able to get the expected data?
Replied to Vue 3, Data Emit Error
Also, no need for a ternary in your toggleMenu() method. You can just do this.isMobile = !this.isMobile
Awarded Best Reply on Vue 3, Data Emit Error
You have a typo in your parent component. Should be methods: { ... }
but you have method: { ... }
Replied to Vue 3, Data Emit Error
You have a typo in your parent component. Should be methods: { ... }
but you have method: { ... }
Replied to Laraval/React Mix Example Doesn't Display A Page For Me As Illustrated On The Tutorial.
What's the error?
Replied to Laraval/React Mix Example Doesn't Display A Page For Me As Illustrated On The Tutorial.
Well thats a Laravel 5 tutorial and you're on Laravel 8. So some things are going to be different. Your routes should now be (Laravel 8)
use ...
Route::get('products', [ProductsController::class, 'index']);
Route::get('products/{product}', [ProductsController::class, 'show']);
etc...
And make sure to import the Product Controller.
use App\Http\Controllers\ProductsController;
Replied to Laraval/React Mix Example Doesn't Display A Page For Me As Illustrated On The Tutorial.
You're using laravel 8, models now live in the Models directory.
So on top of your file where you have use App\Product;
change that to use App\Models\Product;
Could you also show your routes file (routes/api.php)?
Replied to Count Same Data And Show One Javascript
Sorry turn the HTMLCollection into an array first.
const divs = document.getElementsByClassName("test");
const mySet = new Set();
[...divs].forEach(div => mySet.add(div.getAttribute('data-content')));
Replied to Laraval/React Mix Example Doesn't Display A Page For Me As Illustrated On The Tutorial.
Looks like something wrong with your Laravel code. Can you post the controller method for /api/products?
Replied to Count Same Data And Show One Javascript
A set will do that for you. A set will only have unique values.
let mySet = new Set()
divs.forEach(div => mySet.add(div.getAttribute('data-content')));
Replied to Count Same Data And Show One Javascript
Maybe look into Sets. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
Replied to Laraval/React Mix Example Doesn't Display A Page For Me As Illustrated On The Tutorial.
Its a browser extension created by the react theme. If you're using chrome etc search for react dev tools and install it then open the dev console and click on the Components tab.
Replied to Laraval/React Mix Example Doesn't Display A Page For Me As Illustrated On The Tutorial.
Any errors in the console? Also check react dev tools, are the products loaded in your state ?
Replied to Update Value Vue.js Without Page Refresh
He or she is using axios. Make sure to set this.data = response.data.
Replied to Laraval/React Mix Example Doesn't Display A Page For Me As Illustrated On The Tutorial.
Did you get rid of this by mistake?
if (document.getElementById('root')) {
ReactDOM.render(<Main />, document.getElementById('root'));
}
Awarded Best Reply on Unable To Access User Property On Vue Component
Your user property is an array. Either take the first index [0] in your frontend or fix how you're sending the data from your controller. Probably need to change a ->get() to a ->first() when querying the data.
Replied to Unable To Access User Property On Vue Component
Your user property is an array. Either take the first index [0] in your frontend or fix how you're sending the data from your controller. Probably need to change a ->get() to a ->first() when querying the data.
Awarded Best Reply on Laravel Ajax Eloquent Relationship Can't Get Value
Your movies property is an array. Loop over it or take the first index, value.movies[0].title
Replied to Laravel Ajax Eloquent Relationship Can't Get Value
Your movies property is an array. Loop over it or take the first index, value.movies[0].title
Replied to SafeAreaView Top Not Showing Background Color In React-native
Try using the StatusBar component.
import { StatusBar } from "react-native";
...
return (
<SafeAreaView>
<StatusBar backgroundColor="blue" />
</SafeAreaView>
)
Replied to Token Not Defined In AsyncData
Show your entire script portion for the component. Why is asyncData() not inside the methods object?
Awarded Best Reply on Getting Error: [Vue Warn]: Error In Render: "TypeError: Cannot Read Property 'form' Of Undefined"
This part :
<input class="rounded" v-model="this.form.breakfast" :value="dayNum" :id="mealID('breakfast', dayNum)" type="checkbox">
<input class="rounded" v-model="this.form.lunch" :value="dayNum" :id="mealID('lunch', dayNum)" type="checkbox">
<input class="rounded" v-model="this.form.dinner" :value="dayNum" :id="mealID('dinner', dayNum)" type="checkbox">
<input class="rounded" v-model="this.form.dessert" :value="dayNum" :id="mealID('dessert', dayNum)" type="checkbox">
<input class="rounded" v-model="this.form.snack" :value="dayNum" :id="mealID('snack', dayNum)" type="checkbox">
Your v-models should just be v-model="form.your_property", but you have "this.form.your_property"
Replied to Getting Error: [Vue Warn]: Error In Render: "TypeError: Cannot Read Property 'form' Of Undefined"
This part :
<input class="rounded" v-model="this.form.breakfast" :value="dayNum" :id="mealID('breakfast', dayNum)" type="checkbox">
<input class="rounded" v-model="this.form.lunch" :value="dayNum" :id="mealID('lunch', dayNum)" type="checkbox">
<input class="rounded" v-model="this.form.dinner" :value="dayNum" :id="mealID('dinner', dayNum)" type="checkbox">
<input class="rounded" v-model="this.form.dessert" :value="dayNum" :id="mealID('dessert', dayNum)" type="checkbox">
<input class="rounded" v-model="this.form.snack" :value="dayNum" :id="mealID('snack', dayNum)" type="checkbox">
Your v-models should just be v-model="form.your_property", but you have "this.form.your_property"
Replied to Undefined Variable Problem
value ="{{ $AboutMes->about_mes_middle_name }}">
Your problem is in the value field of your Last Name input. You have $AboutMes but you pass in $aboutmes.
Awarded Best Reply on What Uses --save-dev And What Is Dependency
In Laravel you can install everything as a devDependency.