davy_yg

Experience

15,870

0 Best Reply Awards

  • Member Since 4 Months Ago
  • 94 Lessons Completed
  • 0 Favorites

18th August, 2017

davy_yg started a new conversation Counting Checked Items • 2 days ago

Hello,

I have stock photos for sell and the user can check the photo they want to purchase:

        <form
                                        action="{{ action([email protected]') }}"
                                        method="post"
                                    >
                                    {{ csrf_field() }}

                                    <table>
                                    
                                        @foreach ($themes->chunk(3) as $chunk)
                                            <tr> 
                                            
                                            @foreach ($chunk as $theme)
                                                <td>
                                                    
                                                    <a href="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg" data-lightbox="image-gallery" data-title="{{$theme->pic_name}}" >
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg"/></a> 
                                                    <input type="checkbox" name="pic[{{$theme->pic_name}}]" value="{{$theme->pic_name}}"/>

                                                </td> 
                                            @endforeach
                                            </tr>
                                            
                                        @endforeach


                                    </table>

                                    @if ( $themes->lastPage() == 0) <br><br><br><br> @endif 

                                    @if ( $themes->currentPage() != 1)
                                    <a href="{!! $themes->previousPageUrl() !!}"> << </a>@endif

                                    {!! $themes->currentPage() !!} of {!! $themes->lastPage() !!}

                                     @if ( $themes->currentPage() !=  $themes->lastPage())
                                    <a href="{!! $themes->nextPageUrl() !!}"> >> </a>@endif

                                    
                                    <br><br><input style="width: 15px; margin-bottom: -10px; position: relative;" type="checkbox" required name="chkbox_agreement" value="Terms & Agreement"/>&nbsp;&nbsp;&nbsp;
                                    <a href="#myModal" data-backdrop="false" data-toggle="modal">Terms & Agreement</a>                                      
                                    <div id="myModal" class="modal fade">
                                        <div class="modal-dialog">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5>Terms & Agreement</h5>
                                                </div>
                                                <div class="modal-body">
                                                    By clicking Purchase you agree to the Term and Conditions.
                                                    
                                                </div>
                                                <div class="modal-footer">
                                                     <button type="button" class="btn btn-default" data-dismiss="modal">Agree</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div><br><br><br>  

                                    <input type="submit" value="Purchase" id="notification">    
                                    </form>

Now, how to print out the price calculation from the checked items? It should printed below the purchase buttons.

17th August, 2017

davy_yg started a new conversation Opening The Instagram Page • 3 days ago

Hello,

Please check my codes:

I would like if the user is login and click the circle it will bring the user to instagram2.blade.php, if not login then it will open the web owner instagram page.

home.blade.php

    <li>
                        <input id="c7" type="checkbox">
                        <label for="c7">
                        
                        <a href="{{action([email protected]')}}" data-tipe="skype" data-content="" data-target="#content_desc">

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

HomeController.php

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

    $galleries = Timeline::where('user_id', $user->id)->where('social', 'youtube')->orderBy('created_at', 'desc')->get();
    
    // return www.instagram.com/davy_yg;

    return view('soulfy.instagram2', ['user' => $user, 'galleries' => $galleries]);
}

8th August, 2017

davy_yg left a reply on Creating Notification • 1 week ago

I still do not understand. How to write the data:

    data : {
            
        },

davy_yg started a new conversation Creating Notification • 1 week ago

setting.blade.php

<form action="{{ action([email protected]') }}"
                                        method="post"
                                    >
                                    {{ csrf_field() }}

                                    <table>
                                    
                                        @foreach ($themes->chunk(3) as $chunk)
                                            <tr> 
                                            
                                            @foreach ($chunk as $theme)
                                                <td>
                                                    
                                                    <a href="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg" data-lightbox="image-gallery" data-title="{{$theme->pic_name}}" >
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg"/></a> 
                                                    <input type="checkbox" name="pic[{{$theme->pic_name}}]" value="{{$theme->pic_name}}"/>

                                                </td> 
                                            @endforeach
                                            </tr>
                                            
                                        @endforeach


                                    </table>

                                    @if ( $themes->lastPage() == 0) <br><br><br><br> @endif 

                                    @if ( $themes->currentPage() != 1)
                                    <a href="{!! $themes->previousPageUrl() !!}"> << </a>@endif

                                    {!! $themes->currentPage() !!} of {!! $themes->lastPage() !!}

                                     @if ( $themes->currentPage() !=  $themes->lastPage())
                                    <a href="{!! $themes->nextPageUrl() !!}"> >> </a>@endif

                                    
                                    <br><br><input style="width: 15px; margin-bottom: -10px; position: relative;" type="checkbox" required name="chkbox_agreement" value="Terms & Agreement"/>&nbsp;&nbsp;&nbsp;
                                    <a href="#myModal" data-backdrop="false" data-toggle="modal">Terms & Agreement</a>                                      
                                    <div id="myModal" class="modal fade">
                                        <div class="modal-dialog">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5>Terms & Agreement</h5>
                                                </div>
                                                <div class="modal-body">
                                                    By clicking Purchase you agree to the Term and Conditions.
                                                    
                                                </div>
                                                <div class="modal-footer">
                                                     <button type="button" class="btn btn-default" data-dismiss="modal">Agree</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div><br><br><br>  

                                    <input type="submit" value="Purchase" id="notification">    
                                    </form>

     ....

    <script>

     $("#notification").click(function(e){
            

            $.ajax({
            method: "POST",
            url: '{{action("[email protected]")}}',
            data : {
                
            },

            success: function (response) {
                
                    pesanOk("Thank you. We will process your request. Please check your email.");
                    setTimeout(function(){location.reload()},1000);
                },  
                error:function()
                {
                    pesanErr("failed");
                };
            })

            return false;
        });

     </script>

