adhik13th

adhik13th

Member Since 1 Month Ago

Experience Points 770
Experience Level 1

4,230 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines 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.

19 May
5 days ago

adhik13th left a reply on Laravel Saved File To Wrong Directory

@JLRDW - No one changing . i rename this but not change anything .

adhik13th left a reply on Laravel Saved File To Wrong Directory

@JLRDW - my folder stricture

  • laravel
  • public_ftp
  • public_html
    • laravel *css *js

adhik13th left a reply on Laravel Saved File To Wrong Directory

@JLRDW - i not add RewriteBase on htaccess , its the problem ? and i think '../../' not the problem

adhik13th left a reply on Laravel Saved File To Wrong Directory

@JLRDW - no no , i remake all my upload file laravel on shared hosting using your tutorial . i following step and finish , i run my website example www.domain.com , if i run this its will showing like homepage, but in my url www.domain.com its showing Index Of .

https://ibb.co/FY4qZJF

its the picture . its wrong on htacces or what ?

adhik13th left a reply on Laravel Saved File To Wrong Directory

@JLRDW - i have problem . i follow this tutorial but , my view on www.domain.com is list of "Index Of" (if u know what i mean) , and for public i create folder named laravel . i access www.domain.com/laravel , its error 500 .

16 May
1 week ago

adhik13th left a reply on Laravel Saved File To Wrong Directory

@JLRDW - wait , i will following this step .

adhik13th left a reply on Laravel Saved File To Wrong Directory

@LYNX39 - i change permission o public_html to 777 and still not upload on public_html

adhik13th started a new conversation Laravel Saved File To Wrong Directory

I have a function to upload file . on Localhost its not having error . but after i deploy on shared hosting , its have problem . if localhost ,im not moving some folder , but on "tutorial" shared hosting , i need making 2 folder . laravel and public . this laravel folder is all file on project laravel without public

its my schema on my shared hosting

(/home/sippausr)

etc

laravel ->

  • app

  • bootstrap

  • config

  • database

  • public_html

    • files ( this file saved here)
  • resources

  • routes

  • storage

  • tests

  • vendor

logs

mail

public_ftp

public_html ->

  • css

  • files (not on here, i need to save here)

  • home

  • images

  • js

  • kalibrasi

  • public

  • sop

  • theme

and i have a function to upload file and saved this file to directory files on public_html like this

public function store6(Request $request)
{
    $this->validate($request, [
        

    ]);

    
    if($request->hasfile('image'))
     

        
        {   $file = $request->file('image');
            $name=$file->getClientOriginalName();
            $file->move(public_path().'/files/', $name);  
            $data = $name;  
        }
    

    $user = new pemeliharaan;
    $id = Auth::user()->id;

    $user->user_id = $id;
    $user->alat_id = $request->alat_id;
    $user->pertanyaan =json_encode($request->except
    (['_token','name','alat_id','status','catatan','image']));
    $user->catatan = $request->catatan;
    $user->image=$data;
    $user->status = $request->status;


    $user->save();
  // dd($user);
    return redirect('user/show6')->with('success', 'Data Telah Terinput');

}

but , this file not saved at public_html/files ,

this file saved at Laravel folder , on public_html( you can see at schema) . can someone help me ?

adhik13th left a reply on Upload Image Not Saved At Directory On Server Laravel 5.8

@SNAPEY - in shared hosting laravel we save the file in public_html . its right ?

adhik13th left a reply on Upload Image Not Saved At Directory On Server Laravel 5.8

@MUNAZZIL - No sir , in my local its work and saved this data to directory an database . i think this problem is "how to save this file to directory"

adhik13th left a reply on Upload Image Not Saved At Directory On Server Laravel 5.8

@JAIKANGAM - permission is just folder bro . chmod -777

adhik13th left a reply on Upload Image Not Saved At Directory On Server Laravel 5.8

@LIDE - no , didnt work use store . i think move is right sir

15 May
1 week ago

adhik13th started a new conversation Upload Image Not Saved At Directory On Server Laravel 5.8

I deploy my website , and i have a bug on my upload image , this image cant saved at directory

my directory is in

in public_html on folder named files

on localhost its not having problem but after i deploy this , i have it .

