bekaskaki

bekaskaki

Member Since 2 Weeks Ago

indonesia

Experience Points 530
Experience Level 1

4,470 experience to go until the next level!

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

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 1
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

16 Mar
4 days ago

bekaskaki left a reply on Update Password And Image Issue

done!!

i change controller like this :

public function update(Request $request)
    {

    $model = $request->all();


        $boat=User::find($model['id']); 

   

    $boat->fill($request->except('photo'));
    if($file = $request->hasFile('photo')) {
     $fullPath = public_path("images/{$boat->photo}");
    if (File::exists($fullPath))  {
       File::delete($fullPath);
    }
    $file = $request->file('photo') ;
    $fileName = $file->getClientOriginalName();
   $destinationPath = public_path().'/images/' ;
    $file->move($destinationPath,$fileName);
    $boat->photo = $fileName ;
}
    $boat['password'] = bcrypt($boat['password']);

     if($boat->save()){   
            Alert::success('Successfully Updated', 'Success');
        }else{
            Alert::error('Something went wrong!', 'Oops...');
        }
        return Redirect::to('admin/'.$this->title);
    }

bekaskaki started a new conversation Update Password And Image Issue

Controller :

 public function update(Request $request)
    {

    $model = $request->all();
    $boat=User::find($model['id']); 

    $boat['password'] = bcrypt($boat['password']);
    
    $boat->fill($request->except('photo'));
    if($file = $request->hasFile('photo')) {
     $fullPath = public_path("images/{$boat->photo}");
    if (File::exists($fullPath))  {
       File::delete($fullPath);
    }
    $file = $request->file('photo') ;
    $fileName = $file->getClientOriginalName() ;
    $destinationPath = public_path().'images/' ;
    $file->move($destinationPath,$fileName);
    $boat->photo = $fileName ;
}
     if($boat->save()){   
            Alert::success('Successfully Updated', 'Success');
        }else{
            Alert::error('Something went wrong!', 'Oops...');
        }
        return Redirect::to('admin/'.$this->title);
    }

if I use $boat->save, the image is saved but the password is not encrypted when I use an $boat->update, the password is encrypted, the image is not saved why does it happen?

15 Mar
5 days ago

bekaskaki left a reply on Error Messages In Request Validation

i have @include('flash-message') in app.blade and i removed it. it's done!! thank you

bekaskaki started a new conversation Error Messages In Request Validation

view :

@if ($errors->any())
   <div class="alert alert-danger">
      <ul>
           @foreach ($errors->all() as $error)
               <li>{{ $error }}</li>
           @endforeach
      </ul>
   </div>
@endif
<div class="box-body">
<div class="form-group-sm">
    <label for="inputEmail3" class="col-sm-3 control-label">Username</label>
    <div class="col-sm-9">
        <input type="text" class="form-control" placeholder="username" name="username" required="">
    </div>
    
</div>
<div class="form-group-sm">
    <label for="inputEmail3" class="col-sm-3 control-label">Name</label>
    <div class="col-sm-9">
        <input type="text" class="form-control" placeholder="Name" name="name">
    </div>
   
</div>
<div class="form-group-sm">
    <label for="inputPassword3" class="col-sm-3 control-label">E-Mail</label>
    <div class="col-sm-9">
        <input type="email" class="form-control" placeholder="E-Mail" name="email">
    </div>
   
</div>
<div class="form-group-sm">
    <label for="inputPassword3" class="col-sm-3 control-label">Phone</label>
    <div class="col-sm-9">
        <input type="text" class="form-control" placeholder="Phone" name="phone">
    </div>
</div>

error result :

https://prnt.sc/myde68

why error messages in Request Validation showing like that (see image) ?

12 Mar
1 week ago

bekaskaki left a reply on Where Are You All From?

indonesia,yogyakarta

11 Mar
1 week ago

bekaskaki left a reply on Show Data By Year

@TRAY2 - view :

<tr>
    <th>#</th>
    <th>Name</th>
    <th>2019</th>
    <th>2020</th>
    <th>2021</th>
</tr>
@foreach($data as $key => $jj)
<tr>
    <td>{{$key+1}}</td>
    <td>{{$jj->test1}}</td>
    <td>{{$jj->year == 2019 ? $jj->desk : ''}} </td>
    <td>{{$jj->year == 2020 ? $jj->desk : ''}} </td>
    <td>{{$jj->year == 2021 ? $jj->desk : ''}} </td>
</tr>
@endforeach

it works,,but I want to retrieve data for 2019 </ th> from YEAR (start_date) AS Year. what should i change? so,I don't need to enter the year manually

10 Mar
1 week ago

bekaskaki left a reply on Show Data By Year

@TRAY2 - i want display data like this

http://prntscr.com/mvyh9s

09 Mar
1 week ago

bekaskaki started a new conversation Show Data By Year

How can I show data by year. If year=2019 its need to show only 2019 data

