francoboy7

francoboy7

Member Since 3 Years Ago

Experience Points 18,305
Experience
Level
Lessons Completed 193
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

29 Jul
4 months ago

francoboy7 started a new conversation Difference Between Two Apparently Similar Queries.

Hi everyone,

could someone tell me the difference between these 2 queries ? The first one did not work and the second one works flawlessly...

***Note : ***$lodging->favorites() reference a hasMany relation.

$lodging->favorites()->where('user_id', auth()->id())->get()->first()->delete();

$lodging->favorites()->get()->where('user_id', auth()->id())->first()->delete();

Thanks

22 Jul
4 months ago

francoboy7 started a new conversation ConEmu (Cmder) Quick Question

Hi guys

I'm using Cmder as my terminal and I was wondering how to set up an alias to run these two command in one.

*php artisan serve and npm run watch

I tried :

alias test=php artisan serve &t npm run watch

also

alias test=php artisan serve && npm run watch

However as php artisan serve keeps running when executed it never runs the other command.

I was thinking about using a "new tab" command to run php artisan serve then run npm watch in a new tab, but i'm kind of lost in all this. Any help is greatly appreciated.

Thanks a lot as always.

16 Jul
4 months ago

francoboy7 left a reply on Best Way To Load Data Efficiently

Hmm well for now it's mostly a personal project but in theory we would be looking at a couple thousands entries (5-6k) all in JSON looking like so

 "id": 1,
    "user_id": 2,
    "address": "40560 Allie Roads Suite 322\nNorth Rosalee, IL 66961-8593",
    "description": "Streamlined multi-tasking customerloyalty",
    "rent": 823,
    "size": 6,
    "slug": "40560-allie-roads-suite-322north-rosalee-il-66961-8593",
    "placeId": "879",
    "end_date": "2018-10-07 00:00:00",
    "apartment": 92,
    "floor": 0,
    "garden": 0,
    "hydro": 0,
    "heating": 0,
    "city": "Port Nestor",
    "country": "Greece",
    "lat": "9.949313",
    "lng": "-126.243675",
    "zip": "55218",
    "created_at": "2018-07-10 04:53:36",
    "updated_at": "2018-07-10 04:53:36",
    "user": {
      "id": 2,
      "name": "Prof. Jaunita Rolfson",
      "email": "[email protected]",
      "created_at": "2018-07-10 04:53:36",
      "updated_at": "2018-07-10 04:53:36"
    }

francoboy7 started a new conversation Best Way To Load Data Efficiently

Hi everyone !

So I'm playing around with vueJS and Laravel as a backend API and I had a quick question :

Let's say I have all my properties return by an API call ([email protected]) when visiting the "List all properties"

What would be the best way to filter through them ?

I would be tempted to load them all at once and then have methods to filter through the array depending on the user filters, however I can see the main array becoming huge the more properties they are with time.

OR

I could load the last 15 properties for the index and then make an API calls with custom filters as parameters and then display the result from that search.

08 Jul
5 months ago

francoboy7 left a reply on Trying To Implement Vuex, Mutations Not Updating State

Ok this is starting to look like a monologue, however I got it figured out :

Dev toold wasn't updating because it wasn't recording : https://forum.vuejs.org/t/vuex-state-not-update-unless-set-recording-in-vue-devtools/8374

https://vuex.vuejs.org/guide/mutations.html

also because my state wasn't bound to anything there was no need for Vue to trigger the Dev Tools and update the state

francoboy7 left a reply on Trying To Implement Vuex, Mutations Not Updating State

Edit : It appeared I was doing everything right, only problem is that Vue Dev Tool wasn't updating the Vuex state.

Still trying to figure why

francoboy7 started a new conversation Trying To Implement Vuex, Mutations Not Updating State

Hi everyone, I'm implementing Vuex and so far my initial state works fine.

However whenever I try to trigger a mutation and update a state, nothing happens. I mean I hit the mutation (console.log shows it) but it doesn't trigger the state update.

I thought about linking my whole github repo :P

https://github.com/francoisauclair911/cedetonbail/tree/feature-jwt