my Controller on my localhost (not have problem like this)

 public function store6(Request $request)
{
    $this->validate($request, [
        

    ]);

    if($request->hasfile('image'))
     

        
        {   $file = $request->file('image');
            $name=$file->getClientOriginalName();
            $file->move(public_path().'/files/', $name);  
            $data = $name;  
        }
    

    $user = new pemeliharaan;
    $id = Auth::user()->id;

    $user->user_id = $id;
    $user->alat_id = $request->alat_id;
    $user->pertanyaan =json_encode($request->except
    (['_token','name','alat_id','status','catatan','image']));
    $user->catatan = $request->catatan;
    $user->image=$data;
    $user->status = $request->status;


    $user->save();
  // dd($user);
    return redirect('user/show6')->with('success', 'Data Telah Terinput');

}

this image "name" saved on DB but this file not saved , cant someone correct my code ?

26 Apr
4 weeks ago

adhik13th left a reply on How To Add Foreign Key On Not Id (NOT Primary Key)

@CHIJIPON - its need add to at parents table on No_RM ?

adhik13th started a new conversation How To Add Foreign Key On Not Id (NOT Primary Key)

I have a migration on Laravel for table pasien like this :

public function up()
{
    Schema::create('pasien', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('No_RM',15);
        $table->timestamps();
        $table->softDeletes();
    });
}

and now i want to make a foreign key to No_RM , NOT to id

public function up()
{
    Schema::create('data_primary', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('RM_id',15);
        $table->string('file_primary');
        $table->timestamps();

        $table->foreign('RM_id')->references('No_RM')->on('pasien');
    });
}

and still have error

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned not null, file_primary varchar(255) not null, created_at timestamp ' at line 1")

can someone correct my error ?

18 Apr
1 month ago

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - i think i need to save $data in this

$user->pertanyaan =json_encode($request->except (['_token','name','alat_id','status','catatan']));

but how ?

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - emm i think i save json because i can decode it with any item on colomn 'pertanyaan'

u know sir , if i not use enctype="multipart/form-data" this image can saved on db like this "image":"img.jpg" (i want this) BUT not saved at directory

if i using enctype="multipart/form-data" , this image saved on directory but in database just like this "image":{}

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SIANGBOON - how to extract this $data on my controller ? my image saved in $data and different json saved at $request

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - how i can saved this $data to my colomn "pertanyaan" on my controller like this

'$user = new pemeliharaan;
$id = Auth::user()->id;

$user->user_id = $id;
$user->alat_id = $request->alat_id;
$user->pertanyaan =json_encode($request->except
(['_token','name','alat_id','status','catatan']));//this image on here , how i can save on here ?
$user->catatan = $request->catatan;
$user->status = $request->status;


$user->save(); '

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - 1.

          <td>
              <label><input type="radio"  name="answer1" value="tidak baik" checked></label>
          </td>
          <td>
              <label><input type="radio"  name="answer1" value="baik"></label>
          </td>
        </tr>
       
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="file" name="image" value="" > </td>
               
            </tr>
       
        </div>
      
       
        <tr>
            <td></td>
            <td> <div class="form-group">
                <label>Catatan</label>
                <textarea class="form-control" name="catatan" rows="3" placeholder="Enter ..." required></textarea>
             </div>
         
        </tr>

        
    <input type="hidden" name="alat_id" value="7">
    <input type="hidden" name="status"  value="3 Bulanan">             
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    
  </tbody>
 
</table>
      <div class="box-footer">
        <button type="submit" class="btn btn-primary" name="name" value="post">Submit</button>
       </div>
