davy_yg

Experience

11,050

0 Best Reply Awards

  • Member Since 2 Months Ago
  • 66 Lessons Completed
  • 0 Favorites

27th June, 2017

davy_yg left a reply on Error: FatalThrowableError • 3 hours ago

how to comment out the code if I am using laravel blade?

I am in the middle of converting my CI code to laravel

26th June, 2017

davy_yg left a reply on Error: FatalThrowableError • 4 hours ago

Nevermind, I forget ; in the route.

davy_yg started a new conversation Error: FatalThrowableError • 5 hours ago

(1/1) FatalThrowableError

Parse error: syntax error, unexpected end of file

login.blade.php

 <div class="login-card">

   <center><?php //echo $warning; ?></center>
   <h2>Gionda CMS Login</h2><br>

   <form method="post" enctype="multipart/form-data" action="{{ Url('home/proseslogin') }}">
   <input type="hidden" name="_token" id="_token" value="<?php echo csrf_token() ?>">

   <div class="login"><input type="text" name="username" placeholder="Username"></div>
   <div class="login"><input type="password" name="password" placeholder="Password">               </div>
<br>
    <input type="submit" name="login" class="login login-submit" value="login">
    </form>

    <div class="login-help">
    <a href="#">Register</a> • <a href="#">Forgot Password</a>
   </div>
  </div>

HomeController.php

 function proseslogin(Request $request)
{
    $username = $request->input('username');
    $password = $request->input('password');

    if(Auth::attempt(['username'=>$username, 'password'=>$password]))
    {
        $request->session()->flash('pesan', 'Welcome '. Auth::user()->username);
        return redirect('home/index');
    }
    else
    {   
        $request->session()->flash('pesan', 'Username / Password salah');
        return redirect('home/login');
    }       
 }

davy_yg left a reply on Function Does Not Exist • 1 day ago

Done: get the answer

Suppose to be