All views are under** ressources/assets/js/views**

Vuex is in store.js (called by app.js)

There is a simple TESTER button located in LoginComponent.vue that is suppose to increments a number (the most basic mutation I could find in vue documentation) and even that doesn't work..

I'm near a nervous breakdown here :P

Thanks a lot

07 Jul
5 months ago

francoboy7 left a reply on Use For Loop Inside Vue.js Method

Why not try a map method ?

contacts.map((contact) => {
   this.selectedContacts.push(contact.id);
});
10 Apr
8 months ago
01 Apr
8 months ago

francoboy7 started a new conversation Using Laravel For A Volunteer Database

Hi Everyone,

I'm the webmaster of a NGO and we use Wordpress for our websites and for volunteer registrations. We require uploads of various personal files such as passport copy and resumes.

Right now we are using a wordpress plugins to do all this, however, I sometimes feel like I don't have 100% control over how things are handled (what the plugin does, how it does it, is it safe etc.).

I was wondering what were your thoughts about using laravel to manage user registrations and document uploads.

If I were to follow Laravel best practices, would you feel confident uploading such information as a volunteer ?

Also if any developers would be interested in helping me build such a thing, just let me know (if It's against the forum rules I'll delete that request). For now the registrations would not be an issue, however I haven't touch file management so far so that would be a challenge.

The project would be : User registration + User Information filling (jobs, experiences etc) + user uploading certificates/passport/resume. Very basic, but a high need for it to be 100% secure.

As always, thanks for taking the time to read this

20 Mar
8 months ago

francoboy7 left a reply on Some Advices Needed For A Career Move

Thanks guys for all your inputs, it helps tremendously and keep them coming if anyone passes through.

@peterjonesio special thanks to you for the detailed reply

18 Mar
8 months ago

francoboy7 left a reply on Some Advices Needed For A Career Move

Thanks for the reply Shez

17 Mar
8 months ago

francoboy7 started a new conversation Some Advices Needed For A Career Move

Hi everyone

I wanted your advice on a personal subject concerning the programming world. I'm currently employed as a part-time paramedic (25 years old) and looking into a career change. I've been light coding php / html / css for a while and the occasional Wordpress contract here and there.

Here is what my perfect future would look like. Living abroad in another country, doing some freelance work as a programmer. Being able to move to another country every 6-12 months. Take weeks off here and there no boss. I'm not looking to work 40 hours / week. I aim at 25-30 hrs/week. However I don't mind pulling 50 hours/week if that means having 3 weeks off after !

My living expenses are pretty low, I normally make 20k-30K $CAD a year and I'm living fine with this.

Now I'm learning Laravel because I find it to be a beautiful framework and fun to work with. It has been a challenge but I love it. However, I wouldn't mind having to program in another language for freelance work and then programming my own personal projects with Laravel.

Now the questions :

  • Am I dreaming here?
  • Is it at all possible to achieve this plan?
  • Is learning PHP and Laravel the good way to go about doing freelance programming work ?
  • Could someone learn Laravel and then specialized in wordpress customization, building plugins with Laravel (I know it can be done)
  • Should I learn another language instead, one that is more "widely" hired in the freelance world.

Sorry for the heartfelt post, but the Laravel community has always been of kind and good advices.

Thanks for reading and sorry for the typos, french native speaker here

17 Feb
9 months ago

francoboy7 left a reply on A Bit Lost In All Of This...

Thanks a lot for your comment

My PHP Skills are Moderate I'd say ;) I did build simple projects.

If you'd like to recommend some series for PHP I'm listening ;) (I did the PHP Beginner course).

Do you guys have any recommendation for Javascript Learning ?

To be honest I'm using the Lynda Javascript Essential course but they aren't as "interactive and fun" as Jeffrey's video...

francoboy7 started a new conversation A Bit Lost In All Of This...

Hi there

First of all, I wanted to say that your content and Website is AMAZING ! I've learned so much from all this.

But,

I'm a beginner in all of this (laravel and also Vue) and I'm kind of lost in where to start.

I've followed the following

  • Laravel from Scratch serie
  • Learn Vue 2 serie

