souleye

souleye

Member Since 3 Years Ago

Experience Points 1,050
Experience Level 1

3,950 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 69
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

07 Oct
3 years ago

souleye left a reply on How Do I Make Xampp See My Laravel Installation?

thank you @frezno for your feedback. I wasn't aware how to point apache to an installation but it was done automatically since the laravel installation was under htdocs. I'm on a mac so the path is ~/Applications/XAMPP/xamppfiles/htdocs/. I checked the httpd.conf file to confirm it. this is what I have for document root an directory: DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs" <Directory "/Applications/XAMPP/xamppfiles/htdocs"> but still apache is not pointing to the laravel installation. something must be wrong but never mind. at least I learned something for in case. now I'm experiencing another issue with the mysql database not starting. I had a previous issue with apache not starting but I had it resolved. bumpy road! lol

05 Oct
3 years ago

souleye started a new conversation How Do I Make Xampp See My Laravel Installation?

I had xampp and laravel installed on my laptop. but the developer just did a screen grab and did everything for me. needless to say I learned very little. I then proceeded to install xampp on another computer, migrated the laravel installation but when I log on to localhost, all I see is 'dashboard'. how do I make localhost point to the laravel installation instead? thanks for assistance. souleye

30 Sep
3 years ago

souleye left a reply on How Do I Change The Path Of New Laravel Install?

I managed to install laravel successfully with composer global require "laravel/installer=~1.1" but I had to reinstall composer in 2 steps: install then move. it asked me if I wanted to overwrite I don't know what and I pressed yes. I guess this aeas causing the problem. please see below:

override rwxr-xr-x  root/wheel for /usr/local/bin/composer? (y/n [n]) y
mv: rename composer.phar to /usr/local/bin/composer: Permission denied
admins-Mac-Pro-2:~ admin$ sudo mv composer.phar /usr/local/bin/composer
Password:
admins-Mac-Pro-2:~ admin$ ls ~/.composer/
cacert.pem
admins-Mac-Pro-2:~ admin$ composer global require "laravel/installer=~1.1"
Changed current directory to /Users/admin/.composer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing symfony/process (v2.7.5)
    Downloading: 100%         

  - Installing symfony/console (v2.7.5)
    Downloading: 100%         

  - Installing react/promise (v2.2.1)
    Downloading: 100%         

  - Installing guzzlehttp/streams (3.0.0)
    Downloading: 100%         

  - Installing guzzlehttp/ringphp (1.1.0)
    Downloading: 100%         

  - Installing guzzlehttp/guzzle (5.3.0)
    Downloading: 100%         

  - Installing laravel/installer (v1.2.1)
    Downloading: 100%         

symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing psr/log (For using the console logger)
Writing lock file
Generating autoload files
admins-Mac-Pro-2:~ admin$ ```




and the laravel command worked!!!




```admins-Mac-Pro-2:~ admin$ laravel
Laravel Installer version 1.2.1

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help  Displays help for a command
  list  Lists commands
  new   Create a new Laravel application.
admins-Mac-Pro-2:~ admin$ ```




thanks a million!!! without your patience and dedication, I'm not sure I would've made it. thanks.

souleye left a reply on How Do I Change The Path Of New Laravel Install?

installing composer globally

Composer successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer```
now trying to install laravel with the command
```admins-Mac-Pro-2:~ admin$ composer global require "laravel/installer=~1.1"``` 



I get




```Changed current directory to /Users/admin/.composer                                                                           
  [ErrorException]                                                             
  file_put_contents(./composer.json): failed to open stream: Permission denied                                                                            
                                                                               
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [packages1] ... [packagesN]


admins-Mac-Pro-2:~ admin$ ls ~/.composer/
cacert.pem
admins-Mac-Pro-2:~ admin$ ```

souleye left a reply on How Do I Change The Path Of New Laravel Install?

thanks. I safely removed composer with rm -rf ~/.composer/ now, I'm gonna start from scratch and document all the steps. if I make an error, that will leave an audit trail. will keep you posted. hope you have an enjoyable day.

