Ap3twe

Ap3twe

Member Since 1 Year Ago

Canada

Experience Points
16,870
Total
Experience

3,130 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
111
Lessons
Completed
Best Reply Awards
2
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.

Level 4
16,870 XP
Apr
18
1 month ago
Activity icon

Replied to What Have You Been Doing Since Covid19 Lockup?

Who provides laravel certification?

Activity icon

Replied to What Have You Been Doing Since Covid19 Lockup?

That is impressive. I get to keep up. My kids are not giving me the space 😆

Mar
23
2 months ago
Activity icon

Replied to PHP Code Base To IOS

Mobile app

Activity icon

Replied to PHP Code Base To IOS

I have picked up Flutter Learning it slowly. Developing in web and mobile separately is expensive.

Activity icon

Replied to PHP Code Base To IOS

I know. I thought there was a compiler for it.

Activity icon

Started a new Conversation What Have You Been Doing Since Covid19 Lockup?

I have been at home tired of doing nothing. My mind is not working anymore. How about you? What is helping you to continue, any laravel projects you working on? Share your experience!

Activity icon

Replied to General Error: 1364 Field 'name' Doesn't Have A Default Value

Jeez for an unknown reason name was missing in the $fillable. Thank you

Activity icon

Replied to General Error: 1364 Field 'name' Doesn't Have A Default Value

I get all request

array:5 [▼
  "_token" => "gnnThQGv6IshKGb8TYLIv68u8r38Cy674EUdi7Al"
  "name" => "John Doe"
  "email" => "[email protected]"
  "password" => "JohnDoe"
  "password_confirmation" => "JohnDoe"
]
``
Activity icon

Replied to Best Way To Save An Array In A Db

Try this , You will need to implode or json_decode it to retrieve it from the database

//$prod= $request->input('prod');

$data = array();
foreach ($request[$prod] as $prod){
$data[] =$prod ;
        }
 $sup = new supplies();
 $sup->prod = ($data);
 $supllies->save()

Example of decode

$prod = $supplies->prod;
$explodeItems = json_decode($prod);

After just use foreach on it.

Activity icon

Started a new Conversation General Error: 1364 Field 'name' Doesn't Have A Default Value

I am using the default auth shipped with laravel. When I try to register a user, I get the error MySQL "General error: 1364 Field 'name' doesn't have a default value"

I run the query in workbench and it works. INSERT INTO users (id,name,password,email) values (1,'meteace', '****', 'f***@yahoo.com'); I have used this in a lot of projects just this is giving me problems. I hope someone catches the problem for me.

Users Migration table

  public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->BigIncrements('id');
            $table->string('name');
            $table->string('password');
            $table->string('email', 128)->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->rememberToken();
            $table->timestamps();
        });
    }

Registers Controller

  protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => ['required', 'string', 'max:255'],
            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
            'password' => ['required', 'string', 'min:8', 'confirmed'],
        ]);
    }
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);

    }

Blade View

<div class="form-group row">
<label for="name" class="col-md-4 col-form-label text-md-right">{{ __('name') }}</label>
    <div class="col-md-6">
       <input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" 
         value="{{ old('name') }}" required autocomplete="name" autofocus>

                      @error('name')
                            <span class="invalid-feedback" role="alert">
                                  <strong>{{ $message }}</strong>
                            </span>
                      @enderror
         </div>
    </div>
Mar
16
2 months ago
Activity icon

Replied to PHP Code Base To IOS

I created an app on react and was loving it until it got to Flux damn, my head was exploding. By the time I was done, I had grown 2 inches grey hair.

Activity icon

Replied to PHP Code Base To IOS

Do you mean .net core official website?

Activity icon

Started a new Conversation PHP Code Base To IOS

  1. Any suggestion on how to convert a PHP project to IOS app or is it better to learn react-native/flutter to create from scratch?

  2. Is there Vue equivalent of React Native?

  3. Is learning Swift comparable to PHP? Does it borrow some syntax Interoperability?

Mar
10
2 months ago
Activity icon

Replied to Mastering Full Stack

Thank you. Practicing makes man perfect

Activity icon

Replied to Mastering Full Stack

