vincent15000

Member Since 11 Months Ago

Experience Points
13,250
Total
Experience

1,750 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
14
Lessons
Completed
Best Reply Awards
3
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.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 3
13,250 XP
May
08
16 hours ago
Activity icon

Started a new Conversation Multiple Array Checkbox With Vuejs Not Working ...

Hello,

I have two tables : a trainings table and a subjects table.

The relationship between both tables is many-to-many, so belongsToMany().

To attach the courses to a training, I use checkboxes.

<tr v-for="subject in subjects" :key="'subject-'+subject.id">
    <td class="is-vcentered">
        <field>
            <input type="checkbox"
                v-model="selectedSubjects['subject_id']"
                :value="subject.id" />
                {{ subject.name }}
            <input type="number"
                v-model="selectedSubjects['hours_number']"
                :value="subject.hours_number" />
                {{ subject.hours_number }}
        </field>
    </td>
</tr>

There is a pivot table with training_id, subject_id and hours_number.

When I check one box, all the boxes check together. Why ?

Thanks for your help.

Vincent

May
07
1 day ago
Activity icon

Replied to Is It Possible To Use JQuery In A Livewire Component To Hide An Element Out Of The Livewire Component ?

Thank you @tray2 I have already had a look at the console, I have no error.

Activity icon

Started a new Conversation Is It Possible To Use JQuery In A Livewire Component To Hide An Element Out Of The Livewire Component ?

Hello,

I have a Livewire component to manage a search form with many criteria.

If the article is not in the database, I propose to access to another form which is not in the Livewire component. This second form is simply hidden with class="hidden".

What I'd like to do is for example use jQuery to show my hidden div.

alert("test1");
$("#mybutton").click(function() {
	alert("test2");
	$("#myhiddendiv").show(250);
});

jQuery is loaded in my layout and the test1 alert is displayed, but not the test2 alert.

Does Livewire deactivate jQuery ? Another reason ? Do you have any idea ?

Thanks for your help.

V

Activity icon

Replied to Problem With Axios To Get A List From A Model

The problem was a conflict with my routes. Argggg ... so much time to search a problem with vue and it was a Laravel problem.

May
06
2 days ago
Activity icon

Replied to Controller / Model With PHPSpreadSheet

Thank you it works now ;).

Activity icon

Started a new Conversation Controller / Model With PHPSpreadSheet

Hello,

I have a controller to generate a customized Excel spreadsheet.

But the method is very big (set titles, customize the cells, ...).

And I have to generate in the same sheet three same tables with different datas.

So to use three times the same code, I want to dispatch the code in methods.

  • I have tried to add other methods in the controller and access to them using $this-> but Laravel generates an error saying that it's not a model context.

  • I wanted to create a model (not extended from Laravel Model) which extends PHPSpreadSheet class to be able to use the PHPSpreadSheet methods and my methods, I have tried, but Laravel generates an error saying that the spreadsheet methods are undefined.

How is it possible to extend a model from another external model in Laravel to be able to reuse the external model methods ?

Well ... any idea is welcome ;).

Thanks a lot.

V

Activity icon

Started a new Conversation Modal Windows With Vue / Buefy

Hello,

I'm using vue and buefy.

I have 2 components : a table component and a modal component.

The table displays the list of items and the modal is to add / update a new item.

The table view.

    <div class="box">

    	<training-form :training-id="trainingId"></training-form>

		<table>
			...
				<tr>
					<td><b-button @click="edit(training.id)"></b-button>
				</tr>
			...
		</table>

	</div>

The modal view.

    <section>

        <b-button
            label="Créer une nouvelle formation"
            type="is-primary"
            @click="isComponentModalActive = true">
        </b-button>

        <b-modal
        	v-model="isComponentModalActive"
        	:can-cancel="false">
			...
		</b-modal>

	</section>

When I click on the button to create a new training, the modal window opens.

How is it possible to click on my button in the table to open the modal window ? How to tell to the child component to open the modal window and send it a property (training id) ?

I just discover vuejs so I don't know a lot with vuejs.

Thanks for your help.

Vincent

May
05
3 days ago
Activity icon

Started a new Conversation VueJS And Laravel Blade @can Helper

Hello,

Is it possible to use @can with VueJS like with Blade ?

I have looked around but I don't have found anything.

Perhaps it exists something equivalent ?

Thanks for your answer.

Vincent

May
03
5 days ago
Activity icon

Replied to Size Of A Select Dropdown With Livewire

Oh thank you ... I haven't explained well ... I meant the size ... the number of visible rows when I drop down the select to see the options ... well the number of visible options when dropped down.