souleye left a reply on How Do I Change The Path Of New Laravel Install?

never mind. I found the command to force remove a directory $ rm -rf directoryname

souleye left a reply on How Do I Change The Path Of New Laravel Install?

thank you so much again @Snapey. I tried to follow your instructions but this is what I got: admins-Mac-Pro-2:~ admin$ cd ~/laravel/ admins-Mac-Pro-2:laravel admin$ ~/.composer/vendor/laravel/install new project1-bash: /Users/admin/.composer/vendor/laravel/install: No such file or directory admins-Mac-Pro-2:laravel admin$ ls ~/.composer/vendor/bin/laravel/app composer.lock package.json readme.md tests artisan config phpspec.yml resources vendor bootstrap database phpunit.xml server.php composer.json gulpfile.js public storage admins-Mac-Pro-2:laravel admin$ when I click on 'go to… folder' and I enter '/.composer, it shows that directory in the finder (I'm on a mac). navigating that folder I have this path to the installer /composer/vendor/laravel/installer/laravel (app). then if I navigate to the bin folder, I have this path /.composer/vendor/bin/laravel… then I have 'app, artisan, etc… at this point I think it may be more productive to scratch off everything and start from scratch. actually that's what I set out to do yesterday then I realized you couldn't rm folders - I got the message 'they were not empty'. is there an expeditious way of removing folders in command line without having to empty them? this laravel installation is for learning purposes only. so removing it is not a big deal. just wanna know if there's a safe way of doing it. on a mac, I could just grab the folder and move them to the trash. I may have permissions requirements or something...

29 Sep
3 years ago

souleye started a new conversation Using Intervention Image To Resize In Laravel 4

I installed intervention/image on a project that I inherited from other developers. actually, it was installed but I had to reinstall it. project was developed in laravel 4.

as per the instructions from the intervention documentation: open your Laravel config file config/app.php and add the following lines. In the $providers array add the service providers for this package.  `'Intervention\Image\ImageServiceProvider Add the facade of this package to the $aliases array. `'Image' => 'Intervention\Image\Facades\Image Now the Image Class will be auto-loaded by Laravel. these two steps have been properly done. in the section below, I inserted the code into routes.php. now what? when I went to my form to upload an image, apparently intervention is not working. I changed the image sizes to see if the changes would be reflected but no.