That is what am doing. Sometimes the problem I face is which should I focus first. Like most of my projects are laravel, Jquery, Vanilla Javascript, and bootsrap. I am trying to jump on declarative framwork such as Vue and alpinejs. I tried React and when it came to Redux, I was fucking lost.

Activity icon

Replied to Mastering Full Stack

I am talking about an intermediate developer. CSS, Html, Javascript is an afterthought. That's why I said Please *Take it into consideration of someone who already knows Laravel/CSS/HTML.

Activity icon

Started a new Conversation Mastering Full Stack

Guys what do you think of the learning curve and the possibility of becoming a master in these frameworks and libraries? How will you go about learning these such as the order? *Take it in consideration of someone who already knows Laravel.

Laravel 
Vue
Livewire
Alpine.js
Tailwind.css
Feb
18
3 months ago
Activity icon

Replied to Queue Job Failing

Event Class

class NewProjectCreated
{
    use Dispatchable, SerializesModels;

    public $project;
    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct($project)
    {
        $this->project = $project;
    }

}

Listener Class

class SendProjectCreatedToLabNotification
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  NewProjectCreated  $event
     * @return void
     */
    public function handle(NewProjectCreated $event)
    {

          $labtime = Carbon::now()->addMinutes(1);
        //   $labMail =  \Config::get('LAB_MAIL', 'default');
          $labMail =  \Config::get('credentials.labmail');

          Mail::to($labMail)->later($labtime , new ProjectCreatedLabNotificatication($event->project));

    }
}

Mail Class

class ProjectCreated extends Mailable
{
    use Queueable, SerializesModels;
      public $project;
    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($project)
    {
        $this->project = $project;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->markdown('mail.projectcreated');
    }
}

Markdown

@component('mail::message')
@php
$sixDigitId =  str_pad($project->id, 6, '0', STR_PAD_LEFT);
@endphp

Case: Smile Design <br>
Case has been created successfully for patient {{$project->first_name. ' ' .$project->last_name}}.
<br> Case number is {{$sixDigitId}}.
@component('mail::button', ['url' => url('/smiledesign/cases')])
View Project
@endcomponent

Thanks,<br>
{{ config('app.name') }}<br>

@endcomponent
Feb
07
3 months ago
Activity icon

Replied to Queue Job Failing

Any help?

Feb
04
3 months ago
Activity icon

Replied to Queue Job Failing

Exception Location


138     protected function checkConsecutiveDots()

139     {

140         if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) {

141             throw new ConsecutiveDot();

142         }

143     }

144 

145     /**

146      * @return bool

147      */

148     protected function isFWS()