I am now looking at my next step. My knowledge in javascript is basic (variable, basic function etc.)

I'm tempted by the "Build a forum" serie, however it appears to be the step #15, of my learning laravel adventure, but when I take a look at the previous lesson, I feel like I'm in over my head with things like : socket. io and advanced eloquent technique

So here I am, contemplating all the lessons on laracasts and asking for advice. Maybe I'm overthinking this and I should jump on the forum serie, but let me know your take on this

Cheers

Let me know

08 Feb
10 months ago

francoboy7 left a reply on Which Series To Learn Vue.js ?

I searched the forum ( as I should have before posting)

People suggest starting with Vue 2 even if it says "intermediate"

Let me know what you think about my question #2 .

Thanks

francoboy7 started a new conversation Which Series To Learn Vue.js ?

Quick questions

I want to learn Vue.js and have some basic knowledge of javascript to start with.

  • 1- Should I follow the "Learn Vue 1 " first and then move to "Learn Vue 2" or start with "Learn Vue 2 " right away.

  • 2- Is a basic knowledge of javascript, loop, DOM, enough or should I master javascript totally before learning vue.

Thanks ;)

03 Feb
10 months ago

francoboy7 left a reply on Am I Refactoring The Right Way ?

So how does one would catch the error 403 if the user is not authorize ?

francoboy7 left a reply on Am I Refactoring The Right Way ?

Thanks everyone,

I'll dive into this today ?

02 Feb
10 months ago

francoboy7 started a new conversation Am I Refactoring The Right Way ?

Hey guys,

Just wanted to know if I'm doing my "refactoring" in a good way or I am under thinking this, or overthinking this.

What do you think of this, is it secure/safe ? Is there a way Laravel already check this logic and I'm just duplicating for nothing ?

Thanks a lot !

OLD CODE (in my [email protected])

public function destroy ($id)
{

        $quote = Quote::find($id);
        if ($quote->user_id == auth()->user()->id) 
        {

            $quote->delete();
            session()->flash('message-style', 'success');
            session()->flash('message', 'Citation supprimée !');

            return redirect ('/');
        }
        else {

            session()->flash('message-style', 'danger');
            session()->flash('message', 'Vous ne pouvez pas supprimer une citation qui ne vous appartient pas!');
            return redirect ('/');

        }
    }

NEW CODE (in [email protected])

public function destroy ($id)
{

        $quote = new Quote;

        if ($$quote->hisQuote($id))
        {
        
            return redirect ('/');

        } else {
        
            return redirect ('/');

        }
    }

QUOTE.PHP MODEL

public function hisQuote ($id)
{
    $quote = $this->find($id);
    // check if user_id of Quote matched Authenticated user id
    if ($quote->user_id === auth()->user()->id) 
    {
        $quote->delete();
        session()->flash('message-style', 'success');
        session()->flash('message', 'Citation supprimée !');
        return true;

    } 
    else 
    {
        session()->flash('message-style', 'danger');
        session()->flash('message', 'Vous ne pouvez pas supprimer une citation qui ne vous appartient pas!');
        return false;
    }

    
}
27 Jan
10 months ago

francoboy7 left a reply on Displaying User Name Of A Relationship

Ok beginner mistake, I did some migrate:refresh and did not recreate users so the table was empty...

Sorry for the dumb question

Cheers

francoboy7 left a reply on Displaying User Name Of A Relationship

Table User added

'{{ optional($track->user)->name }}

Is not working though....

francoboy7 started a new conversation Displaying User Name Of A Relationship

Book Model

class Book extends Model
{
    protected $primaryKey = 'book_id'; // or null

    public $incrementing = false;

    public function tracks ()
    {
        return $this->hasMany('App\Track', 'book_id', 'book_id');
    }
}

Track Model

class Track extends Model
{
   
        public function user ()
        {
            return $this->belongsTo(User::class);
        }


        public function book ()
        {
            return $this->hasOne('App\Book', 'book_id', 'book_id');
        }
}

Books Table enter image description here

Tracks Table enter image description here