Route::get('/', function()
{
    $img = Image::make('foo.jpg')->resize(300, 200);
    return $img->response('jpg');

});```
any assistance will be appreciated. thank you.

souleye left a reply on How Do I Change The Path Of New Laravel Install?

when I first installed the framework successfully it was installed right under /admin. I had to do a search to find it. that's when bestmomo suggested I use a specific path. I then required the path ~/.composer/vendor/bin/. I just ran the command ls -l ~/.composer/vendor/laravel and this is what I got admins-Mac-Pro-2:~ admin$ ls -l ~/.composer/vendor/laravel total 0 drwxr-xr-x 8 admin staff 272 Sep 24 16:10 installer admins-Mac-Pro-2:~ admin$

souleye left a reply on How Do I Change The Path Of New Laravel Install?

this is what I get when I use the cd to go to the laravel directory: admins-Mac-Pro-2:~ admin$ cd ~/.composer/vendor/bin/laravel/ admins-Mac-Pro-2:laravel admin$ ls app composer.lock package.json readme.md tests artisan config phpspec.yml resources vendor bootstrap database phpunit.xml server.php composer.json gulpfile.js public storage admins-Mac-Pro-2:laravel admin$ on my .bash_profile, I got this export path: export PATH="/Users/admin/.composer/vendor/bin:$PATH" export PATH=$PATH:/usr/local/git/bin/ export PATH=~/bin:/usr/local/php5/bin:$PATH all I've been doing is follow the instructions of people like you, who are more knowledgeable than I am. though I have used command line before, if you had asked me last week what bash_profile was, I would've answered 'I have no clue!'

souleye left a reply on How Do I Change The Path Of New Laravel Install?

@Snapey first off, thank you for your patience and assistance. you can blame it on my poor english but when I watched the laracast video, jeffrey did say 'there are 3 ways of installing laravel'. so I understand 'either, or, or'. when I go to the laravel installation page it says.

  1. download the laravel installer composer global require "laravel/installer=~1.1"
  2. place the ~/.composer/vendor/bin directory in your PATH
  3. once installed, the simple laravel new command will create a fresh Laravel installation in the directory you specify. if you were a beginner, wouldn't you think that's all there's to it? when I run composer about then laravel this is what I get admins-Mac-Pro-2:~ admin$ composer about Composer - Package Management for PHP Composer is a dependency manager tracking local dependencies of your projects and libraries. See https://getcomposer.org/ for more information. admins-Mac-Pro-2:~ admin$ laravel -bash: laravel: command not found admins-Mac-Pro-2:~ admin$ when I run the command composer global require "laravel/installer=~1.1" now, it gives me this: admins-Mac-Pro-2:~ admin$ composer global require "laravel/installer=~1.1" Changed current directory to /Users/admin/.composer ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Writing lock file Generating autoload files admins-Mac-Pro-2:~ admin$ but before it would give me nothing. nothing means nothing. just the prompt and no feedback. I hope this explains everything. thank you again.

souleye left a reply on How Do I Change The Path Of New Laravel Install?

thank you all. I agree with all that you're saying but hear me out. I installed composer globally and it's located in the /usr/local/bin/ directory. I don't know if I moved it there or if it installed by default. then I tried to install laravel, the framework, not a laravel project, using composer global require "laravel/installer=~1.1 3 times but nothing happened. then I tried the second option composer create-project laravel/laravel --prefer-dist and it installed properly. the first time around, it installed right under /admin but that's not where I wanted it. that's when bestmomo suggested I use an explicit path. then I used ~/.composer/vendor/bin/ and it installed properly. next was to sudo nano .bash_profile and set the export path. there I got conflicting strings: export PATH="~/.composer/vendor/bin/", export PATH=~/.composer/vendor/bin/, export PATH="~/.composer/vendor/bin:$PATH", export PATH="/Users/admin/.composer/vendor/bin:$PATH". at the present time, it's the latest string that's on my .bash_profile. different people tell you different things. with your limited knowledge, you try what you're told to do, until you have a solution that works. of course, I exit and save and source .bash_profile. now when I tried 'laravel new app_name' it didn't work. I tried different things by moving from root directory all the way to the vendor bin but nothing worked. until I tried composer create-project laravel/laravel…after that, I went to install intervention image. nowhere in their documentation do they suggest that you have to cd to the directory where the project is installed. I guess that you have to guess it! then I ran the command ``$ php composer.phar require intervention/ima then I got an error message and I said maybe something's wrong. I changed it to ``php composer.phar require intervention/ima. I got the message that 'composer.phar… something'. I removed the .phar part and ran ```php composer require intervention/i, it didn't work. I tried ```composer.phar require intervention/i it didn't work. that's when I decided to seek help. I'm a beginner to laravel but I'm not new to computers, programming, developing. now intervention is installed properly but I don't even know why because nothing changed really. I'm not sure I installed it in the right directory because it's news to me. I'm gonna look it up and try to move it. that's where I am now. anything that I did wrong, I'd appreciate it if you tell me, so I would avoid the same mistakes down the road. actually I've thought of uninstalling everything and start from scratch but I don't know how to do it.

28 Sep
3 years ago

souleye left a reply on How Do I Change The Path Of New Laravel Install?

correction: it started working for an unknown reason with the message that 'The requested package guzzlehttp/guzzle == 3.8.1.0 could not be found.'. at least I'm getting somewhere.

souleye left a reply on How Do I Change The Path Of New Laravel Install?

