pc579

Member Since 1 Month Ago

Experience Points
370
Total
Experience

4,630 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
0
Lessons
Completed
Best Reply Awards
0
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 1
370 XP
Mar
11
1 month ago
Activity icon

Replied to Share Function Between Projects?

Thanks your very much @jlrdw & @martinbean

Your answers make understand better some concepts. Today my solution, I don't say it's the best, is to

  • create a common controller

  • share this controller between project with composer

  • write the files in each app (public directory and db)

To close the subject I choose @jlrdw last answer as Best answer because it's he last and most explained one, but as written before there is not only one best solution, it depends of the needs, ...

Mar
09
1 month ago
Activity icon

Replied to Share Function Between Projects?

Thanks @jlrdw for your reply, but my question is not link to share the same db.

Activity icon

Replied to Share Function Between Projects?

By sharing code using Composer, it would be a package by its very nature.

Ok, that makes be better understand 'package', but i already knew that I can use composer for that. Can you please reread my initial questions relative to Laravel. Thank you very much for your time.

Mar
08
1 month ago
Activity icon

Replied to Share Function Between Projects?

@jlrdw

But even a package would have to be installed in each project, that takes away from the sharing it with three different projects.

Right, probably the misunderstanding, in my mind, a package is share code.

Seems it would be the same as having an upload method or function in each project.

Not exactly, I understand a package comes with version management, ...

Seems that each separate project would have its own sessions, thus how are you going to handle your csrf token in the post request.

Don't know for now, but thought it might have a solution, how will it be managed if we use the solution of making a package?

Just an opinion, but I'd say keep things simple and just write the function where needed.

I agree , doing simple is in fact it's my original question, maybe you are right, but I still want to have something common if this does not make this too more complex, maybe I have to do a (long) journey to arrive to your solution, or maybe I'll choose another solution ... there is not only one truth.

Activity icon

Replied to Share Function Between Projects?

Hi @martinbean

I tend to agree with you for C++, there is maybe a misunderstanding with @jlrdw

I know that I can share code with package, but never did it before and thought it can exist simpler solution, like put a private share share class in composer.json?

Activity icon

Replied to Share Function Between Projects?

Thanks @jlrdw for reply.

An upload function is only a few lines of code.

Right, but i think it's better for such 'small'* functions to share common code that to duplicate and I'am looking to have it simpler than C++/C or package. *upload is a first case, but I think to other less simple.

How is it shared as far as authentication,

I don't have thought to this point right now, maybe with some 'hidden token' in the calling form?

Activity icon

Started a new Conversation Share Function Between Projects?

Hi All,

I want to write a 'standard' upload function in order to share it between different projects.

I have 3 questions regarding the best/standard way to do this in Laravel.

  1. Where I should write such a function?

  2. How to call it from the form action?

  3. Do I need a share store or is-it a way to save the files in the public directory of each project?

Thanks in advance for any advices.

Feb
25
1 month ago
Activity icon

Replied to Laravel / Breeze / Inertia - Display Vue.version

Hi @_i.raj3sh

Thanks a lot for your answer, like you I learn vue/inertia for the beginning of this week and clearly I have read nothing right now about these vie inner variables.

One thing I should add to your text, is that we have to be aware of the difference of synxtax between vue2 & vue3, many example on the net are for vue2 but it is not written, simply because vue3 does not exist at this time.

Last and not least when we post a msg we should write vue3 (or vue2), it was obvious for me that my post was for vue3 but clearly not for @marianomoreyra

Activity icon

Replied to Laravel / Breeze / Inertia - Display Vue.version

Hi @marianomoreyra

it seems you are using Vue 3 maybe?

Vue3 comes in standard with installation of Breeze + Iinertia

Thanks you very much, your code works with these 2 modifications :

in app.js

import * as Vue from 'vue';

In Welcome.vue

{{$root.vueVersion}}

A last question, I don't understand $root, is it a js synatx? an inertia one? Can you point me on any doc about this?

Feb
24
1 month ago
Activity icon

Replied to Laravel / Breeze / Inertia - Display Vue.version

@jlrdw

I succeeded to get rid of the previous error adding the line : import * as Vue from 'vue'; //

Then I created : var vueVersion=Vue version : ${Vue.version};

But don't succeed to print this variable in Welcome.vue, I try {{ vueVersion }} that does show nothing ...

And I don't understand your code ... and ${...}

Activity icon

Replied to Laravel / Breeze / Inertia - Display Vue.version

@jlrdw @marianomoreyra

My app.js

require('./bootstrap');

// Import modules...
import { createApp, h } from 'vue';
import { App as InertiaApp, plugin as InertiaPlugin } from '@inertiajs/inertia-vue3';
import { InertiaProgress } from '@inertiajs/progress';

const el = document.getElementById('app');

createApp({
    render: () =>
        h(InertiaApp, {
            initialPage: JSON.parse(el.dataset.page),
            resolveComponent: (name) => require(`./Pages/${name}`).default,
        }),
})
    .mixin({ methods: { route } })
    .use(InertiaPlugin)
    .mount(el);

InertiaProgress.init({ color: '#4B5563' });

// alert('Hello');

import Vue from 'vue'; 

//alert(`Vue version : ${Vue.version}`);

new Vue({
    data: function()
    {
        return { 
            vueVersion: Vue.version 
        }
    },
})
Activity icon

Replied to Laravel / Breeze / Inertia - Display Vue.version

Thanks @marianomoreyra

I got the run time error : Uncaught TypeError: vue__WEBPACK_IMPORTED_MODULE_0__.default is not a constructor

Same remark as before, may it's obvious but I never work with Vue before.

Activity icon

Replied to Laravel / Breeze / Inertia - Display Vue.version

Thanks @jlrdw

When I add : import Vue from 'vue'; alert(Vue version : ${Vue.version}); in app.js

I got the compilation error : export 'default' (imported as 'Vue') was not found in 'vue' (possible exports: ...

Sorry if it's obvious but I never work with Vue before.

Activity icon

Started a new Conversation Laravel / Breeze / Inertia - Display Vue.version

Hello All,

I recently installed Laravel / Breeze / Inertia and as a first try I decided to show Vue version on the Welcome page (like Laravel et Php versions)

I didn't succeed, neither I found st valuable on the net (I never work with Vue.js before)

I would appreciate any advice or solution.

Thanks in advance.

Feb
19
1 month ago
Activity icon

Replied to Pb With Except

I saw this example in the doc, but I need @snapey explanation "You have a collection of objects. None of those objects is called 'id'" to understand.

Activity icon

Replied to Pb With Except

Thanks @jlrdw , your answer arrived when I wrote mine.

Activity icon

Replied to Pb With Except

Ok, got it.

Sorry @corvs I re-read your answer, you already wrote this, but I need more explanation to understand.

Thanks you both.

Activity icon

Replied to Pb With Except

I suspected st like this but I don't understand the doc :

From eloquent#collections

As we have seen, Eloquent methods like all and get retrieve multiple records from the database. However, these methods don't return a plain PHP array. Instead, an instance of Illuminate\Database\Eloquent\Collection is returned.

It's written AN instance

Activity icon

Replied to Pb With Except

I just enter this cmd in tinker

User::all()->except(['id'])

Activity icon

Started a new Conversation Pb With Except

Hi All,

New to Laravel, I don't understand how except works.

I understand it works on collection and I understand that User::all() is a collection

But User::all()->except(['id']) does not remove id !

What I do wrong? not understand?