Activity icon

Replied to Problem With Axios To Get A List From A Model

It seems not to be the solution, already proposed above ;).

Activity icon

Started a new Conversation Size Of A Select Dropdown With Livewire

Hello,

How is it possible to force the size of a select dropdown with Livewire ?

It's perhaps not a Livewire problem, but an HTML problem.

I have tried with the size attribute, but then the size is always fixed even when the dropdown is not open.

Do you have any idea how to solve this ?

Thanks ;).

V

Activity icon

Replied to Problem With Axios To Get A List From A Model

It's a vue component in a blade file.

Activity icon

Replied to Problem With Axios To Get A List From A Model

I now understand what is the problem but I don't know how to solve it.

When I call res.data, Vue loads the previous res.data from the other component on the same page.

It sounds like res is not updated after the new request with the second component.

Do you have any idea how to solve this ?

Activity icon

Replied to How To Filter All And Specific Fields Using Laravel Eloquent?

Hello I don't have any answer for you because I never used the filters, but it's very interesting. If you have the solution, I'm interested ;).

Activity icon

Replied to Disregard Thread

Hello,

I do it very easily with Livewire. You should try it.

Activity icon

Replied to Problem With Axios To Get A List From A Model

Hello,

Nothing changes. Here are my logs.

[Vue warn]: Error in render: "TypeError: Cannot read property 'id' of null"

found in

---> <UsersTable> at resources/js/components/users/UsersTable.vue
       <ProfileComponent> at resources/js/components/users/ProfileComponent.vue
         <Root>
warn @ app.js:65246
logError @ app.js:66509
globalHandleError @ app.js:66504
handleError @ app.js:66464
Vue._render @ app.js:68170
updateComponent @ app.js:68686
get @ app.js:69099
run @ app.js:69174
flushSchedulerQueue @ app.js:68930
(anonymous) @ app.js:66605
flushCallbacks @ app.js:66531
Promise.then (async)
timerFunc @ app.js:66558
nextTick @ app.js:66615
queueWatcher @ app.js:69022
update @ app.js:69164
notify @ app.js:65357
reactiveSetter @ app.js:65682
proxySetter @ app.js:69251
(anonymous) @ app.js:2196
Promise.then (async)
loadUsers @ app.js:2195
mounted @ app.js:2171
invokeWithErrorHandling @ app.js:66479
callHook @ app.js:68839
insert @ app.js:67762
invokeInsertHook @ app.js:70964
patch @ app.js:71183
Vue._update @ app.js:68565
updateComponent @ app.js:68686
get @ app.js:69099
Watcher @ app.js:69088
mountComponent @ app.js:68693
Vue.$mount @ app.js:73670
Vue.$mount @ app.js:76579
Vue._init @ app.js:69634
Vue @ app.js:69701
./resources/js/app.js @ app.js:2247
__webpack_require__ @ app.js:76623
(anonymous) @ app.js:76785
__webpack_require__.O @ app.js:76660
(anonymous) @ app.js:76788
(anonymous) @ app.js:76790
app.js:66513 TypeError: Cannot read property 'id' of null
    at app.js:59665
    at Proxy.renderList (app.js:67274)
    at Proxy.render (app.js:59664)
    at VueComponent.Vue._render (app.js:68168)
    at VueComponent.updateComponent (app.js:68686)
    at Watcher.get (app.js:69099)
    at Watcher.run (app.js:69174)
    at flushSchedulerQueue (app.js:68930)
    at Array.<anonymous> (app.js:66605)
    at flushCallbacks (app.js:66531)
Activity icon

Replied to Problem With Axios To Get A List From A Model

Oh something new ... it seems the method in my controller is not executed.

	public function list()
    {
		dd('test');
        $users = User::orderBy('name')->get();
        return response()->json(
			'users' => $users
		);
    }

With dd(), I have the same result.

Here are my routes, if it can help.


Route::middleware(['auth', 'verified'])->prefix('admin')->name('admin.')->group(function() {

    Route::get('profile', ProfileController::class)->name('profile');

	Route::get('dashboard', DashboardController::class)->name('dashboard');

	Route::get('suggestions', [SuggestionController::class, 'index'])->name('suggestions.index');
    Route::get('suggestions/list', [SuggestionController::class, 'list']);
    Route::post('suggestions/add', [SuggestionController::class, 'add']);
    Route::delete('suggestions/{id}', [SuggestionController::class, 'delete']);

    Route::get('mysociety/{id}', [SocietyController::class, 'get']);
    Route::post('mysociety/add', [SocietyController::class, 'add']);
    Route::put('mysociety/{id}/update', [SocietyController::class, 'update']);
    
    Route::get('mysociety/users', [UserController::class, 'list']);

});