thank you @Snapey but I no longer believe the 'instructions are straightforward'. case in point, the laravel installation says to install laravel, run this command composer global require "laravel/installer=~1.1" I tried it several times, nothing happened. it's only after I tried the second option composer create-project laravel/laravel --prefer-dist that laravel was successfully installed, albeit in the wrong directory. then to run laravel, I used the command 'laravel new app_name' I would invariably get an error message 'command not found'. I put the export path in different flavors into .bash_profile but it didn't help. I tried nearly everything that I could think of until I got tired. it's only sometime today that someone suggested that 'laravel new' is only an alias for the composer 'create' command. when I tried that, it finally worked. next on to to image/intervention. their website says, to install use this command: $ php composer.phar require intervention/image. I tried it several times without success. I'm still waiting to find a solution to that issue too...

souleye left a reply on Problem Creating A Laravel App With Command 'laravel New'

the only thing that worked apparently is the composer command composer create-project laravel/laravel [insert_project_name]. now when I cd to laravel, I can display this: admins-Mac-Pro-2:~ admin$ cd ~/.composer/vendor/bin/laravel/ admins-Mac-Pro-2:laravel admin$ ls app composer.lock package.json readme.md tests artisan config phpspec.yml resources vendor bootstrap database phpunit.xml server.php composer.json gulpfile.js public storage admins-Mac-Pro-2:laravel admin$

souleye left a reply on Problem Creating A Laravel App With Command 'laravel New'

@phildawson I have apparently found the solution here: I think the laravel command is an alias to the actual composer command to create a new project. Try using 'composer create-project laravel/laravel [insert_project_name]' instead. when I tried it, I didn't get an error message and I got feedback 'Created project in my app' and then, it installed a bunch of stuff. I'm gonna check later but I guess this resolved the issue. thanks again.

souleye left a reply on Problem Creating A Laravel App With Command 'laravel New'

thanks @phildawson but I think that I did everything that I was asked to do. and I placed a few variations of that code into my .bash_profile, like so 'export PATH=~/.composer/vendor/bin/:$PATH' (without the quotes) but it's still not working.

souleye started a new conversation Problem Creating A Laravel App With Command 'laravel New'

I managed to install laravel on my mac osx 10.75 but after everything was set, I tried to initiate a new app with the command 'laravel new app_name' I get the error message '-bash: laravel: command not found'. I checked everything and everything seems fine but I don'l have a clue why I'm getting that message. it seems other developers on linux/unix systems have had similar issues. any help will be appreciated. thanks. souleye

souleye left a reply on How Do I Change The Path Of New Laravel Install?

I tried it and it worked. the issue now is that I cannot create a new app using the command 'laravel new app_name'. I get the error message '-bash: laravel: command not found'. it seems to be pretty common on linux/unix systems. I haven't seen a solution that works, yet.

27 Sep
3 years ago

souleye left a reply on How Do I Change The Path Of New Laravel Install?

thank you @bestmomo. just to make sure, can I use this syntax, using '~/.composer/vendor/bin/'?

composer create-project laravel/laravel ~/.composer/vendor/bin/ --prefer-dist

thanks again.

souleye started a new conversation How Do I Change The Path Of New Laravel Install?

I'm in the process of installing a new laravel app. when I tried installing laravel using this command

composer global require "laravel/installer=~1.1"

nothing happened. I tried it 3 times. than I tried the second method

composer create-project laravel/laravel --prefer-dist

it did work but placed the installation in the admin directory. when I tried to access it through composer I get all sorts of error messages. I tried to follow the explanations in the laracast video to try to set the export path but I guess, I'm doing something wrong. any assistance in this matter will be appreciated. thanks.

17 Sep
3 years ago

souleye left a reply on How Do I Make A Character Limit/countdown Javascript To Work On My Form?

many thanks. it's working. now what I think I'm gonna need is a website where I can learn serious javascript. because my level is what you get from w3schools. very elementary. I can google it but getting a recommendation from a pro can help cut through the chase. thanks in advance.

16 Sep
3 years ago