I simply trying to create a pop up notification on press Purchase button. but the pop does not appears. How to make it appearing?

7th August, 2017

davy_yg started a new conversation Login Needs F5 / Refresh Before Login • 1 week ago

Hello,

I wonder why I need to press F5 before entering the admin page after login.

home_admin.blade.php

    <form class="navbar-form navbar-right" id="form_login" method="post" style="margin-top: 0;"
                      action="{{ url('/auth/login') }}">
                    <input type="hidden" id="_token" name="_token" value="{{ csrf_token() }}">

                    <div class="form-group">
                        <span class="control-header">Email</span>
                        <span><input type="text" name="email" placeholder="Email" required
                                     class="form-control"/></span>
                    </div>
                    <div class="form-group">
                        <span class="control-header">Password</span>
                        <span><input type="password" name="password" placeholder="Password" required
                                     class="form-control"/></span>
                        <input type="hidden" name="domain" required value="{{$domain}}"/>
                    </div>
                    <div class="form-group">
                        <h3 style="margin-top: 2px;">
                            <button type="submit" id="btn_login"><span class="glyphicon glyphicon-log-in"
                                                                       aria-hidden="true"></span> login
                            </button>
                        </h3>
                    </div>
                    <br>
                    <a href="#" data-toggle="modal" data-target="#forgot_password"
                       style="margin-top: -7px;float: right;margin-right: 90px;font-size: 10px;color: white;">Forgot
                        Password?</a>
                </form>

routes.php

Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
'home'=>'HomeController',
'member'=>'MemberController',
'mail'=>'MailController',
'social'=>'SocialController',
'ajax'=>'AjaxController',
'api'=>'ApiController',
'timeline'=>'TimelineController',
'setting'=>'SettingController',
 //    'ecommerce'=>'EcommerceController',
'test'=>'TestController',
 ]);

AuthController.php

class AuthController extends Controller
{
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/

use AuthenticatesAndRegistersUsers, ThrottlesLogins;

/**
 * Create a new authentication controller instance.
 *
 * @return void
 */
public function __construct()
{
    $this->middleware('guest', ['except' => 'getLogout']);
}

/**
 * Get a validator for an incoming registration request.
 *
 * @param  array  $data
 * @return \Illuminate\Contracts\Validation\Validator
 */
protected function validator(array $data)
{
    return Validator::make($data, [
        'name' => 'required|max:255',
        'email' => 'required|email|max:255|unique:users',
        'password' => 'required|confirmed|min:6',
    ]);
}

/**
 * Create a new user instance after a valid registration.
 *
 * @param  array  $data
 * @return User
 */
protected function create(array $data)
{
    return User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => bcrypt($data['password']),
    ]);
}
}

PasswordController.php

class PasswordController extends Controller

{ /* |-------------------------------------------------------------------------- | Password Reset Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password reset requests | and uses a simple trait to include this behavior. You're free to | explore this trait and override any methods you wish to tweak. | */

use ResetsPasswords;

/**
 * Create a new password controller instance.
 *
 * @return void
 */
public function __construct()
{
    $this->middleware('guest');
}

}

I also wonder if it's using javascript since I cannot find the form_login (id="form_login") anywhere in the file.

4th August, 2017

davy_yg left a reply on Browse The Next Page • 2 weeks ago

Thanks it finally works. I change all of them to get and use action for the script instead of the url.

So on using paging - I have to use only GET to make it works.

davy_yg left a reply on Browse The Next Page • 2 weeks ago

I already try changing the

getBackgroundTheme form, route, and controller to get. I also try changing it form, route, and controller to post. Both of them get the following error message:

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

3rd August, 2017

davy_yg left a reply on Checkbox • 2 weeks ago

Setting.blade.php

  <br><br><input style="width: 15px; margin-top: -10px; position: absolute;" type="checkbox" name="chkbox_agreement" value="Terms & Agreement"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <a href="#myModal" data-backdrop="false" data-toggle="modal">Terms & Agreement  

SettingController.php

 public function SendPicture(Request $request)
{

    $validator = Validator::make($request->all(), [
            'chkbox_agreement' => 'accepted',
    ]);


    if ($validator)
    {

// send email to buyer and seller

}
else
{

echo "Please checked the agreement checkbox";

}

}