Here lies my problem (one of them anyway) It doesn't display anything... I know it has something to do with array VS collection but I dont know what.

So each row in Track table belongs to a specific user

How would I go about displaying the user name which belongs to a track.

@foreach ($book->tracks as $key=>$track)

    {{ $track->country }} // this works
    
    {{ $track->user['name'] }} // this doesn't display anything
    
    {{$track->user-name }} // this throws "Trying to get property of non-object"
    
@endforeach

Thanks

22 Jan
10 months ago

francoboy7 started a new conversation Insert_php_constructor_property Not Working As Expected

Hi guys

My problem concerns the PHPCompanion sublime packages that Jeffrey talks about in his Sublime Series. More specifically the insert_php_constructor_property command.

It works well for the first class, but whenever I'm writing down another class further down the document and trigger the command (using escape) it jumps back to the top of the document and the first class and just adds another argument.

Any hints on how I could trigger it specifically for the class my cursor is on?

Thanks in advance

30 Sep
3 years ago

francoboy7 left a reply on Where Clause With Array

@mezuky Hey do you have any idea why my "id" results would always be of value = 1 ? Thanks


[
{
"id": 1,
"user_id": 1,
"start": "2015-09-25",
"end": "2015-09-26",
"start_time": "00:00",
"end_time": "00:00",
"shift_number": "G4545",
"sector": "est",
"active": 0,
"taken_by": 0,
"accepted_at": "0000-00-00 00:00:00",
"created_at": "2015-09-23 01:30:06",
"updated_at": "2015-09-29 13:43:11",
"date": "2015-09-25",
"preferences_sector": "est",
"preferences_jsn": "jour",
"first_name": "Francois",
"last_name": "Auclair",
"email": "francois.auclair.911@gmail.com",
"password": "$2y$10$ZpmnJUG0dKUhs7lYekJVge9ccMti6kJ09WMK8asSnYjx5B9YHGrx2",
"matricule": 6977,
"remember_token": null
},
{
"id": 1,
"user_id": 1,
"start": "2015-11-01",
"end": "2015-11-01",
"start_time": "00:00",
"end_time": "00:00",
"shift_number": "K8888",
"sector": "est",
"active": 0,
"taken_by": 0,
"accepted_at": "0000-00-00 00:00:00",
"created_at": "2015-09-23 01:30:06",
"updated_at": "2015-09-29 13:43:11",
"date": "2015-11-01",
"preferences_sector": "ouest",
"preferences_jsn": "soir",
"first_name": "Francois",
"last_name": "Auclair",
"email": "francois.auclair.911@gmail.com",
"password": "$2y$10$ZpmnJUG0dKUhs7lYekJVge9ccMti6kJ09WMK8asSnYjx5B9YHGrx2",
"matricule": 6977,
"remember_token": null
},
{
"id": 1,
"user_id": 1,
"start": "2015-11-02",
"end": "2015-11-02",
"start_time": "00:00",
"end_time": "00:00",
"shift_number": "P9999",
"sector": "est",
"active": 0,
"taken_by": 0,
"accepted_at": "0000-00-00 00:00:00",
"created_at": "2015-09-23 01:30:06",
"updated_at": "2015-09-29 13:43:11",
"date": "2015-11-02",
"preferences_sector": "ouest",
"preferences_jsn": "soir",
"first_name": "Francois",
"last_name": "Auclair",
"email": "francois.auclair.911@gmail.com",
"password": "$2y$10$ZpmnJUG0dKUhs7lYekJVge9ccMti6kJ09WMK8asSnYjx5B9YHGrx2",
"matricule": 6977,
"remember_token": null
}
]
18 Sep
3 years ago

francoboy7 left a reply on Where Clause With Array

@mezuky I owe you a drink ! Thanks

francoboy7 left a reply on Where Clause With Array

@mezuky thank you for your time. I want to get from DatesAvailable (dates_available table) all the records that have the same date as the dates from SwapDates (swap_dates table)
In simple words Get from DatesAvailable all the records (row) that have the same dates (date column) as the date column of SwapDates table

17 Sep
3 years ago