souleye left a reply on How Do I Make A Character Limit/countdown Javascript To Work On My Form?

@snapey, I'm at least making some progress. if I remove this bit of code:

@if($bio)"><!-- some code goes here… -->
@else 
 <!-- some code goes here… -->
@endif 

it all starts working miraculously. how can I keep the conditional without conflicting with my javascript? thank you again. without your pointers, I wouldn't have arrived at that deduction.

souleye left a reply on How Do I Make A Character Limit/countdown Javascript To Work On My Form?

thank you again for your assistance but I have to admit that my javascript sucks. I'm working on it though but not before I get a good handle on laravel. I tested the javascript from code pen and it worked perfect. but the minute I change the id from 'comment' to 'bio', it stops working. that's what's been baffling me from the beginning. why are the attributes to this text area not working?

                    <div class="form-group" id="group_bio">
                        @if($bio)
                       <textarea name="Description" class="form-control textarea" id="bio" rows="4" placeholder="Keep Bio Short And Sweet" >{{$bio}}</textarea>
                        @else 
                        <textarea class="form-control textarea" id="bio" name="bio" rows="4" placeholder="Keep Bio Short And Sweet"></textarea>
                        @endif
                        
                    </div>
                </div>

applying the same script

    /* JQuery Code from:
 http://www.findsourcecode.com/jquery/how-to-count-number-of-characters-in-textarea-jquery/ */

var maxCharacters = 255;
$('#characterLeft').text(maxCharacters + ' characters left');
$('#bio').keyup(function () {
    var textLength = $(this).val().length;
    if (textLength >= maxCharacters) {
        $('#characterLeft').text('You have reached the limit of ' + maxCharacters + ' characters');
    } else {
        var count = maxCharacters - textLength;
        $('#characterLeft').text(count + ' characters left');
    }
});
</script>

I must be doing something wrong but since I'm beginning with laravel, I may be missing something.

15 Sep
3 years ago

souleye left a reply on How Do I Make A Character Limit/countdown Javascript To Work On My Form?

thanks @Snapey I tidied the code. this time I changed the javascript to one that's been proven to work on a plain html document. so why is it not working on a laravel document. also I'm having issues with 'maxlength'. though in some instances I specified a maxlength, it's not been working. what am I doing wrong?

13 Sep
3 years ago

souleye left a reply on How Do I Make A Character Limit/countdown Javascript To Work On My Form?

thank you for your response. I've been co-opted to work on a project using laravel. I'm quite new to the platform. I can understand that I'm having issues with javascript but when I used 'maxlength='200' and it didn't work, it got me wondering what I'm doing wrong. here's the code. javascript is at the bottom. @extends('layouts.default') @section('content')

Create your business profile today