</form>

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - ` 1. {{-- --}}

          <td>
              <label><input type="radio"  name="answer1" value="tidak baik" checked></label>
          </td>
          <td>
              <label><input type="radio"  name="answer1" value="baik"></label>
          </td>
        </tr>
       
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="file" name="image" value="" > </td>
               
            </tr>
       
        </div>
      
       
        <tr>
            <td></td>
            <td> <div class="form-group">
                <label>Catatan</label>
                <textarea class="form-control" name="catatan" rows="3" placeholder="Enter ..." required></textarea>
             </div>
         
        </tr>

        
    <input type="hidden" name="alat_id" value="7">
    <input type="hidden" name="status"  value="3 Bulanan">             
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    
  </tbody>
 
</table>
      <div class="box-footer">
        <button type="submit" class="btn btn-primary" name="name" value="post">Submit</button>
       </div>
</form> `

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - Pertanyaan Tidak Baik Baik

    <div class="form-group">
        <tr>
          <td>1.</td>
          <td><input class="form-control" style="border:none"   type="text" name="question1" value="Kondisi, kebersihan, pelumasan bearing" readonly></td>
          {{--  <td><input class="form-control" type="text" placeholder=".input-lg"></td>  --}}
          
          <td>
              <label><input type="radio"  name="answer1" value="tidak baik" checked></label>
          </td>
          <td>
              <label><input type="radio"  name="answer1" value="baik"></label>
          </td>
        </tr>
       
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="file" name="image" value="" > </td>
               
            </tr>
       
        </div>
      
       
        <tr>
            <td></td>
            <td> <div class="form-group">
                <label>Catatan</label>
                <textarea class="form-control" name="catatan" rows="3" placeholder="Enter ..." required></textarea>
             </div>
         
        </tr>

        
    <input type="hidden" name="alat_id" value="7">
    <input type="hidden" name="status"  value="3 Bulanan">             
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    
  </tbody>
 
</table>
      <div class="box-footer">
        <button type="submit" class="btn btn-primary" name="name" value="post">Submit</button>
       </div>
</form>

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - ``` # Pertanyaan Tidak Baik Baik

    <div class="form-group">
        <tr>
          <td>1.</td>
          <td><input class="form-control" style="border:none"   type="text" name="question1" value="Kondisi, kebersihan, pelumasan bearing" readonly></td>
          {{--  <td><input class="form-control" type="text" placeholder=".input-lg"></td>  --}}
          
          <td>
              <label><input type="radio"  name="answer1" value="tidak baik" checked></label>
          </td>
          <td>
              <label><input type="radio"  name="answer1" value="baik"></label>
          </td>
        </tr>
       
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="file" name="image" value="" > </td>
               
            </tr>
       
        </div>
      
       
        <tr>
            <td></td>
            <td> <div class="form-group">
                <label>Catatan</label>
                <textarea class="form-control" name="catatan" rows="3" placeholder="Enter ..." required></textarea>
             </div>
         
        </tr>

        
    <input type="hidden" name="alat_id" value="7">
    <input type="hidden" name="status"  value="3 Bulanan">             
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    
  </tbody>
 
</table>
      <div class="box-footer">
        <button type="submit" class="btn btn-primary" name="name" value="post">Submit</button>
       </div>
</form>```

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - # Pertanyaan Tidak Baik Baik

    <div class="form-group">
        <tr>
          <td>1.</td>
          <td><input class="form-control" style="border:none"   type="text" name="question1" value="Kondisi, kebersihan, pelumasan bearing" readonly></td>
          {{--  <td><input class="form-control" type="text" placeholder=".input-lg"></td>  --}}
          
          <td>
              <label><input type="radio"  name="answer1" value="tidak baik" checked></label>
          </td>
          <td>
              <label><input type="radio"  name="answer1" value="baik"></label>
          </td>
        </tr>
       
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="file" name="image" value="" > </td>
               
            </tr>
       
        </div>
      
       
        <tr>
            <td></td>
            <td> <div class="form-group">
                <label>Catatan</label>
                <textarea class="form-control" name="catatan" rows="3" placeholder="Enter ..." required></textarea>
             </div>
         
        </tr>

        
    <input type="hidden" name="alat_id" value="7">
    <input type="hidden" name="status"  value="3 Bulanan">             
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    
  </tbody>
 
</table>
      <div class="box-footer">
        <button type="submit" class="btn btn-primary" name="name" value="post">Submit</button>
       </div>
</form>

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

i can add "<form method , encypte,action> at this comment

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - # Pertanyaan Tidak Baik Baik

    <div class="form-group">
        <tr>
          <td>1.</td>
          <td><input class="form-control" style="border:none"   type="text" name="question1" value="Kondisi, kebersihan, pelumasan bearing" readonly></td>
          {{--  <td><input class="form-control" type="text" placeholder=".input-lg"></td>  --}}
          
          <td>
              <label><input type="radio"  name="answer1" value="tidak baik" checked></label>
          </td>
          <td>
              <label><input type="radio"  name="answer1" value="baik"></label>
          </td>
        </tr>
       
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="file" name="image" value="" > </td>
               
            </tr>
       
        </div>
      
       
        <tr>
            <td></td>
            <td> <div class="form-group">
                <label>Catatan</label>
                <textarea class="form-control" name="catatan" rows="3" placeholder="Enter ..." required></textarea>
             </div>
         
        </tr>

        
    <input type="hidden" name="alat_id" value="7">
    <input type="hidden" name="status"  value="3 Bulanan">             
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    
  </tbody>
 