francoboy7 started a new conversation Where Clause With Array

    $user = Auth::user();
        $swaps = $user->getswapdates()->get();
    $availables = DatesAvailable::all();

$swaps Returns :

"id": 50,
"user_id": 1,
"start": "2003-06-16",
"end": "2014-11-24",
"start_time": "04:20",
"end_time": "04:20",
"shift_number": "G1234",
"sector": "Ex.",
"created_at": "2014-12-27 15:29:39",
"updated_at": "1991-02-08 01:42:05"

$availables returns :

"id": 1,
"user_id": 50,
"date": "2005-03-21",
"preferences_sector": "Est.",
"preferences_jsn": "Sit.",
"created_at": "1982-11-15 19:00:14",
"updated_at": "1978-04-23 13:30:24"

I'm looking for a way to check if in DatesAvailable I can find one or more entry that is in $swaps

I tryed playing with

                 ->whereIn

Without success Any help will be welcome Oh and I'm very new to all this

Thanks !

14 Sep
3 years ago

francoboy7 left a reply on Relationship Establishment

@phildawson Is there a link where I can find every Laravel conventions ? Like singular names vs plurals / way to name files, classes, controllers etc...

francoboy7 left a reply on Relation Shop Establishment

Thank you to everyone !

So It works now, but I wanted your input on the relation, do they seem alright ?

francoboy7 left a reply on Relation Shop Establishment

Updates...

Needed to fix my routes.php (->get()) ''' $swap = SwapDates::where('user_id', $user->id)->get(); '''

francoboy7 started a new conversation Relation Shop Establishment

Hey everyone, I'm new to Laravel so i'm hitting walls after walls, but hopefully I'll get through. So I want to set a relation within my model.

Basically a user submit available dates to work and dates he doesn't want to work So A User hasMany Dates Available (Model : DatesAvailable) A User hasMany DatestoSwap and now i'm getting confused. Date Available belongsTo a User (or hasMany / belongsToMany) Dates to Swap belongsTo a User (or hasMany / belongsToMany)

User.php

<?php
namespace Horaire;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
    use Authenticatable, CanResetPassword;

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'users';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['first_name','last_name', 'email', 'password', 'matricule'];

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = ['password', 'remember_token'];

    public function getswapdates()
    {

        return $this->hasMany('\Horaire\SwapDates');

    }

    public function getavailabledates()
    {

        return $this->hasMany('\Horaire\DatesAvailable');

    }

}

DatesAvailable.php '''

namespace Horaire;

use Illuminate\Database\Eloquent\Model;

class DatesAvailable extends Model { protected $fillable = array('user_id', 'date', 'preferences_sector', 'preferences_jsn');

public function user()
{

    return $this->belongsTo('User');

}

}

'''

SwapDates.php '''

namespace Horaire;

use Illuminate\Database\Eloquent\Model;

/**

  • Class SwapDates

  • @package Horaire */ class SwapDates extends Model { // protected $fillable = array('user_id', 'start', 'end', 'shift_number', 'sector');

    /**

    • @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function user() {

      return $this->belongsTo('User');

    }

} '''

Now I want to test this so in route.php

''' Route::get('{id}', function($id)

{ $user = User::find($id)->first();

$swap = SwapDates::where('user_id', $user->id);

echo  $swap;

}); '''

And it returns : ''' 1/1 ErrorException in routes.php line 69: Object of class Illuminate\Database\Eloquent\Builder could not be converted to string '''

Any ideas ?

27 Aug
3 years ago

francoboy7 left a reply on The Right Way To Use Migrations

I'd say edit it if it is already containing data or create a new one if the existing one is empty. I suggest http://laravel.com/docs/5.1/migrations for some more info. However i'm a Laravel beginner so take my advices with a grain of salt

francoboy7 left a reply on The Right Way To Use Migrations

I think it's easier for maintenance, for example if you need to rollback on of your table, having them all in the same file would force you to rollback every table in the file. Does that make sense ?

francoboy7 left a reply on Google Map Problem

@tronix Thanks, I was going crazy with all this ! By the way you can also just set the height to any pixels size on a DIV containing the map. Because targeting every "map-canvas" may be too generic for some project (different heights etc.)

