app/Providers/SparkServiceProvider.php
/**
     * Finish configuring Spark for the application.
     *
     * @return void
     */
Finish configuring Spark for the application.
@return void
Finish configuring Spark for the application . @return void
public function booted()
    {
        Spark::useStripe()->noCardUpFront();
        Spark::freeTeamPlan()
            ->maxTeamMembers(20);
        Spark::noAdditionalTeams();
        Spark::identifyTeamsByPath();
        Spark::useRoles([
            'manager' => 'Manager',
            'adviser' => 'Adviser',
        ]);
        Spark::validateUsersWith(function () {
            return [
                'name' => 'required|max:255',
                'email' => 'required|email|max:255|unique:users',
                'password' => 'required|confirmed|min:6',
                'phone' => 'required|regex:/0\d{9}/',
                'billing_address' => 'required',
                'billing_city' => 'required',
                'billing_state' => 'required',
                'billing_zip' => 'required|regex:/\d{4}[a-zA-Z]{2}/',
                'billing_country' => 'required|alpha_dash',
                'dossier_id' => 'regex:/\d{8}/',
                'vat_id' => 'regex:/\d{9}B\d{2}/',
                'birthdate' => 'required|date_format:j-n-Y'
            ];
        });     
        Spark::createUsersWith(function ($request) {
            $user = Spark::user();
            $data = $request->all();
            $birthdate = explode('-', $data['birthdate']);
            $user->forceFill([
                'name' => $data['name'],
                'email' => $data['email'],
                'password' => bcrypt($data['password']),
                'phone' => $data['phone'],
                'billing_address' => $data['billing_address'],
                'billing_city' => $data['billing_city'],
                'billing_state' => $data['billing_state'],
                'billing_zip' => $data['billing_zip'],
                'billing_country' => $data['billing_country'],
                'birthdate' => Carbon::createFromDate($birthdate[2], $birthdate[1], $birthdate[0], 'Europe/Amsterdam')->toDateTimeString(),                
                'last_read_announcements_at' => Carbon::now('Europe/Amsterdam'),
                'trial_ends_at' => Carbon::now('Europe/Amsterdam')->addDays(Spark::trialDays()),
            ])->save();
            return $user;
        });        
    }
public function booted ( ) { Spark :: useStripe ( ) -> noCardUpFront ( ) ; Spark :: freeTeamPlan ( ) -> maxTeamMembers ( 20 ) ; Spark :: noAdditionalTeams ( ) ; Spark :: identifyTeamsByPath ( ) ; Spark :: useRoles ( [ 'manager' => 'Manager' , 'adviser' => 'Adviser' , ] ) ; Spark :: validateUsersWith ( function ( ) { return [ 'name' => 'required|max:255' , 'email' => 'required|email|max:255|unique:users' , 'password' => 'required|confirmed|min:6' , 'phone' => 'required|regex:/0\d{9}/' , 'billing_address' => 'required' , 'billing_city' => 'required' , 'billing_state' => 'required' , 'billing_zip' => 'required|regex:/\d{4}[a-zA-Z]{2}/' , 'billing_country' => 'required|alpha_dash' , 'dossier_id' => 'regex:/\d{8}/' , 'vat_id' => 'regex:/\d{9}B\d{2}/' , 'birthdate' => 'required|date_format:j-n-Y' ] ; } ) ; Spark :: createUsersWith ( function ( $ request ) { $ user = Spark :: user ( ) ; $ data = $ request -> all ( ) ; $ birthdate = explode ( '-' , $ data [ 'birthdate' ] ) ; $ user -> forceFill ( [ 'name' => $ data [ 'name' ] , 'email' => $ data [ 'email' ] , 'password' => bcrypt ( $ data [ 'password' ] ) , 'phone' => $ data [ 'phone' ] , 'billing_address' => $ data [ 'billing_address' ] , 'billing_city' => $ data [ 'billing_city' ] , 'billing_state' => $ data [ 'billing_state' ] , 'billing_zip' => $ data [ 'billing_zip' ] , 'billing_country' => $ data [ 'billing_country' ] , 'birthdate' => Carbon :: createFromDate ( $ birthdate [ 2 ] , $ birthdate [ 1 ] , $ birthdate [ 0 ] , 'Europe/Amsterdam' ) -> toDateTimeString ( ) , 'last_read_announcements_at' => Carbon :: now ( 'Europe/Amsterdam' ) , 'trial_ends_at' => Carbon :: now ( 'Europe/Amsterdam' ) -> addDays ( Spark :: trialDays ( ) ) , ] ) -> save ( ) ; return $ user ; } ) ; }
Finish configuring Spark for the application.
Finish configuring Spark for the application .