</table>
      <div class="box-footer">
        <button type="submit" class="btn btn-primary" name="name" value="post">Submit</button>
       </div>
</form>

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SNAPEY - thats the problem . my original content not saving at folder "images" . ok i will show my form . wait a minute

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@MAVERICKCHAN - i think its not the problem . the problem is using enctype="multipart/form-data" if using this , my json file will like this "image":"{}" , but if not using encypte will like this "image":"img.jpg"

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SIANGBOON - i adding "enctype="multipart/form-data" but having error "htmlspecialchars() expects parameter 1 to be string, array given "

17 Apr
1 month ago

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

and having error

htmlspecialchars() expects parameter 1 to be string, array given

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SIANGBOON - 1. {{-- --}}

          <td>
              <label><input type="radio"  name="answer1" value="tidak baik" checked></label>
          </td>
          <td>
              <label><input type="radio"  name="answer1" value="baik"></label>
          </td>
        </tr>
        </div>
        <tr>
          <td></td>
          <td><input class="form-control" style="border:none"  type="hidden" name="question2" value="" readonly></td>
          
              <td>
                  <label><input type="hidden"  name="answer2"  value="" checked></label>
              </td>
              <td>
                  <label><input type="hidden"  name="answer2" value=""></label>
              </td>
        </tr>
        <tr>
            <td></td>
            <td> <input class="form-control" style="border:none"  type="hidden" name="question3" value="" readonly> </td>
            <td>
                <label><input type="hidden"  name="answer3"  value="" checked></label>
            </td>
            <td>
                <label><input type="hidden"  name="answer3" value=""></label>
            </td>
         </tr>
        <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question4" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer4"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer4" value=""></label>
                </td>
        </tr>
        <tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question5" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer5"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer5" value=""></label>
                </td>
        </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question6" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer6"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer6" value=""></label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question7" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer7"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer7" value=""></label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question8" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer8"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer8" value=""></label>
                </td>
            </tr>
             
             <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question9" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer9"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer9" value=""></label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question10" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer10"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer10" value=""></label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="file" name="image" value="" readonly> </td>
               
            </tr>
       
        </div>
      
       
        <tr>
            <td></td>
            <td> <div class="form-group">
                <label>Catatan</label>
                <textarea class="form-control" name="catatan" rows="3" placeholder="Enter ..." required></textarea>
             </div>
         
        </tr>

        
    <input type="hidden" name="alat_id" value="7">
    <input type="hidden" name="status"  value="3 Bulanan">             
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    
  </tbody>
 
</table>
      <div class="box-footer">
        <button type="submit" class="btn btn-primary" name="name" value="post">Submit</button>
       </div>
</form>

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@SIANGBOON - # Pertanyaan Tidak Baik Baik

    <div class="form-group">
        <tr>
          <td>1.</td>
          <td><input class="form-control" style="border:none"   type="text" name="question1" value="Kondisi, kebersihan, pelumasan bearing" readonly></td>
          {{--  <td><input class="form-control" type="text" placeholder=".input-lg"></td>  --}}
          
          <td>
              <label><input type="radio"  name="answer1" value="tidak baik" checked></label>
          </td>
          <td>
              <label><input type="radio"  name="answer1" value="baik"></label>
          </td>
        </tr>
        </div>
        <tr>
          <td></td>
          <td><input class="form-control" style="border:none"  type="hidden" name="question2" value="" readonly></td>
          
              <td>
                  <label><input type="hidden"  name="answer2"  value="" checked></label>
              </td>
              <td>
                  <label><input type="hidden"  name="answer2" value=""></label>
              </td>
        </tr>
        <tr>
            <td></td>
            <td> <input class="form-control" style="border:none"  type="hidden" name="question3" value="" readonly> </td>
            <td>
                <label><input type="hidden"  name="answer3"  value="" checked></label>
            </td>
            <td>
                <label><input type="hidden"  name="answer3" value=""></label>
            </td>
         </tr>
        <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question4" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer4"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer4" value=""></label>
                </td>
        </tr>
        <tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question5" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer5"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer5" value=""></label>
                </td>
        </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question6" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer6"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer6" value=""></label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question7" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer7"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer7" value=""></label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question8" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer8"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer8" value=""></label>
                </td>
            </tr>
             
             <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question9" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer9"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer9" value=""></label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="hidden" name="question10" value="" readonly> </td>
                <td>
                    <label><input type="hidden"  name="answer10"  value="" checked></label>
                </td>
                <td>
                    <label><input type="hidden"  name="answer10" value=""></label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="file" name="image" value="" readonly> </td>
               
            </tr>
       
        </div>
      
       
        <tr>
            <td></td>
            <td> <div class="form-group">
                <label>Catatan</label>
                <textarea class="form-control" name="catatan" rows="3" placeholder="Enter ..." required></textarea>
             </div>
         
        </tr>

        
    <input type="hidden" name="alat_id" value="7">
    <input type="hidden" name="status"  value="3 Bulanan">             
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    
  </tbody>
 