It's simple.

  • 1
  • @if($ses_mail)
  • 2
  • 3
  • @else
  • 2
  • 3
  • @endif
            </ul>
        </div>
    </div>
    <div class="spacer-60"></div>
    
    <!--<div class="row">
        <div class="col-sm-10 col-sm-offset-1">
            <div class="col-ms-8 col-xs-8">
                    <h3>Business Info</h3>
                </div>
                <div class="col-ms-4 col-xs-4">
                    <p class="skip pull-right"><a href="#">SKIP THIS STEP</a></p>
                </div>
            </div>
        </div>
    </div>-->
    
    <!-- FORM 1 -->        
    <div class="col-sm-10 col-sm-offset-1">
        <form role="form" id="step1-form" method="post" action="{{url()}}/service/professionalCreate">
            @if ($errors->has())
    
            @foreach ($errors->all() as $error)
            {{ $error }}        
            @endforeach
    
            @endif
    
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group" id="group_first_name">
                        @if($first_name)
                        {{ Form::text('first_name', $first_name,array('placeholder'=>'First Name','class'=>'form-control')) }}     
                        
                        @else
                        <input type="text" class="form-control" id="first_name" name="first_name" placeholder="First Name" required>                                        
                        @endif
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group" id="group_last_name">
                        @if($first_name)
                        {{ Form::text('last_name', $last_name,array('placeholder'=>'Last Name','class'=>'form-control')) }}     
                        @else 
                        <input type="text" class="form-control" id="last_name" name="last_name" placeholder="Last Name" >
                        @endif
                    </div>
                </div>
            </div>
           
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group" id="group_gender" >
                        @if($gender)
                         {{ Form::select('gender', array(''=>'Select Gender','1'=>'Male','2'=>'Female') ,$gender,array('id' => 'gender','class'=>'form-control')) }}
                        @else 
                         {{ Form::select('gender', array(''=>'Select Gender','1'=>'Male','2'=>'Female') ,'Select Gender',array('id' => 'gender','class'=>'form-control')) }}
                          @endif
                    </div>
                </div>  
                <div class="col-sm-6">
                    <div class="form-group" id="group_email">
                         @if($email)
                        {{ Form::text('email', $email,array('placeholder'=>'Email Address','class'=>'form-control','readonly'=>'true')) }}     
                        @else 
                        <input type="email" class="form-control" id="email" name="email" placeholder="Email Address" autocomplete="off" required>
                          @endif
                    </div>
                </div>
            </div>                              
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group" id="group_password">
                        <input type="password" class="form-control" id="password" name="password" placeholder="Create Password" autocomplete="off" required>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group" id="group_repassword">
                        <input type="password" class="form-control" id="repassword" name="repassword" placeholder="Re-type Password" required>
                    </div>
                </div>
            </div>
    
            
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group" id="group_country">
                     
                        
                         @if($sess_country)
                         {{ Form::select('country', $country ,$sess_country,array('id' => 'country','class'=>'form-control')) }}
                        @else 
                {{ Form::select('country', $country ,'Select Country',array('id' => 'country','class'=>'form-control')) }}
                @endif
       
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group" id="group_state">
                         <select id='state' name='state' class='form-control'>
                <option>Select State</option>
            </select>
                                                             
                    </div>
                </div>                  
            </div>
            
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group" id="group_city">
                         @if($city)
                        {{ Form::text('city', $city,array('placeholder'=>'Business City','class'=>'form-control')) }}     
                        @else 
                        <input type="text" class="form-control" id="city" name="city" placeholder="City" required>
                        @endif
                    </div>
                </div>
                <div class="col-sm-6" id='zip_div' style='display: none'>
                    <div class="form-group" id="group_zip">
                         @if($city)
                        {{ Form::text('zip', $zip,array('placeholder'=>'Zip','class'=>'form-control','id'=>'zip')) }}     
                        @else 
                      {{ Form::text('zip', '',array('placeholder'=>'Zip','class'=>'form-control','id'=>'zip')) }}    
                      @endif
                    </div>
                </div>                  
            </div>
            
             
            <div class="row">
            <?php $bio = substr($_POST['bio'], 0, 10); ?>
                <div class="col-sm-12">
                    <div class="form-group" id="group_bio">
                        @if($bio)
                       <textarea class="form-control textarea" id="bio" name="bio" rows="4" maxlength="200" placeholder="Keep Bio Short And Sweet">{{$bio}}</textarea>
                        @else 
                        <textarea class="form-control textarea" id="bio" name="bio" rows="4" maxlength="200" placeholder="Keep Bio Short And Sweet"></textarea>
                        @endif
                    </div>
                </div>
            </div>
            
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group" id="group_phone_type">                                            
                        <p>
                            <label class="labletype">Type : </label>
                            @if($type == 1 || $type == '')
                            <label class="radio-inline">
                                <input type="radio" name="type" value="1" checked> Business
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="type" value="2" > Personal
                            </label>
                            @else 
                            <label class="radio-inline">
                                <input type="radio" name="type" value="1" > Business
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="type" value="2" checked> Personal
                            </label>
                            @endif
                        </p>
                    </div>
                </div>
            </div>
            
            
    
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group pull-right">
                        <input type='submit' id='submit' class='btn btn-finish btn-fill btn-success btn-wd btn-sm' name='finish' value='Save &amp; Continue' />
                    </div>
                </div>
            </div>
        </form>
    </div>
    <!-- END FORM 1 -->
    
    @stop
    

    @section('page-js')

        $(document).ready(function(){
            $( 'textarea#bio' ).ckeditor();
            var country = $("#country").val();
            
            if(country == 254){
            $('#zip_div').css('display','block');    
            }
            if(country != ''){
                 $.get("{{ url('statelist')}}",
                { option: country },
                function(data) {
                    var state = $('#state');
                state.empty();
                $.each(data, function(index,element) {
                    state.append("<option value='"+ element.id +"'>" + element.state + "</option>");
                });
                });
            }
            $('#country').change(function(){
              
                if($(this).val() == '254') {
                $('#zip_div').css('display','block');
                }else if($(this).val() == '') {
                    $('#state option[value!="0"]').remove();
                    $('#state').append("<option>Select State</option>");
                    return false;
                }
                else{
                  $('#zip_div').css('display','none');  
                }
                
                $.get("{{ url('statelist')}}",
                { option: $(this).val() },
                function(data) {
                    var state = $('#state');
                state.empty();
                $.each(data, function(index,element) {
                    state.append("<option value='"+ element.id +"'>" + element.state + "</option>");
                });
                });
            });
            
        });   
           
       
    
    </script>
    
    counter = function() { var value = $('#bio').val();
    if (value.length == 0) {
        $('#totalChars').html(0);
        return;
    }
    
    var totalChars = value.length;
    
    $('#totalChars').html(totalChars); //change the selector to whatever the ID of your counter area is
    

    };

    $(document).ready(function() { $('#bio').change(counter); $('#bio').keydown(counter); $('#bio').keypress(counter); $('#bio').keyup(counter); $('#bio').blur(counter); $('#bio').focus(counter); });

    @stop