Activity icon

Replied to Vue And Bulma / Buefy

I now know that the problem comes from buefy.css. But this file is necessary for some Buefy features. I didn't find any solution yet.

Activity icon

Replied to Namespace Error With Nginx And Apache

The solution is that the framework is using exclusively Apache and generates .htacceess file necessary to work.

Activity icon

Replied to Problem With Axios To Get A List From A Model

My first idea is as Vue was trying to use the methods of the other component ... perhaps ... of to reuse the previous loaded datas ... as if the code access to the same memory with another variable ...

Activity icon

Replied to Problem With Axios To Get A List From A Model

Hello @maverickchan I have tried your proposition, but it doesn't work. With response()->json() I have no display even with the other requests whiwh worked fine. It seems that I have to use toArray(). I have removed this. before axios and it doesn't change anything to my result.

Another idea ?

May
02
6 days ago
Activity icon

Started a new Conversation Problem With Axios To Get A List From A Model

Hello,

I'm trying for hours to find the problem and I don't have found any solution.

I have a component ProfileComponent.vue which displays to other componants : UsersTable and SocietyForm.

The society form displays correctly and the users table component generates an error.

Here is a part of my code.

    public function list()
    {
        $users = User::orderBy('name')->get()->toArray();
        return $users;
    }

Here is the template and script.

<template>
    <div class="columns">
        <div class="column is-6">
        	<society-form :society-id="societyId"></society-form>
        </div>
        <div class="column is-6">
                <users-table></users-table>
        </div>
    </div>
</template>

<script>

    export default {
        name: 'profile-component',
        props: [
            'societyId'
        ],
    }
    
</script>

And the script for the users table component.

<script>
    export default {
        name: 'users-table',
        props: [
        ],
        mounted() {
            this.loadUsers()
        },
        data() {
			return {
                users: []
            }
        },
        methods: {
            loadUsers() {
                this.axios
                    .get('/admin/mysociety/users')
                    .then(res => {
                        this.users = res.data
                    })
            }
        }
    }
</script>

Here is the error : "TypeError: Cannot read property 'id' of null"

It's clear that axios doesn't return what I want. When I do alert(this.users), it's empty.

Do you see anything wrong in my code which could generate an error ?

Thanks a lot for your help ... several hours without any solution ... aie aie aie my hairs ;).

Vincent

May
01
1 week ago
Activity icon

Started a new Conversation Vue And Bulma / Buefy

Hello,

I have installed Vue and I want to use the Bulma CSS framework in a Laravel app.

I discover Buefy which is a convenient way to use Bulma with Vue.

I have installed Buefy and immediately the primary bulma color changed from turquoise to purple.

But I want to use turquoise as primary color.

I have tested several solutions to customize the colors, to force to use bulma turquoise primary color and no buefy's one, impossible to find a solution.

Do you any idea ?

Thanks a lot.

Vincent

Apr
29
1 week ago
Activity icon

Replied to Namespace Error With Nginx And Apache

The same source code works fine with no problem on another computer.

Somebody told me that it could be a problem with the configuration of nginx. But I don't know how to solve this. I had a look at the way how to configure nginx to be case insensitive, but I don't have found how to do that.

Activity icon

Started a new Conversation Namespace Error With Nginx And Apache

Hello,

Do you already have experienced a namespace error with nginx or apache ?

I specify that the problem is not with Laravel, it's a private PHP framework. If you don't want to answer to my post, no problem ;).

FastCGI sent in stderr ... while reading response header from upstream.

It works fine on another computer (other developer). Perhaps I need some extra PHP package or nginx package ?

I have compared several forum to find out what's wrong, but I don't have found any solution.

Do you have any idea ?

Thanks for your answer.

Vincent

Apr
27
1 week ago
Activity icon

Replied to Complex Unique Rule In The Request Form ?

Could you please tell me what's better between $id = $this->budget ? $this->budget->id : null; then using $id and $this->route('budget')->id ? I think it's equivalent isn't it ?

Activity icon

Replied to Complex Unique Rule In The Request Form ?

Ok thank you it works, I didn't understand that I had to add ->ignore() after the ->where().

Activity icon

Replied to Complex Unique Rule In The Request Form ?

With the resource.

Route::resource('budgets', BudgetController::class);
Activity icon

Replied to Complex Unique Rule In The Request Form ?

I use the good id value to update the budget.