</table>
      <div class="box-footer">
        <button type="submit" class="btn btn-primary" name="name" value="post">Submit</button>
       </div>
</form>

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

its my view , i think i have error here ' # Pertanyaan Tidak Baik Baik

    <div class="form-group">
        <tr>
          <td>1.</td>
          <td><input class="form-control" style="border:none"   type="text" name="question1" value="Kondisi, kebersihan, pelumasan bearing" readonly></td>
          {{--  <td><input class="form-control" type="text" placeholder=".input-lg"></td>  --}}
          
          <td>
              <label><input type="radio"  name="answer1" value="tidak baik" checked></label>
          </td>
          <td>
              <label><input type="radio"  name="answer1" value="baik"></label>
          </td>
        </tr>
        </div>
  
            <tr>
                <td></td>
                <td> <input class="form-control" style="border:none"  type="file" name="image" value="" readonly> </td>
               
            </tr>
       
        </div>
      
       
        <tr>
            <td></td>
            <td> <div class="form-group">
                <label>Catatan</label>
                <textarea class="form-control" name="catatan" rows="3" placeholder="Enter ..." required></textarea>
             </div>
         
        </tr>

        
    <input type="hidden" name="alat_id" value="7">
    <input type="hidden" name="status"  value="3 Bulanan">             
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    
  </tbody>
 
</table>
      <div class="box-footer">
        <button type="submit" class="btn btn-primary" name="name" value="post">Submit</button>
       </div>
</form>'

i add " enctype="multipart/form-data" , and having error "htmlspecialchars() expects parameter 1 to be string, array given "

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

whats wrong about this

'if($request->hasfile('image'))
     {

        foreach($request->file('image') as $file)
        {
            $name=$file->getClientOriginalName();
            $file->move(public_path().'/files/', $name);  
            $data[] = $name;  
        }
     }'

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

i just wanna debuging where my fault code to save in directory .

adhik13th left a reply on How To Save Upload Image To Directory In Laravel 5.8

@JLRDW - its not solution , i try from your search url

adhik13th started a new conversation How To Save Upload Image To Directory In Laravel 5.8

i have a function to upload images , this upload type is json . this json like this :

"pertanyaan" => "{"question1":"Kondisi, kebersihan, pelumasan bearing","answer1":"baik","image":"gambar.png"} ◀"

on this json have a key value = image : gambar.png . this name of image is saved into json . and the problem is i cant saved this image (gambar.png) into directory file on folder . my input:

<td> <input class="form-control" style="border:none"  type="file" name="image" value="" readonly> </td>

its my controller :

public function store(Request $request)
{
    if($request->hasfile('image'))
     {

        foreach($request->file('image') as $file)
        {
            $name=$file->getClientOriginalName();
            $file->move(public_path().'/images/', $name);  
            $data = $name;  
        }
     }

    $user = new pemeliharaan;
    $id = Auth::user()->id;

    $user->user_id = $id;
    $user->alat_id = $request->alat_id;
    $user->pertanyaan =json_encode($request->except
    (['_token','name','alat_id','status','catatan']));//this image on here
    $user->catatan = $request->catatan;
    $user->status = $request->status;


    $user->save();
    //dd($user);
    return redirect('user/show6')->with('success', 'Data Telah Terinput');

}

I am create a folder images at public. can someone correct my code to saved file(image) ?