souleye started a new conversation How Do I Make A Character Limit/countdown Javascript To Work On My Form?

I'm working on a project where I need to limit the number of characters users enter in their bio. I have tried many javascript scripts, tested to work on html pages but when I tried them on my laravel project none of them worked. I don't know why.

@extends('layouts.default')">@section('content')
<section class="container registration">
        <!-- FORM 1 -->        
    <div class="col-sm-10 col-sm-offset-1">
        <form role="form" id="step1-form" method="post" action="{{url()}}/service/professionalCreate">
            @if ($errors->has())

            @foreach ($errors->all() as $error)
            {{ $error }}        
            @endforeach

            @endif
            
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group" id="group_bio">
                        @if($bio)
                       <textarea name=Description class="form-control textarea" id="Description" name="bio" rows="4" placeholder="Keep Bio Short And Sweet" onKeyDown="checkMaxInput(this.form)" onKeyUp="checkMaxInput(this.form)">{{$bio}}</textarea>
                        @else 
                        <textarea class="form-control textarea" id="Description" name="bio" rows="4" placeholder="Keep Bio Short And Sweet"></textarea>
                        @endif
                        
                    </div>
                </div>
                <input readonly type=text name=remLen size="3" maxlength="3" value="500"><font size="2" color="000000"> characters left</font>
            </div>            
            

            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group pull-right">
                        <input type='submit' class='btn btn-finish btn-fill btn-success btn-wd btn-sm' name='finish' value='Save & Continue' />
                    </div>
                </div>
            </div>
        </form>
    </div>
    <!-- END FORM 1 -->

    @stop
    
   
@section('scripts')
       <SCRIPT>
function checkMaxInput(form) {
maxLen = 500; // max number of characters allowed in the textbox
if (form.Description.value.length > maxLen) // if too long.... trim it!
form.Description.value = form.Description.value.substring(0, maxLen);
// otherwise, update 'characters left' counter
else form.remLen.value = maxLen - form.Description.value.length;
}

</SCRIPT>
    
@stopassola