routes/web.php

  Route::get('home/login', ['uses' => [email protected]']);

davy_yg started a new conversation Function Does Not Exist • 1 day ago

Hello,

I am having a problem with this error.

(1/1) ReflectionException

Function () does not exist in RouteSignatureParameters.php (line 22) at ReflectionFunction->__construct('')in RouteSignatureParameters.php (line 22) at RouteSignatureParameters::fromAction(array('middleware' => 'web', 'uses => [email protected]', 'uses' => null, 'namespace' => 'App\Http\Controllers', 'prefix' => null, 'where' => array()), 'Illuminate\Database\Eloquent\Model')in Route.php (line 425) at Route->signatureParameters('Illuminate\Database\Eloquent\Model')in ImplicitRouteBinding.php (line 20)

I wonder what I did wrong?

Controller/HomeController.php

 <?php

 namespace App\Http\Controllers;

 use Illuminate\Http\Request;


 class HomeController extends Controller
 {


function login()
{
    return view('login');
}
 }

routes/web.php

   Route::get('home/login', ['uses => [email protected]']);

16th June, 2017

davy_yg left a reply on Creating Speech Recognation • 1 week ago

It suddenly works again. Now, I am looking for a way to read the text out loud automatically in a selected language. Any clue?

davy_yg left a reply on Creating Speech Recognation • 1 week ago

Hello @shati,

your first post works for a while then suddenly it stop working:

Permission to use microphone is blocked. To change, go to chrome://settings/contentExceptions#media-stream

I wonder my setting is asking before using the microphone.

14th June, 2017

davy_yg left a reply on Creating Speech Recognation • 1 week ago

I am trying it out in firefox:

Web Speech API is not supported by this browser. Upgrade to Chrome version 25 or later.

Is google chrome the only browser that support web api?

13th June, 2017

davy_yg started a new conversation Creating Speech Recognation • 2 weeks ago

Hello,

Anyone ever create speech recognization with laravel?

Just like browsing google you can just say it and it automatically type by itself.

12th June, 2017

davy_yg left a reply on Random Picture On Profile • 2 weeks ago

Whoops I forget to change the picture back to the tiger picture. There I change it!

davy_yg started a new conversation Random Picture On Profile • 2 weeks ago

Hello,

Please cek this site: www.fresway.com

See that profile picture of a tiger? I would like to add up to 3 different profile picture which will changes each day. How to create a system like that?

Each day will be a different profile picture and will rotate to the first one after 3 days. I know how to save and show profile picture but how to make it rotate or changes every day and rotate to the first one after 3 days?

davy_yg started a new conversation Db Host • 2 weeks ago

Hello,

I am receiving this error message:

QueryException in Connection.php line 647: SQLSTATE[HY000] [1045] Access denied for user 'advancew_user'@'centaur.indowebsite.net' (using password: YES) (SQL: select * from user)

I wonder if I am writing the correct connection:

  .env

 DB_CONNECTION=mysql
 DB_HOST=www.fresway.com 
 DB_PORT=3306
 DB_DATABASE=laravel5   
 DB_USERNAME=advancew_user    
 DB_PASSWORD=********

7th June, 2017

davy_yg left a reply on Open A File • 2 weeks ago

It's for attachment. If the file is encrypted then how could I attach a new attachment?

davy_yg started a new conversation Open A File • 2 weeks ago

Hello,

I am trying to open a file in : framework - public - uploads - 15 Strategi Nambah Likes.pdf

http://fresway.com/public/uploads/15%20Strategi%20Nambah%20Likes.pdf

It comes out: NotFoundHttpException in RouteCollection.php line 143:

6th June, 2017

davy_yg left a reply on Unable To Upload File • 3 weeks ago

The url turn into http://localhost/upload after pressing the upload button.

and:

Object not found!

public function uploadSubmit(Request $request)
{   
    dd($request->all());
    
    $product = Product::create($request->all());
    foreach ($request->photos as $photo) {
        $filename = $photo->store('photos');
        ProductsPhoto::create([
            'product_id' => $product->id,
            'filename' => $filename
        ]);
    }
    return 'Upload successful!';
}

davy_yg left a reply on Unable To Upload File • 3 weeks ago

upload_form.php

<form action="/upload" method="post" enctype="multipart/form-data">
     {{ csrf_field() }}
  Product name:
  <br />
 <input type="text" name="name" />
 <br /><br />
 Product photos (can attach more than one):
 <br />
 <input type="file" name="photos[]" multiple />
 <br /><br />
 <input type="submit" value="Upload" />
 </form>

UploadController.php

class UploadController extends Controller
{
//

public function uploadForm()
{
    return view('upload_form');
}

public function uploadSubmit(Request $request)
{
    $product = Product::create($request->all());
    foreach ($request->photos as $photo) {
        $filename = $photo->store('photos');
        ProductsPhoto::create([
            'product_id' => $product->id,
            'filename' => $filename
        ]);
    }
    return 'Upload successful!';
}
}

routes.php

 Route::get('/upload', [email protected]');
 Route::post('/upload', [email protected]');

davy_yg started a new conversation Unable To Upload File • 3 weeks ago

Hello,

I am following this tutorial to upload file: http://laraveldaily.com/upload-multiple-files-laravel-5-4/

When I press the upload button: Object not found!

I wonder why?

davy_yg started a new conversation Could Not Find Package Laravel With Stability Stable. • 3 weeks ago

Hello,

I try to download the latest ditribution:

composer create-project --prefer-dist laravel

[InvalidArgumentException] Could not find package laravel with stability stable.

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [] [] []

I get the above message. I wonder why?

2nd June, 2017

davy_yg left a reply on SEO Failed • 3 weeks ago

I wonder why this codes does not work and causes the error: $user_id = Auth::User()->id; ?

I need $user_id since it is relative.

davy_yg started a new conversation SEO Failed • 3 weeks ago

AjaxController.php

 public function postUpdateSeo(Request $request)
 {
    $user = Auth::User();
    $user_id = Auth::User()->id;

    if ($user) {
        $domain = $_SERVER['SERVER_NAME'];
        $user = User::where('domain', $domain)->first();

        $meta_title = $request->input("meta_title");
        $meta_keyword = $request->input("meta_keyword");
        $meta_description = $request->input("meta_description");
        date_default_timezone_set("Asia/Jakarta");
        $meta = Meta::where('meta_id', 1)->first();
        $meta->meta_title = $meta_title;
        $meta->meta_keyword = $meta_keyword;
        $meta->meta_description = $meta_description;
     
        DB::statement("update user_profile set meta_title = '$meta_title', meta_keyword = '$meta_keyword', meta_description = '$meta_description' where user_id = '$user_id'");
        
        $message = "success";
        
       
        echo json_encode($message);
    }
  }

articles.blade.php

 $("#btn-save-seo").click(function(e){
     
        var meta_title = $("#meta_title").val();
        meta_keyword = $("#meta_keyword").val();
        meta_description = $("#meta_description").val();            
        $.ajax({
            method: "POST",
            url: '{{action("[email protected]")}}',
            data: { meta_title : meta_title, meta_keyword : meta_keyword, meta_description: meta_description, },
            success: function (response) {
                
                pesanOk("SEO updated");
               setTimeout(function(){location.reload()},1000);
            },
            error:function()
            {
                pesanErr("SEO failed");
            }
        })

articles.blade.php

        <label>SEO</label><br><br>
                                                
                                                <table width="350px">
                                                <form action="" method="post">
                                                {{ csrf_field() }}      
                                                
                                                <tr>
                                                <td style="color: white;">Meta Title</td>
                                                <td><input type="text" size="42" id="meta_title" value="{{ \DB::table('user_profile')->where('user_id', 95)->first()->meta_title }}" name="meta_title"></td>
                                                </tr>
                                                <tr>
                                                <td style="color: white;">Meta Keyword</td>
                                                <td><input type="text" size="42" id="meta_keyword" value="{{ \DB::table('user_profile')->where('user_id', 95)->first()->meta_keyword }}" name="meta_keyword"></td>
                                                </tr>
                                                <tr>
                                                <td style="color: white; padding-right: 10px;">Meta Description</td>
                                                <td><textarea cols="39" rows="2" id="meta_description" name="meta_description">{{ \DB::table('user_profile')->where('user_id', 95)->first()->meta_description }}</textarea> 
                                                </td>
                                                </tr>
                                                <tr>
                                                <td><br><input type="submit" value="update" id="btn-save-seo"></td>
                                                <td></td>
                                                </tr>

                                                </form>
                                                </table>

If I press the update button SEO Failed. Why is it?

1st June, 2017

davy_yg started a new conversation Error : Trying To Get Property Of Non-object • 3 weeks ago

Hello,

What does this error means:

ErrorException in 611a63e196186a6ce4413823915b9609 line 175: Trying to get property of non-object (View: C:\xampp\htdocs\framework_freshway\framework2\resources\views\home.blade.php) (View: C:\xampp\htdocs\framework_freshway\framework2\resources\views\home.blade.php)

    #circle1
    {
    background-color: #{{ \DB::table('user_profile')->where('user_id', Auth::user()->id)->first()->menu_color }};
    <!-- background-color: #9f7bfc; -->
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
    
    }

Line 175: background-color: #{{ \DB::table('user_profile')->where('user_id', Auth::user()->id)->first()->menu_color }};

26th May, 2017

davy_yg left a reply on Use And Namespace • 1 month ago

I still do not understand does that means that using "use" is the same thing like utilizing view and model into the controller or another controller?

davy_yg started a new conversation Use And Namespace • 1 month ago

Can you guys help me understand the following codes:

namespace Soulfy\Http\Controllers;

use Illuminate\Http\Request;

use Soulfy\Http\Requests;
use Soulfy\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Soulfy\Setting;
use Soulfy\Timeline;
use Soulfy\Article;
use Soulfy\User;
use Soulfy\UserMail;
use Soulfy\Youtube;
use Soulfy\Gallery;
use Soulfy\Meta;
use Storage;
use File;
use DB;

class AjaxController extends Controller
{

AjaxController is a file in controller Http/Controller folder. Where can I find Soulfy\Timeline file?

I wonder.

23rd May, 2017

davy_yg left a reply on Showing Flash Warning • 1 month ago

I read the article but have not rewatch the video due to at my office I cannot watch the video only at home since I have to subscribe to proxy server to watch it.

ErrorException in f449f80e44a74b9a67256d57782792af line 149: Use of undefined constant session - assumed 'session' (View: C:\xampp\htdocs\framework_freshway\framework\resources\views\soulfy\articles.blade.php)

Perhaps anyone else can help me fix the codes:

HomeController.php

public function postSeo(Request $request) {

   $data = array('meta_title' => $request->get('meta_title'),
               'meta_keyword' => $request->get('meta_keyword'),
               'meta_description' => $request->get('meta_description')
               );


   DB::table('meta')->where('meta_id', '1')
                    ->update($data);

   $request->session()->flash('status', 'Successfully update seo info.');                   

   return redirect('/home/article');                

}

articles.blade.php

  <?php echo session; ?>

                                            <label>SEO</label><br><br>
                                                
                                                                                    <table width="350px">
                                                            <form action="{{ action([email protected]')}}" method="post">
                                                {{ csrf_field() }}      
                                                
                                                <tr>
                                                        <td>Meta Title</td>
                                                        <td><input type="text" value="{{ \DB::table('meta')->where('meta_id', 1)->first()->meta_title }}" name="meta_title"></td>
                                                </tr>
                                                <tr>
                                                        <td>Meta Keyword</td>
                                                        <td><input type="text" value="{{ \DB::table('meta')->where('meta_id', 1)->first()->meta_keyword }}" name="meta_keyword"></td>
                                                </tr>
                                                <tr>
                                                        <td>Meta Description</td>
                                                        <td><input type="text" value="{{ \DB::table('meta')->where('meta_id', 1)->first()->meta_description }}" name="meta_description"></td>
                                                </tr>
                                                <tr>
                                                        <td><br><br><input type="submit" value="update"></td>
                                                        <td></td>
                                                </tr>

                                                                        </form>
                                                            </table>
                                            

Thanks in advance.

22nd May, 2017

davy_yg started a new conversation Firstpage • 1 month ago

Can you guys tell what page is the first page?

http://fresway.com/

I cannot find the meta description code in that page through the blade template.

I check the routes:

Route::get('/', [
   'as' => 'index', 'uses' => [email protected]'
]);

Also the controller:

public function getHome()
{
 ...

 return view('soulfy.index_v2', ['user' => $user, 'articles' => $articles, 'settings' => $settings]);
 }

I cannot find the meta description on the top:

index_v2.blade.php

 <?php

$user_setting = \Soulfy\Setting::where('user_id',       $user['id'])->first();
$no = 1;

$user_profile = \Soulfy\UserProfile::where('user_id',   $user->id)->first();
 if ($user_profile) {

 }
 ?>


 @extends('home')
 @section('title', 'Home')
 @section('content')

home.blade.php

@extends('soulfy')
@section('title', 'Home')
@section('content')

<div id="content_body" style="position: static">

soulfy.blade.php

@extends('soulfy')
@section('title', 'Home')
@section('content')

<section id="content-desc">

I still cannot find the meta description which suppose to be on the first page.

davy_yg started a new conversation Showing Flash Warning • 1 month ago

Hello,

How to show flash notification with laravel?

 <label>SEO</label><br><br>
                                                
                                                <table width="350px">
                                                <form action="{{ action([email protected]')}}" method="post">
                                                {{ csrf_field() }}      
                                                
                                                <tr>
                                                <td>Meta Title</td>
                                                      <td><input type="text" value="{{ \DB::table('meta')->where('meta_id', 1)->first()->meta_title }}" name="meta_title"></td>
                                                </tr>
                                                <tr>
                                                <td>Meta Keyword</td>
                                                <td><input type="text" value="{{ \DB::table('meta')->where('meta_id', 1)->first()->meta_keyword }}" name="meta_keyword"></td>
                                                </tr>
                                                <tr>
                                                <td>Meta Description</td>
                                                <td><input type="text" value="{{ \DB::table('meta')->where('meta_id', 1)->first()->meta_description }}" name="meta_description"></td>
                                                </tr>
                                                <tr>
                                                <td><br><br><input type="submit" value="update"></td>
                                                <td></td>
                                                </tr>

                                                </form>
                                                </table>

After updating the seo information, I except a flash notification will show up - "successfully updating seo info."

How to create notification like that?

davy_yg started a new conversation Downloading Laravel • 1 month ago

Hello,

This is a simple question that I ask a month ago but I kindda lost. Where can you download the original laravel file?

I thought they change the outlook of laravel.com - I cannot find the original laravel file to play with.

Thanks in advance.

davy_yg started a new conversation File Upload • 1 month ago

Hello,

How to create a simple file upload with laravel? I would like to upload *.docx and *.pdf file any clue?

davy_yg left a reply on Sending Email • 1 month ago

NotFoundHttpException in Controller.php line 269: Controller method not found.

I added the ; already.

<form action="{{ action([email protected]') }}"> 
                                
                                <div style="text-align: left;clear: both;margin-top: 20px;">
                                <input required type="checkbox" style="clear: both;width: 20px;height: 20px;float: left;"/> subscribe newsletter</a></span>
                                </div>

                                <div style="text-align: left;clear: both;margin-top: 20px;">
                                
                                <span class="col1"><input type="text" width="5px" name="account" required 
                                placeholder="email address"/></span>
                                <br><div class="" style="float: left">
                                   <button type="submit" id="btn_submit" class="btn btn-green">Submit</button>
                                </div><br><br>
                                </div>
                                                                    
                        </form>  

20th May, 2017

davy_yg left a reply on Parse Error • 1 month ago

Why not like this: ?

19th May, 2017

davy_yg left a reply on Parse Error • 1 month ago

I change it back - why the error still appears?

davy_yg started a new conversation Creating Form • 1 month ago

 <tr><td>No rek</td></tr>{ !! Form::text('no_rekening', null, ['class'->'form_control']) !!}</td></tr>

Why would you create a form like that?

And where do you get that ['class'->'form_control'], bootstrap?

I need to read someone else code it's from Tutorial CD that I need more explaination

davy_yg left a reply on Parse Error • 1 month ago

I still receiving similar error:

ErrorException in e3ef7569646835f073ab7b701f16ab2a line 151: Parse error: syntax error, unexpected '@', expecting ',' or ')' (View: C:\xampp\htdocs\framework_freshway\framework\resources\views\soulfy\setting.blade.php)

<div class="form-body">
                        <div class="setting-box">
                        <div style="background-color: green; align: left;">
                        <form action="{{ route([email protected]) }}"> 
                                
                                <div style="text-align: left;clear: both;margin-top: 20px;">
                                <input required type="checkbox" style="clear: both;width: 20px;height: 20px;float: left;"/> subscribe newsletter</a></span>
                                </div>

                                <div style="text-align: left;clear: both;margin-top: 20px;">
                                
                                <span class="col1"><input type="text" width="5px" name="account" required 
                                placeholder="email address"/></span>
                                <br><div class="" style="float: left">
                                   <button type="submit" id="btn_submit" class="btn btn-green">Submit</button>
                                </div><br><br>
                                </div>
                                
                                
                        </form>         
                        </div>
                        </div>  

18th May, 2017

davy_yg started a new conversation Syntax • 1 month ago

{!! Form:open(array('url' => 'nasabah')) !!}

Anyone knows what the !! is for? I thought laravel use it to comment out a syntax. Is that right?

davy_yg left a reply on Parse Error • 1 month ago

Even if I take of the comment out it still having the same error message. Am I writing the correct syntax?

davy_yg started a new conversation Parse Error • 1 month ago

I get this error message:

ErrorException in e3ef7569646835f073ab7b701f16ab2a line 151: Parse error: syntax error, unexpected '@', expecting ',' or ')' (View: C:\xampp\htdocs\framework_freshway\framework\resources\views\soulfy\setting.blade.php)

I already comment out the form action and still receive the error message. I wonder why? Parse 151 is <form action= ...

setting.blade.php

<div class="form-body">
                        <div class="setting-box">
                        <div style="background-color: green; align: left;">
                       <!-- <form action="{{ [email protected]}}"> -->
                                
                                <div style="text-align: left;clear: both;margin-top: 20px;">
                                <input required type="checkbox" style="clear: both;width: 20px;height: 20px;float: left;"/> subscribe newsletter</a></span>
                                </div>

                                <div style="text-align: left;clear: both;margin-top: 20px;">
                                
                                <span class="col1"><input type="text" width="5px" name="account" required 
                                placeholder="email address"/></span>
                                <br><div class="" style="float: left">
                                   <button type="submit" id="btn_submit" class="btn btn-green">Submit</button>
                                </div><br><br>
                                </div>
                                
                                
                        <!-- </form> -->        
                        </div>
                        </div>  
                    </div> 

davy_yg left a reply on Flash Notification Error • 1 month ago

I still get this error message:

ErrorException in FileViewFinder.php line 137: View [layouts._flash] not found. (View: C:\xampp\htdocs\framework_freshway\framework\resources\views\soulfy\articles.blade.php)

Line 137 is in between @yield('content') and @if there is this missing code.

davy_yg started a new conversation Flash Notification Error • 1 month ago

View [layouts._flash] not found. (View: C:\xampp\htdocs\framework_freshway\framework\resources\views\soulfy\articles.blade.php)

articles.blade.php

@include('layouts._flash')
@yield('content')

@if (session()->has('flash_notification.message'))
                        <div class="container">
                        <div class="alert alert-{{ session()->get('flash_notification.level') }}">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>

                            {!!  session()->get('flash_notification.message') !!}
                        </div>
                        </div>
                    @endif

HomeController.php

 public function showSeo(Request $request)
{

    Session::flash("flash_notification", [
        "level"=>"success",
        "message"=>"Berhasil menyimpan seo baru"
    ]);
    
    return redirect()->back();

}

routes.php

Route::get('/home/article', [email protected]');

davy_yg left a reply on Capturing Form • 1 month ago

It mentions that I already have these:

 namespace Soulfy\Http\Controllers;

 use Soulfy\Http\Controllers\Controller;

So that I cannot add another one.

davy_yg left a reply on Sending Email • 1 month ago

FatalThrowableError in SettingController.php line 234: Parse error: syntax error, unexpected 'Mail' (T_STRING)

Line 234:

Mail::send('emails.send', ['title' => $title, 'content' => $content], function ($message)

davy_yg left a reply on Sending Email • 1 month ago

I edit it like this:

public function postNewsletter(Request $request)
{

    $title = "newsletter subscriber";

    $content = "This is a new newsletter subscriber."

    //$title = $request->input('title');
    //$content = $request->input('content');
    
    //Grab uploaded file
    //$attach = $request->file('file');

    Mail::send('emails.send', ['title' => $title, 'content' => $content], function ($message) //use ($attach)
    {

        $message->from([email protected]', 'Admin');

        $message->to([email protected]');

        //Attach file
        //$message->attach($attach);

        //Add a subject
        $message->subject("Newsletter new subscriber");

    });

}       

Will it works?

davy_yg started a new conversation Sending Email • 1 month ago

Hello,

In here I am trying to send email notification for newsletter subscriber. Please correct me if I write down the controller incorrectly.

public function postNewsletter(Request $request)
{


    $message = "Dear Admin,  There is a new newsletter subsciber please takes notes of this email address:  email";

$user = [email protected];

    Mail::to($request->user())
            ->queue($message);

}

Thanks in advance.

davy_yg left a reply on Capturing Form • 1 month ago

I already did. If I run the form I get this error message:

NotFoundHttpException in Controller.php line 269: Controller method not found.

davy_yg left a reply on Capturing Form • 1 month ago

This is my newest one:

controllers/HomeController.php

<table width="350px">
          <form action="{{action([email protected]')}}" method="post">
                                                {{ csrf_field() }}      
                                                                    <tr>
            <td>Meta Title</td>
              <td><input type="text" value="" name="meta_title"></td>
        </tr>
        <tr>
            <td>Meta Keyword</td>
            <td><input type="text" value="" name="meta_keyword"></td>
        </tr>
        <tr>
            <td>Meta Description</td>
            <td><input type="text" value="" name="meta_description"></td>
            </tr>
            <tr>
                <td><br><br><input type="submit" value="update"></td>
                    <td></td>
             </tr>
</form>
</table>

17th May, 2017

davy_yg left a reply on Capturing Form • 1 month ago

1/1 FatalThrowableError in HomeController.php line 634: Fatal error: Class 'Soulfy\Http\Controllers\DB' not found

Line 634: DB::table('meta')->where('meta_id', '1') ->update($data);

16th May, 2017

davy_yg started a new conversation Storing Geo Location • 1 month ago

How to modify the following codes so that I can saves data in geo location?

views/articles.blade.php

<div class="backend-form edit-article-form" style="display:none;">
                            <div class="form-top">
                                    <div class="form-left">
                                        <h4>Edit Article</h4>
                                    </div>
                                    <div class="form-right">
                                        <a href="#" class="btn-save-edit-article setting_save"></a>
                                        <a href="#" class="btn-cancel-article setting_cancel"></a>
                                    </div>
                                </div>
                                <div class="form-body" style="height: 460px; width: 400px;">
                                    <div class="form-group">
                                    <input type="hidden" id="id-edit" class="id-edit">
                                        <span>Tittle</span>:<input type="text" name="tittle" id="tittle-edit" class="tittle-edit"/>
                                        
                                    </div>
                                    <div class="form-group">
                                        Geo Location: (ex. Jakarta )<input type="text" rows="40">

                                    </div>       
                                    <div class="form-group">
                                        <span>Content</span>
                                    </div>  
                                                <textarea rows="20" cols="6" maxlength="1000" id="content-edit" class="content-edit"></textarea>

                                         
                                </div>       
                                </div>



$(".btn-save-edit-article").click(function(e){
        e.preventDefault();
        var id_edit = $("#id-edit").val(),
        tittle_edit = $("#tittle-edit").val(),
        content_edit = $("#content-edit").val();
        $.ajax({
            method: "POST",
            url: '{{action("[email protected]")}}',
            data: { id : id_edit, tittle : tittle_edit, content : content_edit, },
            success: function (response) {
                
                pesanOk("Article updated");
               setTimeout(function(){location.reload()},1000);
            },
        })


    });

public function postUpdateArticle(Request $request) { $user = Auth::User(); if ($user) { $domain = $_SERVER['SERVER_NAME']; $user = User::where('domain', $domain)->first();

        $id = $request->input("id");
        $tittle = $request->input("tittle");
        $content = $request->input("content");
        date_default_timezone_set("Asia/Jakarta");
        $article = Timeline::where('user_id', $user['id'])->where('id', $id)->first();
        $article->tittle = $tittle;
        $article->content = $content;
        $article->updated_at = date("Y-m-d H:i:s");

        $act = $article->save();
        if ($act) {
            $message = "success";
        } else {
            $message = "error";
        }
        echo json_encode($message);
    }
}


public function postUpdateArticle(Request $request)
{
    $user = Auth::User();
    if ($user) {
        $domain = $_SERVER['SERVER_NAME'];
        $user = User::where('domain', $domain)->first();

        $id = $request->input("id");
        $tittle = $request->input("tittle");
        $content = $request->input("content");
        date_default_timezone_set("Asia/Jakarta");
        $article = Timeline::where('user_id', $user['id'])->where('id', $id)->first();
        $article->tittle = $tittle;
        $article->content = $content;
        $article->updated_at = date("Y-m-d H:i:s");

        $act = $article->save();
        if ($act) {
            $message = "success";
        } else {
            $message = "error";
        }
        echo json_encode($message);
    }
}

davy_yg left a reply on Capturing Form • 1 month ago

How to tell if a table has eloquent model or not?

My meta table consist of: meta_id meta_title meta_keyword meta_description

15th May, 2017

davy_yg started a new conversation Capturing Form • 1 month ago

Hello,

How to capture form value and save them in the database?

articles.blade.php

  <table width="350px">
             <form action="seo" method="post">  
    <tr>
    <td>Meta Title</td>
    <td><input type="text" value="" name="meta_title"></td>
    </tr>
            <tr>
            <td>Meta Keyword</td>
            <td><input type="text" value="" name="meta_title"></td>
            </tr>
            <tr>
            <td>Meta Description</td>
            <td><input type="text" value="" name="meta_title"></td>
            </tr>
            <tr>
            <td><br><br><input type="submit" value="update"></td>
            <td></td>
            </tr>
    </form>
</table>
                                        

Controllers/HomeController.php

 public function postSeo(Request $request)
   {
   
    
    }
                                                                                 I do not know what to place in the postSEO function so that the form capture new data and save it in the database and replace old data?                                                                

13th May, 2017

davy_yg left a reply on How To Make Site Works Both On Www And Site.com • 1 month ago

I type: http://fresway.com/

It still remains. Also I would like the one with www works not only non-www. The error still remains if I type www.fresway.com.

 <IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

#Force www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]

    </IfModule>

davy_yg left a reply on Parse Error: Syntax Error, Unexpected 'home' (T_STRING) • 1 month ago

Sorry this is the actual codes:

     @if($uri=="home/video" || $uri=="home/email" || $uri=="home/bussinesscard" || $uri=="home/articles || $uri=="home/gallery")
                                
                                @if($uri=="home/gallery")

                                <div id="circle1"><div style="margin: 5px 0 0 0; "><img src="{{url("")}}/images/add/icons12.png" width="40px" /></div></div>

                                @elseif($uri=="home/video" || $uri=="home/email" ||   $uri=="home/bussinesscard" || $uri=="home/articles")
                                    <!--<img src="{{url("")}}/images/button-12.png"/>-->
                                <div id="circle1"><div style="margin: 0 0 0 0; "><img src="{{url("")}}/images/add/icons12.png" width="40px" /></div></div>
                                
                                @endif
                                </a></label>

                        @else
                            <!-- <img src="{{url("")}}/images/button-12-hover.png"/> -->
                            <div id="circle1"><div style="margin: -2px 0 0 -7px; "><img src="{{url("")}}/images/add/icons12-hover.png" width="40px"/></div></div>
                            </a></label>
                            @endif
                            </a>
                            </label>
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.