davy_yg left a reply on Browse The Next Page • 2 weeks ago

I gives you the important route which related to home/theme

The rest of the routes are not related except for home/setting

The paging that's related to home/theme does not work, the one that's related to home/setting works well - I wonder why?

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

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

  Route::post('/home/setting', [email protected]');

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

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

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

 Route::post('/home/sendpic', [email protected]');

 Route::post('/home/theme', [email protected]');

 Route::post('/home/bgprofile', [email protected]');

  Route::post('/home/upbprofile', [email protected]');

  Route::post('/home/deletebgprofile/{id}', ['uses' => [email protected]']);


   Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
'home'=>'HomeController',
'member'=>'MemberController',
'mail'=>'MailController',
'social'=>'SocialController',
'ajax'=>'AjaxController',
'api'=>'ApiController',
'timeline'=>'TimelineController',
'setting'=>'SettingController',

// 'ecommerce'=>'EcommerceController', 'test'=>'TestController', ]);

davy_yg started a new conversation Checkbox • 2 weeks ago

How to write:

If agreement checkbox is checked then { do this else { Please check the agreement }

in laravel?

davy_yg left a reply on Browse The Next Page • 2 weeks ago

routes.php

   Route::post('/home/theme', [email protected]');

davy_yg left a reply on Browse The Next Page • 2 weeks ago

Still:

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

if I press the next page:

(http://localhost/soulfy_repo/public_html/home/theme?page=2)

davy_yg left a reply on Browse The Next Page • 2 weeks ago

I get this error on the first page:

TokenMismatchException in VerifyCsrfToken.php line 53:

If I put ->first(); or get();

davy_yg left a reply on Browse The Next Page • 2 weeks ago

I still have the same error message as above:

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

Trying to access: >> http://localhost/soulfy_repo/public_html/home/theme?page=2

 use Illuminate\Http\Request;

 ....

 public function getBackgroundTheme(Request $request)
 {

            // background for sell
    $query = DB::table('theme_background');

    if ($request->menu) {
        $theme = DB::table('kategori_name')->where('kategori_theme', $request->menu)->first();

        $query = $query->where('kategori_id', $theme->kategori_id);
    } 

    $themes = $query->paginate(6);
    
    $domain = $_SERVER['SERVER_NAME'];
    $user = User::where('domain', $domain)->first();

    return view('soulfy.setting', [
        'themes'=> $themes,
        'user' => $user,                        
    ]);
  }

davy_yg started a new conversation Browse The Next Page • 2 weeks ago

Hello,

I am having trouble while trying to browse the next page.

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

  <form action="{{URL::to('/home/theme')}}" method="post"> 
                                    <span class="setting-name">THEME</span>

                                    <!-- <form method="POST" action="/posts"> -->
                                    {{ csrf_field() }}  
                                    <span class="setting-value center">

                                    <select name="menu">
                                        <option value="">All</option>
                                        <option value="Handicraft">Handicraft</option>
                                        <option value="Farming">Farming</option>
                                        <option value="Services">Services</option>
                                        <option value="Tour & Travel">Tour & Travel</option>
                                        <option value="Trading">Trading</option>
                                        <option value="Fishery">Fishery</option>
                                        <option value="Lifestyle">Lifestyle</option>
                                        <option value="Music">Music</option>
                                        <option value="Property">Property</option>
                                        <option value="Hobby">Hobby</option>
                                        <option value="Politic">Politic</option>
                                    </select>


                                    <input type="submit" value="Submit">                                        
                                    <br><br>

                                    </span>
                                    </form>
                                    
                                    <form action="{{ action([email protected]') }}" method="post">
                                    {{ csrf_field() }}

                                    <table>
                                    
                                        @foreach ($themes->chunk(3) as $chunk)
                                            <tr> 
                                            
                                            @foreach ($chunk as $theme)
                                                <td>
                                                    
                                                    <a href="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg" data-lightbox="image-gallery" data-title="{{$theme->pic_name}}" >
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg"/></a> 
                                                    <input type="checkbox" name="pic[{{$theme->pic_name}}]" value="{{$theme->pic_name}}"/>

                                                    
                                                </td> 
                                            @endforeach
                                            </tr> 
                                            
                                        @endforeach


                                    </table>

                                    @if ( $themes->currentPage() != 1)
                                    <a href="{!! $themes->previousPageUrl() !!}"> << </a>@endif

                                    {!! $themes->currentPage() !!} of {!! $themes->lastPage() !!}

                                     @if ( $themes->currentPage() !=  $themes->lastPage())
                                    <a href="{!! $themes->nextPageUrl() !!}"> >> </a>@endif
                                            
                                                                            
                                    <input type="submit" value="Purchase">  
                                    </form>

SettingController.php

  public function getBackgroundTheme()
  {

    // background for sell
    $query = DB::table('theme_background');

    if (request('menu')) {
        $theme = DB::table('kategori_name')->where('kategori_theme', request('menu'))->first();

        $query = $query->where('kategori_id', $theme->kategori_id);
    } 

    $themes = $query->paginate(6);

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


    return view('soulfy.setting', [
        'themes'=> $themes,
        'user' => $user,            
    ]);
   }

I wonder what's wrong?

2nd August, 2017

davy_yg left a reply on Class 'Soulfy\Http\Controllers\user_bgprofile' Not Found • 2 weeks ago

How to import it?

I use this:

use Soulfy\UserbgProfile;

davy_yg started a new conversation 1/1 TokenMismatchException In VerifyCsrfToken.php Line 53: • 2 weeks ago

Hello,

I am receiving this error message while trying to delete an image of background profile:

1/1 TokenMismatchException in VerifyCsrfToken.php line 53:

     <table>
                                    <!-- <div class="container">
                                    <div class="row"> -->

                                    @if(isset($bgprofiles))
                                        
                                        @foreach (collect($bgprofiles)->chunk(3) as $chunk)
                                            <tr>                                                    
                                            @foreach ($chunk as $bgprofiles)
                                                <td style="padding: 8px;">
                                                    
                                                    <!-- <div class="col-sm-4"> -->
                                                    <a href="{{url('/')}}/uploads/bgprofile/{{$bgprofiles->bgprofile}}.jpg" data-lightbox="image-gallery" data-title="{{$bgprofiles->bgprofile}}" >
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/bgprofile/{{$bgprofiles->bgprofile}}.jpg"/></a><br> 
                                                    <input type="radio" style="width: 70px;" name="background" value="{{$bgprofiles->bgprofile}}">

                                                        <form method="post" action="{{ Url('home/deletebgprofile/'. $bgprofiles->pic_id) }}">
                                                        <input type="hidden" name="_token" value="<?php echo csrf_token() ?>">
                                                        <input type="image" src="{{url('/')}}/images/cross.jpg" alt="Submit" style="width:35px; height:20px;">
                                                        </form>                                                             

                                                </td>                                                   
                                            @endforeach                                                 
                                            </tr>
                                        @endforeach


                                    @endif
                                    <!-- </div>  
                                    </div> -->
                                    </table>

davy_yg started a new conversation Class 'Soulfy\Http\Controllers\user_bgprofile' Not Found • 2 weeks ago

How to fix this error message:

Class 'Soulfy\Http\Controllers\user_bgprofile' not found

I already define the model:

   use Soulfy\UserbgProfile;

UserbgProfile.php

  <?php

  namespace Soulfy;

  use Illuminate\Database\Eloquent\Model;

 class UserbgProfile extends Model
{
//
protected $table = "user_bgprofile";
 }

1st August, 2017

davy_yg started a new conversation Upload File With Pop Up • 2 weeks ago

Setting.blade.php

<div id="myModal" class="modal fade">
 <div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
             <h4 class="modal-title">Please input a new background</h4>

        </div>
        <form action="{{ action([email protected]') }}" method="post">
        <div class="modal-body">                        
            <input type="file" name="b_pic">
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary">Upload Image</button> 
        </div>
        </form>
    </div>
    <!-- /.modal-content -->
 </div>
 <!-- /.modal-dialog -->
</div>

Controllers/SettingController.php

public function UploadBackgroundProfile(Request $request) {

    $b_pic = $request->file('b_pic');
    
    if($b_pic != NULL)
        $b_pic->move('uploads/bgprofile', $b_pic->getClientOriginalName());

    if($b_pic != NULL)
    {   
        // simpan yg baru
        $model->bgprofile = $b_pic->getClientOriginalName();
    }

    $model->save();

    return view('soulfy.setting');
}

Hello,

on press upload image I am hoping that the selected image being copy to the selected folder. But it does not, I wonder why?

28th July, 2017

davy_yg left a reply on Boostrap • 3 weeks ago

Should I write a number next to foreach:

    <?php foreach ([1, 2, 3, 4, 5, 6, 7, 8, 9] as $value): ?>

The picture will be many up to 5000 pcs.

27th July, 2017

davy_yg left a reply on Boostrap • 3 weeks ago

The picture still 3 in row and it goes to the next page after 3 in row evenif I am using responsive design mode screen for handphone.

It suppose to change into 2 in row if I am using handphone screen.

I tested it with firefox, responsive design mode screen.

davy_yg started a new conversation Boostrap • 3 weeks ago

Hello,

I am trying to make the bootstrap work but it doesn't. Any clue?

       <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
               <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
            .....
               <form action="{{ action([email protected]') }}" method="post">
                                    {{ csrf_field() }}

                                    <table>
                                    <div class="container">
                                     <div class="row">

                                    @if(isset($bgprofiles)) {   

                                        @foreach ($bgprofiles->chunk(3) as $chunk)
                                            <tr>
                                            @foreach ($chunk as $bgprofiles)
                                                <td>
                                                    <div class="col-sm-4">

                                                    <a href="{{url('/')}}/uploads/bgprofile/{{$bgprofiles->bgprofile}}.jpg" data-lightbox="image-gallery" data-title="{{$bgprofiles->bgprofile}}" >
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/bgprofile/{{$bgprofiles->bgprofile}}.jpg"/></a> 
                                                    <input type="checkbox" name="pic[{{$bgprofiles->bgprofile}}]" value="{{$bgprofiles->bgprofile}}"/>
                                                    
                                                    </div>
                                                </td>
                                            @endforeach
                                            </tr>
                                        @endforeach

                                        }

                                    @endif
                                    </div>  
                                    </div>
                                    </table>

                                                                                                            
                                    
                                    </form>
                    

davy_yg left a reply on $bgprofile Is Undefine • 3 weeks ago

ErrorException in 1e886a45102a3e4898f23b52cd7ca771 line 41: Undefined variable: bgprofiles (View: C:\xampp\htdocs\soulfy_repo\framework\resources\views\soulfy\setting.blade.php)

line41:

davy_yg left a reply on $bgprofile Is Undefine • 3 weeks ago

ErrorException in 1e886a45102a3e4898f23b52cd7ca771 line 421: Undefined variable: bgprofile (View: C:\xampp\htdocs\soulfy_repo\framework\resources\views\soulfy\setting.blade.php)

view/setting.blade.php

     <form action="{{ action([email protected]') }}" method="post">
                                    {{ csrf_field() }}

                                    <table>
                                    
                                        @foreach ($bgprofile->chunk(3) as $chunk)
                                            <tr>
                                            @foreach ($chunk as $bgprofile)
                                                <td>
                                                    <a href="{{url('/')}}/uploads/bgprofile/{{$bgprofile->bgprofile}}.jpg" data-lightbox="image-gallery" data-title="{{$bgprofile->bgprofile}}" >
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/bgprofile/{{$bgprofile->bgprofile}}.jpg"/></a> 
                                                    <input type="checkbox" name="pic[{{$bgprofile->bgprofile}}]" value="{{$bgprofile->bgprofile}}"/>
                                                </td>
                                            @endforeach
                                            </tr>
                                        @endforeach

                                        
                                    </table>

                                                                                                            
                                    
                                    </form>

Controllers/SettingController.php

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

    $bgprofile = DB::table('user_bgprofile')->where('user_id', $user->id)->get();    

    return view('soulfy.setting', [
            'bgprofile' => $bgprofile,
            'user' => $user,
        ]);
}

26th July, 2017

davy_yg left a reply on $bgprofile Is Undefine • 3 weeks ago

no I don't get the collection I am looking for. Also, how to write the route for this ?

davy_yg left a reply on $bgprofile Is Undefine • 3 weeks ago

Actually here is more bigger picture. I am using many controller in one page. Is that ok? I am still wonder why I still have $bgprofile undefine?

setting.blade.php

       <form action="{{URL::to('/home/theme')}}" method="post"> 
                                    <span class="setting-name">THEME</span>

                                    <!-- <form method="POST" action="/posts"> -->
                                    {{ csrf_field() }}  
                                    <span class="setting-value center">

                                    <select name="menu">
                                        <option value="">All</option>
                                        <option value="Handicraft">Handicraft</option>
                                        <option value="Farming">Farming</option>
                                        <option value="Services">Services</option>
                                        <option value="Tour & Travel">Tour & Travel</option>
                                        <option value="Trading">Trading</option>
                                        <option value="Fishery">Fishery</option>
                                        <option value="Lifestyle">Lifestyle</option>
                                        <option value="Music">Music</option>
                                        <option value="Property">Property</option>
                                        <option value="Hobby">Hobby</option>
                                        <option value="Politic">Politic</option>
                                    </select>


                                    <input type="submit" value="Submit">                                        
                                    <br><br>

                                    </span>
                                    </form>
                                    
                                    <form action="{{ action([email protected]') }}" method="post">
                                    {{ csrf_field() }}

                                    <table>
                                        @foreach ($themes->chunk(3) as $chunk)
                                            <tr>
                                            @foreach ($chunk as $theme)
                                                <td>
                                                    <a href="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg" data-lightbox="image-gallery" data-title="{{$theme->pic_name}}" >
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg"/></a> 
                                                    <input type="checkbox" name="pic[{{$theme->pic_name}}]" value="{{$theme->pic_name}}"/>
                                                </td>
                                            @endforeach
                                            </tr>
                                        @endforeach
                                    </table>

                                    @if ( $themes->currentPage() != 1)
                                    <a href="{!! $themes->previousPageUrl() !!}"> << </a>@endif

                                    {!! $themes->currentPage() !!} of {!! $themes->lastPage() !!}

                                     @if ( $themes->currentPage() !=  $themes->lastPage())
                                    <a href="{!! $themes->nextPageUrl() !!}"> >> </a>@endif
                                            
                                                                            
                                    <input type="submit" value="Purchase">  
                                    </form>


                                    <form action="{{ action([email protected]') }}" method="post">
                                    {{ csrf_field() }}

                                    <table>
                                    @if(isset($bgprofile)) {

                                        @foreach ($bgprofiles->chunk(3) as $chunk)
                                            <tr>
                                            @foreach ($chunk as $bgprofile)
                                                <td>
                                                    <a href="{{url('/')}}/uploads/bgprofile/{{$bgprofile->bgprofile}}.jpg" data-lightbox="image-gallery" data-title="{{$bgprofile->bgprofile}}" >
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/bgprofile/{{$bgprofile->bgprofile}}.jpg"/></a> 
                                                    <input type="checkbox" name="pic[{{$bgprofile->bgprofile}}]" value="{{$bgprofile->bgprofile}}"/>
                                                </td>
                                            @endforeach
                                            </tr>
                                        @endforeach

                                        }
                                    
                                    @endif 
                                    </table>

                                                                                                            
                                    
                                    </form>

davy_yg left a reply on $bgprofile Is Undefine • 3 weeks ago

I still get the error message without the isset:

Undefined variable: bgprofiles (View: C:\xampp\htdocs\soulfy_repo\framework\resources\views\soulfy\setting.blade.php)

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

    $bgprofiles = DB::table('user_bgprofile')->where('user_id', $user->id)->get();

    return view('soulfy.setting', [
            'bgprofiles' => $bgprofiles,
            'user' => $user,
        ]);
}

davy_yg started a new conversation $bgprofile Is Undefine • 3 weeks ago

I wonder why nothing appears. It looks like $bgprofile is undefine that's why I place the isset. How to make it define. I thought I already define. I also do not know where to dd(); it to check the variable since I am not quite sure if it go through the controller?

setting.blade.php

        <form action="{{ action([email protected]') }}" method="post">
                                    {{ csrf_field() }}

                                    <table>
                                    @if(isset($bgprofiles)) {

                                        @foreach ($bgprofiles->chunk(3) as $chunk)
                                            <tr>
                                            @foreach ($chunk as $bgprofile)
                                                <td>
                                                    <a href="{{url('/')}}/uploads/bgprofile/{{$bgprofile->bgprofile}}.jpg" data-lightbox="image-gallery" data-title="{{$bgprofile->bgprofile}}" >
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/bgprofile/{{$bgprofile->bgprofile}}.jpg"/></a> 
                                                    <input type="checkbox" name="pic[{{$bgprofile->bgprofile}}]" value="{{$bgprofile->bgprofile}}"/>
                                                </td>
                                            @endforeach
                                            </tr>
                                        @endforeach

                                        }
                                    
                                    @endif  
                                    </table>

                                                                                                            
                                    
                                    </form>

SettingController.php

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

    $bgprofiles = DB::table('user_bgprofile')->where('user_id', $user->id);

    return view('soulfy.setting', [
            'bgprofiles' => $bgprofiles,
            'user' => $user,
        ]);
}

25th July, 2017

davy_yg left a reply on Call To Undefined Function Illuminate\Support\random_bytes() • 3 weeks ago

The web host php version is 5.6 - I just have to wait a few day before I get it updated to php 7.0

Is there any other way to make it work without having to update to php 7?

davy_yg started a new conversation Call To Undefined Function Illuminate\Support\random_bytes() • 3 weeks ago

Hello,

I receive this error message:

FatalErrorException in Str.php line 243: Call to undefined function Illuminate\Support\random_bytes()

public static function randomBytes($length = 16) { return random_bytes($length); }

line 243: return random_bytes($length);

I do not understand what's wrong since a working version laravel offline that extract online. It does not work online though. I wonder why?

24th July, 2017

davy_yg started a new conversation Auth::user() • 3 weeks ago

Hello,

I am not sure that the Auth::user() gives me a correct value or the right user.

This one does :

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

Yet, it gives me error since it is in view. How to solves this problem?

<?php
$color = "000000";


if (Auth::user() != NULL) {
    $data = \DB::table('user_profile')->where('user_id', Auth::user()->id)->first();

    if ($data) $color = $data->menu_color;
} else {
    $data = \DB::table('users')->where('domain', $domain)->first();

    if ($data) {
        $id = $data->id;

        $data = \DB::table('user_profile')->where('user_id', $id)->first();

        if ($data) $color = $data->menu_color;
    }

}

davy_yg started a new conversation Can You Write Dd(); In The View ? • 3 weeks ago

Can you write dd(); in the view ? I wonder how to dump variable in view?

   <ul id="w1" class="navbar-nav pull-right nav">
            @if(Auth::check())

                {{ dd($user); }}
                <li>
                    <h4 class="welcome-txt">Welcome <i class="welcome-username">{{$user['full_name']}} !</i></h4>
                </li>

I get an error: {{ dd($user); }}

Parse error: syntax error, unexpected ';', expecting ',' or ')' (View: C:\xampp\htdocs\soulfy_repo\framework\resources\views\home.blade.php) (View: C:\xampp\htdocs\soulfy_repo\framework\resources\views\home.blade.php)

23rd July, 2017

davy_yg left a reply on Class 'Soulfy\Http\Controllers\User' Not Found • 3 weeks ago

It works with:

 use Soulfy\User;

davy_yg started a new conversation Class 'Soulfy\Http\Controllers\User' Not Found • 3 weeks ago

How to fix the following error?

FatalThrowableError in SettingController.php line 362: Class 'Soulfy\Http\Controllers\User' not found

line 362: $user = User::where('domain', $domain)->first();

davy_yg started a new conversation Auth()->user() • 3 weeks ago

What's the difference between:

   return view('soulfy.setting', [
        'themes'=> $themes,
        'user' => auth()->user(),
    ]);

and

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

return view('soulfy.setting', [
        'themes'=> $themes,
        'user' => $user,
    ]);

The code above works but not the code below.

davy_yg left a reply on Link Url • 3 weeks ago

I now using lightbox and it works. Thanks.

21st July, 2017

davy_yg started a new conversation Link Url • 4 weeks ago

How to write link if I place the file in the same location as my templete blade file ?

I try this:

    <link rel="stylesheet" href="css/colorbox.css" /> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="jquery.colorbox.js"></script> 

But the file still remain undetect. I wonder why?

davy_yg left a reply on Addressing The Person • 4 weeks ago

I finally figure it out:

 public function SendPicture(Request $request)
 {

    $title = "Picture Purchase";
    //$picture = $request->input('pic');
    $domain = $_SERVER['SERVER_NAME'];

    $query = DB::table('users')->where('domain', $domain)->first();

    $email = $query->contact_email;

    $content = "$email purchase your picture : ";
    
    foreach ($request->input('pic') as $key => $value) {

        $content .= "$value".".jpg ";
        
        }

davy_yg left a reply on Addressing The Person • 4 weeks ago

  public function SendPicture(Request $request)
  {

    $title = "Picture Purchase";
    
    $domain = $_SERVER['SERVER_NAME'];

    $email = DB::table('users')->where('domain', $domain)->get();

    $content = "$email purchase your picture : ";
    
    foreach ($request->input('pic') as $key => $value) {

        $content .= "$value".".jpg ";
        
        }

ErrorException in SettingController.php line 373: Array to string conversion

line 373: $content = "$email purchase your picture : ";

20th July, 2017

davy_yg left a reply on Addressing The Person • 4 weeks ago

Hello,

I don't think I have the user model. Here is my tables:

users

  1. id
  2. name
  3. username
  4. full_name
  5. email
  6. password
  7. domain
    
  8. user_cpanel
  9. address
  10. occupation 
    
  11. phone
    
  12. contact_email
    
  13. fax     
    
  14. website
    
  15. language    
    
  16. remember_token  
    
  17. image_profile   
    
  18. fb_profile_image
    
  19. background_image
    
  20. created_at  
    
  21. updated_at  
    
  22. facebook_user_id
    
  23. access_token    
    
  24. bisnis_link 
    

The order is on table. It simply directly email it to the seller without recording it.

I only think I have create something like:

 public function SendPicture(Request $request)
{

$title = "Picture Purchase";
$user = ....

$content = "$user purchase your picture : ";

I do not what to fill the blank with. How to retrieve the value of $domain based on the user login?

davy_yg started a new conversation Addressing The Person • 4 weeks ago

Hello,

This email system works except that it has not address the identity of the buyer. I have the table already. Yet, do not know how to pull the specific buyer data from the table. Any idea how to pull the data from the domain name or user()->auth() ?

I think I need to change the text someone to something else?

SettingController.php

 public function SendPicture(Request $request)
 {

    $title = "Picture Purchase";
    //$picture = $request->input('pic');

    $content = "Someone purchase your picture : ";
    
    foreach ($request->input('pic') as $key => $value) {

        $content .= "$value".".jpg ";
        
        }


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

        $message->from('davy.yg1@gmail.com', 'Admin');

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

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

        //Add a subject
        $message->subject("Picture Purchase");

    });

    return redirect('home/setting');

}

davy_yg left a reply on Checkboxes • 1 month ago

using "", it actually prints out the instead of showing t a real spacing.

Without it - it shows an error of "<"

davy_yg left a reply on Checkboxes • 1 month ago

It almost works. Now, I am confuse how to create the space.

   $content = "Someone purchase your picture".<br><br>;
    
    foreach ($request->input('pic') as $key => $value) {

        $content .= "$key : $value".<br>;
        
        }

Parse error: syntax error, unexpected '<'

Line 371: $content = "Someone purchase your picture".;

19th July, 2017

davy_yg left a reply on Checkboxes • 1 month ago

ErrorException in SettingController.php line 371: Array to string conversion

setting.blade.php

   <table>
                                        @foreach ($themes->chunk(3) as $chunk)
                                            <tr>
                                            @foreach ($chunk as $theme)
                                                <td>
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg"/> 
                                                    <input type="checkbox" name="pic[{{$theme->pic_name}}]" value="{{$theme->pic_name}}"/>
                                                </td>
                                            @endforeach
                                            </tr>
                                        @endforeach
                                    </table>

SettingController.php

 public function SendPicture(Request $request)
  {

    $title = "Picture Purchase";
    $picture = $request->input('pic');

    
    $content = "Someone purchase your picture: $picture .jpg";
    
    foreach ($request->input('pic') as $key => $value) {

        $content .= "$key : $value";
        
        }

Line 371: $content = "Someone purchase your picture: $picture .jpg";

davy_yg left a reply on Checkboxes • 1 month ago

ErrorException in SettingController.php line 373: Invalid argument supplied for foreach()

line 373: foreach ($request->input('pic') as $key => $value) {

SettingController.php

   $content = "Someone purchase your picture: $picture .jpg";
    
    foreach ($request->input('pic') as $key => $value) {

        $content .= "$key : $value";
        
        }

Setting.blade.php

     <table>
                                        @foreach ($themes->chunk(3) as $chunk)
                                            <tr>
                                            @foreach ($chunk as $theme)
                                                <td>
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg"/> 
                                                    <input type="checkbox" name="pic[{{$theme->pic_name}}]" value="{{$theme->pic_name}}"/>
                                                </td>
                                            @endforeach
                                            </tr>
                                        @endforeach
                                    </table>

davy_yg left a reply on Checkboxes • 1 month ago

ErrorException in SettingController.php line 373: Invalid argument supplied for foreach()

davy_yg left a reply on Checkboxes • 1 month ago

I don't think it works. I expect the whole content being recorded in $content.

SettingController.php

  public function postNewsletter(Request $request)
 {

    $title = "newsletter subscriber";
    $account = $request->input('account');

    foreach ($request->input('pic') as $key => $value) {
        
    $content = "This is a new newsletter subscriber: $key.:.$value"; 

davy_yg left a reply on Checkboxes • 1 month ago

How about:

How to call them in the controller? How to write the interation in the controller?

davy_yg started a new conversation Checkboxes • 1 month ago

Hello,

I have the following code works but it only printed the output from one checkbox. I would like it to print the output from all the checkboxes checked.

SettingController.php

 public function SendPicture(Request $request)
 {

    $title = "Picture Purchase";
    $picture = $request->input('pic');

    [email protected] ($theme as $theme)

    $content = "Someone purchase your picture: $picture .jpg";
    
    


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

        $message->from('davy.yg1@gmail.com', 'Admin');

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

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

        //Add a subject
        $message->subject("Picture Purchase");

    });

    return redirect('home/setting');

}

setting.blade.php

  <form action="{{ action([email protected]') }}" method="post">
                                    {{ csrf_field() }}

                                    <table>
                                        @foreach ($themes->chunk(3) as $chunk)
                                            <tr>
                                            @foreach ($chunk as $theme)
                                                <td>
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg"/> 
                                                    <input type="checkbox" name="pic" value="{{$theme->pic_name}}"/>
                                                </td>
                                            @endforeach
                                            </tr>
                                        @endforeach
                                    </table>

davy_yg started a new conversation TokenMismatchException In VerifyCsrfToken.php • 1 month ago

Hello,

I am receiving this error message:

TokenMismatchException in VerifyCsrfToken.php line 53:

while trying to proses this codes:

SettingController.php

public function SendPicture(Request $request)
{

    $title = "Picture Purchase";
    $picture = $request->input('pic');

    $content = "Someone purchase your picture: $picture";
    
    
    Mail::send('soulfy.email.purchase', ['title' => $title, 'content' => $content], function ($message) use ($account)//use ($attach)
    {

        $message->from('davy.yg1@gmail.com', 'Admin');

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

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

        //Add a subject
        $message->subject("Picture Purchase");

    });

    return redirect('home/setting');

}

setting.blade.php

 <form action="{{ action([email protected]') }}" method="post">
                                    {{ csrf_field() }}  
                                    
                                    <table>
                                        @foreach ($themes->chunk(3) as $chunk)
                                            <tr>
                                            @foreach ($chunk as $theme)
                                                <td>
                                                    <img width="100px"
                                                        height="100px"
                                                        src="{{url('/')}}/uploads/theme/{{$theme->pic_name}}.jpg"/> 
                                                    <input type="checkbox" name="pic" value="{{$theme->pic_name}}"/>
                                                </td>
                                            @endforeach
                                            </tr>
                                        @endforeach
                                    </table>

                                    @if ( $themes->currentPage() != 1)
                                    <a href="{!! $themes->previousPageUrl() !!}"> << </a>@endif

                                    {!! $themes->currentPage() !!} of {!! $themes->lastPage() !!}

                                     @if ( $themes->currentPage() !=  $themes->lastPage())
                                    <a href="{!! $themes->nextPageUrl() !!}"> >> </a>@endif
                                            
                                                                            
                                    <input type="submit" value="Purchase">  
                                    </form>

Any clue why?

Edit Your Profile
Update

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