149     {

150         if ($this->escaped()) {

151             return false;

152         }

153 

154         if ($this->lexer->token['type'] === EmailLexer::S_SP ||

155             $this->lexer->token['type'] === EmailLexer::S_HTAB ||

156             $this->lexer->token['type'] === EmailLexer::S_CR ||

157             $this->lexer->token['type'] === EmailLexer::S_LF ||

Exception Message

Trying to access array offset on value of type null

Stack Trace

/Users/DesignPro/laravel/ezsmile/vendor/egulias/email-validator/EmailValidator/Parser/Parser.php:147
/Users/DesignPro/laravel/ezsmile/vendor/egulias/email-validator/EmailValidator/Parser/Parser.php:127
/Users/DesignPro/laravel/ezsmile/vendor/egulias/email-validator/EmailValidator/Parser/LocalPart.php:57
/Users/DesignPro/laravel/ezsmile/vendor/egulias/email-validator/EmailValidator/EmailParser.php:48
/Users/DesignPro/laravel/ezsmile/vendor/egulias/email-validator/EmailValidator/Validation/RFCValidation.php:30
/Users/DesignPro/laravel/ezsmile/vendor/egulias/email-validator/EmailValidator/EmailValidator.php:37
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php:182
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php:128
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php:99
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php:75
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php:141
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php:115
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php:217
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php:53
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php:48
:
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php:330
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php:115
/Users/DesignPro/laravel/ezsmile/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php:41
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php:456
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php:237
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php:159
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php:19
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php:160
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php:52
:
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:90
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:34
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Container/Container.php:576
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php:94
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:128
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php:98
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php:49
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php:88
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:327
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:277
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:118
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:102
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:86
/Users/DesignPro/laravel/ezsmile/vendor/laravel/horizon/src/Console/WorkCommand.php:46
:
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:90
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:34
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Container/Container.php:576
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Console/Command.php:183
/Users/DesignPro/laravel/ezsmile/vendor/symfony/console/Command/Command.php:255
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Console/Command.php:170
/Users/DesignPro/laravel/ezsmile/vendor/symfony/console/Application.php:908
/Users/DesignPro/laravel/ezsmile/vendor/symfony/console/Application.php:269
/Users/DesignPro/laravel/ezsmile/vendor/symfony/console/Application.php:145
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Console/Application.php:90
/Users/DesignPro/laravel/ezsmile/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:133
/Users/DesignPro/laravel/ezsmile/artisan:37
Feb
03
3 months ago
Activity icon

Replied to Queue Job Failing

egulias package came bundled with laravel. I haven't even touched it.

Activity icon

Started a new Conversation Queue Job Failing

My jobs are failing after publishing telescopephp artisan telescope:publish

Looking in the failed table in DB, I get this lot of jargon. I cant paste all:

ErrorException: Trying to access array offset on value of type null in /Users/DesignPro/laravel/ezsmile/vendor/egulias/email-validator/EmailValidator/Parser/Parser.php:147 Stack trace:
Jan
31
4 months ago
Activity icon

Started a new Conversation Refactor Code And Add Amazon S3

How do I refactor this code and add amazon s3 compatibility?

  if ($request->hasFile('photo_image_front')){
            $ffilenameWithExt = $request->file('photo_image_front')->getClientOriginalName();

            $ffilename = pathinfo($ffilenameWithExt, PATHINFO_FILENAME);

            $fextension = $request->file('photo_image_front')->getClientOriginalExtension();

            $ffileNameToStore = $ffilename. '_' .time().'.' . $fextension;
            $fptopath = $request->file('photo_image_front')->storeAs('public/uploads/thumbnails', $ffileNameToStore);
             // Resize
             $fpto = public_path('storage/uploads/thumbnails'. $ffileNameToStore);
             $fptoimg = Image::make($_FILES['photo_image_front']['tmp_name']);
             $fptoimg->resize('443','313');
             $fptoimg->save($fpto);

        }
Jan
23
4 months ago
Activity icon

Awarded Best Reply on Trigger A Function When A Button Is Clicked.

I can achieve it with ajax

<a href="<?php echo $_SESSION['applicationlink']?>"><button class="trigger" style="padding: 10px;">Apply Now</button></a>
$( ".trigger" ).click(function() {
  $.post( "mail.php" );
});
Activity icon

Replied to Trigger A Function When A Button Is Clicked.

I can achieve it with ajax

<a href="<?php echo $_SESSION['applicationlink']?>"><button class="trigger" style="padding: 10px;">Apply Now</button></a>
$( ".trigger" ).click(function() {
  $.post( "mail.php" );
});
Activity icon

Replied to Trigger A Function When A Button Is Clicked.

You talking about a link. My concern wasn't that. I wanted to fire a mail function when the user has clicked the link to go to the next page. I think I can achieve that with Ajax. I thought it was possible with PHP. Thanks

Jan
22
4 months ago
Activity icon

Replied to Guests Not Redirected To Login After Defining Gates

Please Post your code here.

Activity icon

Replied to Trigger A Function When A Button Is Clicked.

  1. Why I store the external link to a session is because it is a generated link coming from API. The link is generated based on what the user did on the previous page. It does calculations and output the link.

  2. I am using raw PHP and HTML

Activity icon

Started a new Conversation Trigger A Function When A Button Is Clicked.

I have a button that will open an external page with link stored in the Session. I would like to listen to an event and trigger a PHP mail function. I want to make sure if the user clicked it before I send myself an email. I don't have control of the external page so I cant check it there.

<a href="<?php echo $_SESSION["applicationlink"]?>"><button class="btn-danger apply-button mt-3">Apply Now </button></a>

I created a mail function in mail.php and tried to put the $_SESSION['applicationlink'] in the header redirect so the button will have form tag but it does not work.

require 'vendor/autoload.php';
function Message(){
    $to_email = '*****';
    $subject = 'Lease Package Requested';
    $message = 'Someone has submitted a request for financing for a package through **** Leasing on your website!' ."\r\n";
    
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
    $headers = 'From: [email protected]' . "\r\n";
    $headers = 'Cc: ***@gmail.com' ."\r\n";
    mail($to_email,$subject,$message,$headers);
    header("Location:" .$_SESSION['applicationlink']); 

}

Message();

?>

NB: This is the last step of a User journey in the financing process. I can send email before the user lands on this page but that is logical, coz the user might abandon to click the apply button.

Activity icon

Awarded Best Reply on Remove Value When An Option Is Deselected

I fixed it with simple jquery on.change when I moved it outside the function

$('.image-picker').on('change', function() {
 $('#equipment').val($(this).find('option:selected').text());   
});

Activity icon

Replied to Remove Value When An Option Is Deselected

I fixed it with simple jquery on.change when I moved it outside the function

$('.image-picker').on('change', function() {
 $('#equipment').val($(this).find('option:selected').text());   
});

Jan
21
4 months ago
Activity icon

Started a new Conversation Remove Value When An Option Is Deselected

Trying to remove the values in the <input> when option gets deselected.

<input class="form-check-input" type="text" value="" id="equipment" name="equipmentitems" >

 <select multiple class="image-picker show-labels show-html" data-limit="16"  name="packages[]" id="group_psoft">
<option value=" " data-img-class="first" selected></option>
<option data-img-src="/images/" data-img-label="Scanner Tips(4Pcs)" name="packs" data-img-alt="KeepSame" value="400" >Medit-4-packs</option>
<option data-img-src="/images/" data-img-label="SwissGear Bag" name="bagoriginal" data-img-alt="Aggresive" value="200"> Swiss-Gear-Bag</option> 
</select>

Js

$('.image-picker').imagepicker({
   show_label: true,
   limit: 15,

//This is setting the text in the input
   selected: function($items) {
     $('#equipment').val($(this).find('option:selected').text());
   },

// Here I want to remove it if clicked again
   changed: function(){
      $('#equipment').val($(this).unbind('option:selected').text()); // This removes it but add all the other options text in the input

 $('#equipment').val($(this).unbind('option:selected').val( )); // Here It removes it but I get the value of the next selected option. 

     $('#equipment').val($(this).unbind('option:selected').text(' ' )); This I get Js [object,object]

   }

});


These are what I have tried so far. Thanks for help
Jan
16
4 months ago
Activity icon

Replied to How To Solve Error 500 Server Error On Laravel Live Site

Are you on cpanel or plesk?

Activity icon

Replied to How To Solve Error 500 Server Error On Laravel Live Site

Increase php memory limit in the php.ini. Your request size might be over the limit

Activity icon

Replied to Laravel Cannot Connect To Database On Shared Hosting

Test a fresh laravel project. Then post the error

Activity icon

Awarded Best Reply on Selet Option Value

Guys, I solved it with JS and PHP together. is true you cant target a unique option from a select tag. Using IDS did not work. Here is how I did it

<input class="form-check-input" value="1650" id="valuetobechanged" name="standardlaptop" >

Select box - I am using image picker(Nothing to do with the problem). It acts the same as select tag.

 <select multiple class="image-picker show-labels show-html" data-limit="3" name="extrapackage[]" id="group_psoft">                
            <option data-img-src="/images/-laptop.jpg" data-img-label="Touchscreen Laptop" name="DellXPS15Laptop" data-img-alt="Dell XPS-15 Laptop" value="2800"></option>             

              <option data-img-src="/images/i500comp.jpg" data-img-label="Dell XPS-15 Laptop" name="Dellxps" data-img-alt="dellxps" value="2500"></option>             

              <option data-img-src="/images/500-alienware.jpg" data-img-label="Alienware-17 Laptop" name="dellalienware" data-img-alt="Dell Alienware-17 Laptop" value="5000"></option>            
              
            </select>

Javascript

<script>
$('#group_psoft').on('change', function() {
    $('#valuetobechanged').val( $(this).val() );
    
});
</script>

PHP

   if (isset($_REQUEST['standardlaptop'])){
            $upgrades = $_REQUEST['standardlaptop'];
            $upgrades = str_replace(',', ' ', $upgrades);
            $upgradesToArray = explode( " " ,$upgrades);
            $upgradesSum = array_sum($upgradesToArray);
        }

        if (empty($upgradesSum)){

            $standardpackageOrg = 1650;     
        }

In the end, I get back my initial value in the input text(1650) if the user selects and unselects the option. Maybe I can use Javascript to get back the old value but now am good with this.

Activity icon

Replied to Selet Option Value

Guys, I solved it with JS and PHP together. is true you cant target a unique option from a select tag. Using IDS did not work. Here is how I did it

<input class="form-check-input" value="1650" id="valuetobechanged" name="standardlaptop" >

Select box - I am using image picker(Nothing to do with the problem). It acts the same as select tag.

 <select multiple class="image-picker show-labels show-html" data-limit="3" name="extrapackage[]" id="group_psoft">                
            <option data-img-src="/images/-laptop.jpg" data-img-label="Touchscreen Laptop" name="DellXPS15Laptop" data-img-alt="Dell XPS-15 Laptop" value="2800"></option>             

              <option data-img-src="/images/i500comp.jpg" data-img-label="Dell XPS-15 Laptop" name="Dellxps" data-img-alt="dellxps" value="2500"></option>             

              <option data-img-src="/images/500-alienware.jpg" data-img-label="Alienware-17 Laptop" name="dellalienware" data-img-alt="Dell Alienware-17 Laptop" value="5000"></option>            
              
            </select>

Javascript

<script>
$('#group_psoft').on('change', function() {
    $('#valuetobechanged').val( $(this).val() );
    
});
</script>

PHP

   if (isset($_REQUEST['standardlaptop'])){
            $upgrades = $_REQUEST['standardlaptop'];
            $upgrades = str_replace(',', ' ', $upgrades);
            $upgradesToArray = explode( " " ,$upgrades);
            $upgradesSum = array_sum($upgradesToArray);
        }

        if (empty($upgradesSum)){

            $standardpackageOrg = 1650;     
        }

In the end, I get back my initial value in the input text(1650) if the user selects and unselects the option. Maybe I can use Javascript to get back the old value but now am good with this.

Jan
10
4 months ago
Activity icon

Replied to This Site Can’t Be Reached

Restart the server and see if it responds

Activity icon

Replied to Selet Option Value

This all works as my initial question. Maybe there is no way to restrict it to the Box option. Car, Toyota I dont want them to affect the handler.

You targeted all the select ``$('#group_psoft'). What I want is to target$('#group_psoft[Box]').

Activity icon

Replied to Selet Option Value

Thank you but what I am looking for is to only target the "value" of Box, not all the other options. The code I posted works for the later.

Activity icon

Replied to Selet Option Value

Sorry, What I want is only the BOX value. I don't want the rest to change the "value of the input "

Activity icon

Started a new Conversation Selet Option Value

I want to get the specific value of Select[option] Box and pass it to the value of an input text. I want to change only the input value with the Box value, not the rest. I don't want car and Toyota. I edited my question to make it clear.

Here is the code

<select name="group_psoft" id="group_psoft" multiple>
<option value="0" selected="selected"title="0">---select---</option>
<option value="100" title="100">Box</option>
<option value="200" title="200">Car</option>
<option value="300" title="300">Toyota</option>
</select>
<input id="name" value="200">
<script>
$('#group_psoft').change(function() {$('#name').val('')}); 
</script>

I tried this but is not working

<select name="group_psoft" id="group_psoft" multiple>
<option value="0" selected="selected"title="0">---select---</option>
<option value="100" title="100">Box</option>
<option value="200" title="200">Car</option>
<option value="300" title="300">Toyota</option>
</select>
<input id="name" value="200">
<script>
$('#group_psoft option[value=100]').change(function() {$('#name').val('100')}); 
</script>
Jan
08
4 months ago
Activity icon

Awarded Best Reply on Laravel 504 Time-out After I Updated Valet

Got it working after some diggings. I will list the steps here that may help someone.

First I uninstall PHP7.4 then install with source build

brew uninstall [email protected] --force, brew install php --build-from-source

I then uninstall Valet. I uninstall MySQl 5.8 to 5.7 stable version for laravel

# Remove MySQL completely

1. Open the Terminal
2. Use `mysqldump` to backup your databases
3. Check for MySQL processes with: `ps -ax | grep mysql`
4. Stop and kill any MySQL processes
5. Analyze MySQL on HomeBrew: 
        
    ```
    brew remove mysql
    brew cleanup
    ```

6. Remove files: 

    ```
    sudo rm /usr/local/mysql
    sudo rm -rf /usr/local/var/mysql
    sudo rm -rf /usr/local/mysql*
    sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    sudo rm -rf /Library/StartupItems/MySQLCOM
    sudo rm -rf /Library/PreferencePanes/My*
    ```

7. Unload previous MySQL Auto-Login: 
        
    ```
    launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    ```
        
8. Remove previous MySQL Configuration: 

    ```
    subl /etc/hostconfig` 
    # Remove the line MYSQLCOM=-YES-
    ```
        
9. Remove previous MySQL Preferences: 
    
    ```
    rm -rf ~/Library/PreferencePanes/My*
    sudo rm -rf /Library/Receipts/mysql*
    sudo rm -rf /Library/Receipts/MySQL*
    sudo rm -rf /private/var/db/receipts/*mysql*
    ```
    
10. Restart your computer just to ensure any MySQL processes are killed
11. Try to run mysql, **it shouldn't work**

Then I did a fresh Valet installation Note* Install MySQl 5.7 and brew link [email protected], brew services start [email protected]

start valet and boohah! there you go. remember Mysql resets to root and empty password

Activity icon

Replied to Laravel 504 Time-out After I Updated Valet

Got it working after some diggings. I will list the steps here that may help someone.

First I uninstall PHP7.4 then install with source build

brew uninstall [email protected] --force, brew install php --build-from-source

I then uninstall Valet. I uninstall MySQl 5.8 to 5.7 stable version for laravel

# Remove MySQL completely

1. Open the Terminal
2. Use `mysqldump` to backup your databases
3. Check for MySQL processes with: `ps -ax | grep mysql`
4. Stop and kill any MySQL processes
5. Analyze MySQL on HomeBrew: 
        
    ```
    brew remove mysql
    brew cleanup
    ```

6. Remove files: 

    ```
    sudo rm /usr/local/mysql
    sudo rm -rf /usr/local/var/mysql
    sudo rm -rf /usr/local/mysql*
    sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    sudo rm -rf /Library/StartupItems/MySQLCOM
    sudo rm -rf /Library/PreferencePanes/My*
    ```

7. Unload previous MySQL Auto-Login: 
        
    ```
    launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    ```
        
8. Remove previous MySQL Configuration: 

    ```
    subl /etc/hostconfig` 
    # Remove the line MYSQLCOM=-YES-
    ```
        
9. Remove previous MySQL Preferences: 
    
    ```
    rm -rf ~/Library/PreferencePanes/My*
    sudo rm -rf /Library/Receipts/mysql*
    sudo rm -rf /Library/Receipts/MySQL*
    sudo rm -rf /private/var/db/receipts/*mysql*
    ```
    
10. Restart your computer just to ensure any MySQL processes are killed
11. Try to run mysql, **it shouldn't work**

Then I did a fresh Valet installation Note* Install MySQl 5.7 and brew link [email protected], brew services start [email protected]

start valet and boohah! there you go. remember Mysql resets to root and empty password

Activity icon

Replied to Laravel 504 Time-out After I Updated Valet

I did everything but it is still slow. I think is the valet version. I need to change the computer I guess so. my spec is Mac Pro (Late 2013)

      Processor 3.7 GHz Quad-Core Intel Xeon E5
      Memory 32 GB 1866 MHz DDR3 
      Graphics AMD FirePro D500 3072 MB