Thanks again !

25 Aug
3 years ago

francoboy7 left a reply on Figuring Out Database Structure

@frezno Thank you for your time and help ! Now, time for some Laracast Series !

francoboy7 left a reply on Figuring Out Database Structure

Hi Fresno, thank you for your input, I should try that. Oh an quick question how do you normally proceed to create a new functionality for example, do you create the route first then the database then the controller? Is there a preferred order to proceed? Thank you!

24 Aug
3 years ago

francoboy7 left a reply on Figuring Out Database Structure

@frezno Thanks for your input,

What I don't get (newbie here) is how will I be able to put multiples "date_to_work" in one single row ?

Separate them with comma ? Because the user won't put ALL his schedule into the system, only shifts he doesn't want.

Alt text

If I do 1 table as you suggest I would have a typical row looking like this

id user_id start_date_to_get_rid end_date_to_get_rid shift_num sector start_date_i_can_work etc 1 43 2015/08/08 23:00:00 2015/08/09 07:00:00 2 N 2015/08/10,2015/08/11,2015/08/12

As you can see, the start_date_i_can_work, will need to contain multiple date no ? isn't that a problem to manage after ? (or i just explode() them ) Or I could create a row for each "start_date_i_can_work" but then I'd repeat myself over and over ? (is that better)

id user_id start_date_to_get_rid end_date_to_get_rid shift_num sector start_date_i_can_work etc 1 43 2015/08/08 23:00:00 2015/08/09 07:00:00 2 N 2015/08/10 2 43 2015/08/08 23:00:00 2015/08/09 07:00:00 2 N 2015/08/11 3 43 2015/08/08 23:00:00 2015/08/09 07:00:00 2 N 2015/08/12

Thanks for your help :D

francoboy7 left a reply on Figuring Out Database Structure

Hi @frezno, first thank you for taking the time to read me.
I like your idea and it inspired me to try something, what do you think of this database structure ?

Inline-style: ![alt text](http://i.imgur.com/BsBEp3o.png ")

francoboy7 left a reply on What GeoIP Service Provider Do You Use?

@Presto The demo page is giving me a good location (Montréal, Canada) not far from the US though so maybe that's why it's working

francoboy7 started a new conversation Figuring Out Database Structure

Hi everyone I am working on a website idea. It's for my company. It will allow the users to swap work shifts. For example : Marc (user ) doesn't want to work On the 26th of august from 11AM to 11PM.

He is free on the 27th of August and the 29th. Marc (user) is then looking for someone (let's say Adam(another user)) who would work for him on the 26th and give Marc one of his shift that he has on the 27th or 29th of august. it be accurate to say that shifts have a start and end datetime. Users enter certain shifts they don't want,and in order to reassign a shift between users, a transaction is made by 2 users each providing a shift they belong to where the user assignment is switched.

The schedules are always changing (ambulance crew) some full time, some part times. This service would be just to swap some specific date (always changing) For example I am booked on 26th and got a last minute appointement. So I'm basically looking for another coworker to take my shift. However I can't just "give" him my shift, I need to swap a shift with him. We get our schedule monthly but they change afterward

Multiple questions arise from this as I'm new to Laravel.

How should (could ?) I create my databases (especially the one concerning dates) Should I create a "Dates" table containing column like :"user_id", "date_to_swap","date_available_to_work" (and should I then separate the dates with a comma or period if the person has a lot of free days that he could swap) Will I need a pivot table (I'm pretty certain I will) Is there any "date" packages that can help me manage more easily (should it be front-end or back-end) As I said I'm really new to this, and I'm just starting to comprehend Laravel so this is basically to open my mind on some ways to realize my project (because developers all have their different ways.) And for clarification I'm using Laravel 5.1

I thought about something like this

user_id | date_to_swap

 1    |  12-07-2018  
 1    |  17-07-2018  
 2    |  13-07-2018
 3    |  12-07-2018  
 3    |  17-07-2018

But then I'll need another table for the date that he is able to work (for the swap) no ?

Thank you all for your help, I hope I'm clear enough...