Here is my update route : http://localhost:8000/budgets/2055/edit.

What has to be unique is the couple (client_id, year). There can be only one annual budget per client, but there are several budgets with the same year, each one with a different client.

Activity icon

Replied to Complex Unique Rule In The Request Form ?

Thank you.

Once again I get the same error.

Rule::unique('budgets')->ignore($this->budget->id),
Activity icon

Replied to Complex Unique Rule In The Request Form ?

Thank you @michaloravec and @martinbean? i had just tried it but it doesn't work.

Rule::unique('budgets')->ignore($this->budget->year),

I get the same error.

Activity icon

Started a new Conversation Complex Unique Rule In The Request Form ?

Hello,

I have to add annual budgets to clients.

return [
    'year' => [
        'required',
        'integer',
        Rule::unique('budgets')
            ->where('year', $this->year)
            ->where('client_id', $this->client_id)
    ],
    'amount' => 'numeric|nullable',
];

But when I have to edit the budget, it tells me that there's already a budget for this year.

How can I solve this ?

Thanks a lot ;).

V

Activity icon

Replied to How To Set A Cookie Prefix In Laravel ?

No solution for the moment ... I will try what @fylzero proposes.

Activity icon

Replied to How To Set A Cookie Prefix In Laravel ?

Thank you @fylzero I'll try this tomorrow and I tell you if it works. ;)

Apr
26
1 week ago
Activity icon

Replied to How To Force User Logout Via Middleware ?

Oh yes ... sometimes we don't look at the right place and then we don't see the real reason of the bug.

Activity icon

Replied to How To Force User Logout Via Middleware ?

Oh no ... sorry that's ok ... problem with my browser cache. It's ok ... I just need to add use ...\Auth;.

Activity icon

Started a new Conversation How To Force User Logout Via Middleware ?

Hello,

I'm trying to logout a user via a middleware when this user is not member.

Here is the content of the handle method of the middleware.

if (!$request->user()->isActif()) {
    Auth::logout();
    return redirect()->route('login');
}
return $next($request);

But I get an error : effectively the logout route is only with post and not get method.

Is it possible to force logout with post method ?

Thanks.

Vincent

Apr
23
2 weeks ago
Activity icon

Replied to How To Combine Two Tables?

I had not tested the code, I thought this could be a problem to sort the collection. But I think merging is the right way.

I suggest you to use sortBy directly in blade.

@foreach ($new_and_posts->sortBy('created_at') as $item
	...
@endforeach

Tell me if it helps ;).

Activity icon

Replied to How To Set A Cookie Prefix In Laravel ?

Thank you for your answer.

I had a problem with the cookie prefix and secure cookie.

That's what I noticed, I have already set SESSION_SECURE_COOKIE to true, then when I check the headers it displays that there's a problem with the cookie prefix (but no problem with the secure cookie any more.

https://securityheaders.com/

Activity icon

Started a new Conversation Problem With Webpack : [webpack-cli] Error: Cannot Find Module 'webpackbar'

Hello,

I have just installed jquery with npm.

I don't know if I had this error before jquery installation or not.

[webpack-cli] Error: Cannot find module 'webpackbar'

I have tried to update npm but I have this error each time I run npm run ....

Do you have any idea ?

Thanks.

Vincent

Apr
22
2 weeks ago
Activity icon

Replied to Show Indication That A Series Has Been Completed Within Series Cards

Perhaps you can give us more details.

What I understand about your problem : you can add a completed boolean field in your table and set it to true when it is completed.

Activity icon

Replied to Anyone Here Used OctoberCMS As Starting Point For Custom Projects?

I don't know this CMS. But you could find any help on the OctoberCMS forum.

https://octobercms.com/forum

Activity icon

Replied to Sending Notifications By Email

Yes it is possible.

You have to create a command and then use this command via a cron task.

https://laravel.com/docs/8.x/artisan#generating-commands

Tell me if it helps ;).

Activity icon

Replied to How To Combine Two Tables?

Hello,

What I understand is that you have some news and posts ordered by creation date for example.

I you want to display a list with the news and the posts mixed ordered by creation date.

$news = New::all();
$posts = Post::all();
$news_and_posts = $news->merge($posts);

And then you can order the collection by creation date.

$news_and_posts->sortBy('created_at');

Tell me if it helps.

V

Activity icon

Replied to Laravel Charts With Parameter

What is the parameter ? I don't see it !

Activity icon

Awarded Best Reply on Route Error In Production But Not In Development

Well ... I have deleted the closure and replaced it with a controller with __invoke and ... I forgot to create the key in .env. Sorry ... ;).