I have query like this :

''' $datatest = Testing::select('test1', DB::raw('count(test2) as desk'),DB::raw("YEAR(date) as year")) ->groupBy(DB::raw("year(date)"),'test1','test2') ->get(); '''

I want to display data in table like this :

Name | year(data date) data test1 . data count test2

https://prntscr.com/mvogs6

Thanks in advance :)

08 Mar
1 week ago

bekaskaki left a reply on How To Set Login FORM Alert Message

@D9705996 - Thank you! successfully

bekaskaki started a new conversation How To Set Login FORM Alert Message

I would like to have alert come up when a user non active try logins but I can't find where the logic.

login blade :

'''

@csrf
                @if ($errors->has('username'))
                <span class="invalid-feedback">
                    <strong>{{ $errors->first('username') }}</strong>
                </span>
                @endif
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required placeholder="password">

                @if ($errors->has('password'))
                <span class="invalid-feedback">
                    <strong>{{ $errors->first('password') }}</strong>
                </span>
                @endif
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>

'''

Login controller :

''' class LoginController extends Controller {

use AuthenticatesUsers;

/**
 * Where to redirect users after login.
 *
 * @var string
 */
protected $redirectTo = '/';

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

 public function username()
{
   $login = request()->input('email');
   $field = filter_var($login, FILTER_VALIDATE_EMAIL) ? 'email' : 'username';
   request()->merge([$field => $login]);
   return $field;
}

   protected function credentials(Request $request)

    {   

        return ['username' => $request->{$this->username()}, 'password' => $request->password, 'active' => 1];
        
    }

} '''

any can help?

06 Mar
2 weeks ago

bekaskaki left a reply on Unable To Render BarChart Using Lavacharts

@CRONIX - The problem is in the charts package thanks for the help

bekaskaki left a reply on Unable To Render BarChart Using Lavacharts

@CRONIX - still give me error "Undefined index: desk"

bekaskaki left a reply on Laravel

try clean your browser history

bekaskaki left a reply on Unable To Render BarChart Using Lavacharts

@CRONIX - still give me error "Undefined index: desk"

$data = Kerjasama::select(DB::raw('count(deskripsi) as desk'), DB::raw('YEAR(tgl_mulai) as tahun')) ->groupBy(DB::raw('YEAR(tgl_mulai)')) ->get()->toArray();

Am I missing something on query?

bekaskaki started a new conversation Unable To Render BarChart Using Lavacharts

I'm trying to implement LavaCharts on Laravel but Unable to render it. It gives me error "Undefined index: desk". Below is my controller code & view code. What changes are required to fix this issue?. Trying to follow the documentation but it doesn't work on my part.

Here's my Controller :

''' public function chart() {

    $lava = new Lavacharts; 

    $test = $lava->DataTable();

    $data = Kerjasama::select(DB::raw('count(deskripsi) as desk'), DB::raw('YEAR(tgl_mulai) as tahun'))
           ->groupBy(DB::raw('YEAR(tgl_mulai)')) 
        ->get()->toArray();

    $test->addStringColumn('Testing')
               ->addNumberColumn('Test')
               ->addRows($data);

    $lava->BarChart('Test', $test);

    return view('chart',compact('lava'));

 }

,,,

Here's my View '''

,,,

Am I missing something? How do I call this function in the view?

05 Mar
2 weeks ago

bekaskaki left a reply on Laravel Not Executing Queries With 'DATEDIFF'

@OUHARE - Working!! thanks for your help

bekaskaki left a reply on Laravel Not Executing Queries With 'DATEDIFF'

@ouhare still same

I have 4 data in database. one data has ended. but the data that has ended still has an ongoing status that should have ended.

'Berakhir','Masih Berjalan' like in english ended,ongoing

I run the query in Navicat, it runs normally.

SELECT * ,IF(DATEDIFF(STR_TO_DATE(tgl_selesai, "%Y-%m-%d"), CURDATE())<=0,"Berakhir","Masih Berjalan") status FROM data_kerjasama

bekaskaki started a new conversation How To Convert This Query To Eloquent Laravel?

I'm a noob in Laravel. Can anyone help me write this query in eloquent. I have test this query on navicat and it works, but in laravel controller doesn't work perfectly/different results.

Query on Navicat (works): ''' SELECT * ,IF(DATEDIFF(STR_TO_DATE(tgl_selesai, "%Y-%m-%d"), CURDATE())<=0,"Berakhir","Masih Berjalan") status FROM data_kerjasama '''

my controller : ''' public function index() { $title = $this->title;

   $tgl=date('Y-m-d');

    $data = DB::select('SELECT * ,IF(DATEDIFF(STR_TO_DATE(tgl_selesai, "$tgl")), CURDATE())      
    <=0,"Berakhir","Masih Berjalan") status FROM data_kerjasama');

    return view('admin.'.$title.'.index', compact('title','data'));
}

'''