rully

rully

Member Since 8 Months Ago

Experience Points
1,440
Total
Experience

3,560 experience to go until the next level!

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

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

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

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 1
1,440 XP
Aug
10
2 days ago
Activity icon

Started a new Conversation Qty = 0

$item = ItemMaster::all();
        $stock = Stock::where('wh_code', $req->wh_code)->get();
        for ($i = 0; $i < count($item); $i++) {
            $qty = 0;
            for ($j = 0; $j < count($stock); $j++) {
                if ($stock[$j]->item->product_name == $item[$i]->product_name) {
                    $qty++;
                } 
            }
            $data = Items::where('product_name', $item[$i]->product_name)->first();
            if ($qty != null) {
                $data->qty = $qty;
            }
            $item[$i]->data = $data;
        }

        return response()->json([
            'data' => $item,
        ]);
Aug
05
1 week ago
Activity icon

Replied to API Throttling

on laravel route, like this

Route::middleware('throttle:70,1')->group(function () { 
.....
});
Activity icon

Replied to API Throttling

i want the throttling dynamic. thanks,

Activity icon

Started a new Conversation API Throttling

i've been set API Throttling in api middleware route, but it seems doesnt work.

``

Route::middleware('throttle:70,1')->group(function () { ..... });


but after i tried use the api the headers response still the default throttling


x-ratelimit-limit →60 x-ratelimit-remaining →58

Aug
04
1 week ago
Activity icon

Started a new Conversation Is Laravel Passport Secure?

plz, answer this question

thanks

Activity icon

Replied to Laravel Login Throttle

but, this feature must be created on my project

Aug
01
1 week ago
Activity icon

Started a new Conversation Laravel Login Throttle

This is my Login controller and i want to edit this login controller. where each user incorrectly enters the password 2 times the login request will be locked for 1 minute, and if the user is wrong again for the second time the login request will be locked for 5 minutes, and if the wrong login request will be locked for 15 minutes and the last if he was mistakenly the user account was blocked from the database

like this :

2x attempts failed = accounts lock for 1 minutes 2x attempts failed again = accounts lock for 5 minutes 2x attempts failed again = accounts lock for 15 minutes

is there someone who wants to help me to make the code? I have copied the login function from AuthenticateUsers to LoginController. this is the controller

<?php

namespace App\Http\Controllers\Auth;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles authenticating users for the application and
    | redirecting them to your home screen. The controller uses a trait
    | to conveniently provide its functionality to your applications.
    |
    */

    use AuthenticatesUsers;

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


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

    protected $maxAttempts = 2;
    protected $decayMinutes = 1;

    public function login(\Illuminate\Http\Request $request) {
        $this->validateLogin($request);
    
        // If the class is using the ThrottlesLogins trait, we can automatically throttle
        // the login attempts for this application. We'll key this by the username and
        // the IP address of the client making these requests into this application.
        if ($this->hasTooManyLoginAttempts($request)) {
            $this->fireLockoutEvent($request);
            return $this->sendLockoutResponse($request);
        }
        

    
        // If the login attempt was unsuccessful we will increment the number of attempts
        // to login and redirect the user back to the login form. Of course, when this
        // user surpasses their maximum number of attempts they will get locked out.
        $this->incrementLoginAttempts($request);
    
        return $this->sendFailedLoginResponse($request);
    }

}

Jul
27
2 weeks ago
Activity icon

Awarded Best Reply on Laravel Hierarchy Users

@tray2 no,

sales A001-22 'closing' => 2, 'reject' => 2,

sales A002-22 'closing' => 2, 'reject' => 3,

leader A001-22 'closing' => 4, 'reject' => 5,

closing and reject leader is get it from sales A001 and A002,it solved. but, how i get it up to supervisor,manager,and,general manager?

Jul
19
3 weeks ago
Activity icon

Started a new Conversation Laravel Leaflet Js

I want to make every marker in the same position more than 2 minutes the marker will turn black.

this is all the code

var map = L.map( 'map-canvas', {
    center: [-6.21462, 106.84513],
    minZoom: 2,
    zoom: 7
});

L.tileLayer( 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
    subdomains: ['a','b','c']
}).addTo( map ); 

var greenIcon = new L.Icon({
  iconUrl: 'https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png',
  shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
  iconSize: [25, 41],
  iconAnchor: [12, 41],
  popupAnchor: [1, -34],
  shadowSize: [41, 41]
});

var blackIcon = new L.Icon({
  iconUrl: 'https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-black.png',
  shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
  iconSize: [25, 41],
  iconAnchor: [12, 41],
  popupAnchor: [1, -34],
  shadowSize: [41, 41]
});

var markers = <?php print_r(json_encode($sales)); ?>

var today = new Date();
var time = today.getTime();
var minutes = today.getMinutes();

console.log(minutes);

for ( var i=0; i < markers.length; ++i ) 
{
    switch (markers) {
        case markers == markers || today.getMinutes():
            L.marker( [markers[i].lat, markers[i].lng],{icon: blackIcon} )
            .bindPopup( '<p>' + markers[i].username + '</p>' )
            .addTo( map );
            break;

        default:
            L.marker( [markers[i].lat, markers[i].lng],{icon: greenIcon} )
            .bindPopup( '<p>' + markers[i].username + '</p>' )
            .addTo( map );
            break;
    }
}

this is the main code but i will try with this code, but doesn't work

for ( var i=0; i < markers.length; ++i ) 
{
    switch (markers) {
        case markers == markers || today.getMinutes():
            L.marker( [markers[i].lat, markers[i].lng],{icon: blackIcon} )
            .bindPopup( '<p>' + markers[i].username + '</p>' )
            .addTo( map );
            break;

        default:
            L.marker( [markers[i].lat, markers[i].lng],{icon: greenIcon} )
            .bindPopup( '<p>' + markers[i].username + '</p>' )
            .addTo( map );
            break;
    }
}

Activity icon

Replied to Laravel Datatatables

this is the code

$(function () {
    var table = $('.closing-table').DataTable({
        processing: true,
        serverSide: true,
        ajax: {
            "url": "{{ route('closing.api') }}",
            "type": "GET"
        },
        columns: [
            {data: 'id', name: 'id'},
            {data: 'salescode', name: 'salescode'},
            {data: 'nama_ktp', name: 'nama_ktp'},
            {data: 'no_ktp', name: 'no_ktp'},
            {data: 'alamat', name: 'alamat'},
            {data: 'kota', name: 'kota'},
            {data: 'kel', name: 'kel'},
            {data: 'kec', name: 'kec'},
            {data: 'rt', name: 'rt'},
            {data: 'rw', name: 'rw'},
            {data: 'kode_pos', name: 'kode_pos'},
            {data: 'tanggal_lahir', name: 'tanggal_lahir'},
            {data: 'jenis_kelamin', name: 'jenis_kelamin'},
            {data: 'telp_rumah', name: 'telp_rumah'},
            {data: 'no_hp', name: 'no_hp'},
            {data: 'no_hp_2', name: 'no_hp_2'},
            {data: 'email', name: 'email'},
            {data: 'stts_rumah', name: 'stts_rumah'},
            {data: 'tipe_rumah', name: 'tipe_rumah'},
            {data: 'akses_lokasi', name: 'akses_lokasi'},
            {data: 'alamat_pemasangan', name: 'alamat_pemasangan'},
            {data: 'kota_pemasangan', name: 'kota_pemasangan'},
            {data: 'kec_pemasangan', name: 'kec_pemasangan'},
            {data: 'kel_pemasangan', name: 'kel_pemasangan'},
            {data: 'rt_pemasangan', name: 'rt_pemasangan'},
            {data: 'rw_pemasangan', name: 'rw_pemasangan'},
            {data: 'kodepos_pemasangan', name: 'kodepos_pemasangan'},
            {data: 'kategori_produk', name: 'kategori_produk'},
            {data: 'produk_nama', name: 'produk_nama'},
            {data: 'value_pack', name: 'value_pack'},
            {data: 'produk_market', name: 'produk_market'},
            {data: 'payment', name: 'payment'},
            {data: 'bonus', name: 'bonus'}, 
            {data: 'installasi_fee', name: 'installasi_fee'}, 
            {data: 'catatan', name: 'catatan'},
        ]
    });
});

Jul
18
3 weeks ago
Activity icon

Started a new Conversation Laravel Datatatables

i got this error when i load data from datatable in laravel. i load more than 36 field from table database and got this error

web server : apache

Failed to load resource: the server responded with a status of 414 (Request-URI Too Long)

i've tried to add LImitRequestFieldSize in apache2.conf, but still doesn't work.

what should i do?

Jul
11
1 month ago
Activity icon

Started a new Conversation How To Get ID Of Other Table

this is my logistic table,how do I make it so that every time I enter data into a logistic table, the id in the logistic table will be input into the transaction table

id Logistic_code | Logistic_name | Logistic_ship | created_at | updated_at

logistic model

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Logistic extends Model
{
    protected $table = 'Logistic';
    protected $fillable = ['Logistic_code','Logistic_name','Logistic_ship'];
}

this is transaction table.

id | Stock_id | Logistic_id | Segment_id | created_at | updated_at

transaction model

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Transaction extends Model
{
    protected $table = 'transaction';
    protected $fillable = ['Stock_id','Logistic_id','Segment_id'];

    public function stock()
    {
        return $this->belongsTo('App\Stock','id');
    }

    public function segment()
    {
        return $this->belongsTo('App\Segment','id');
    }

    public function Logistic()
    {
        return $this->belongsTo('App\Logistic','id');
    }

}
Jul
05
1 month ago
Activity icon

Replied to Laravel Hierarchy

from users roles leaders,when sales login

Activity icon

Replied to Laravel Hierarchy

not like that. i mean,i want to get parent_id of that users

Jul
04
1 month ago
Activity icon

Started a new Conversation Laravel Hierarchy

this is the JSON


{
    "status": 200,
    "data": {
        "id": 5,
        "salescode": "sales1",
        "username": "Sales1",
        "role": "sales",
        "parent_id": 10,
        "created_at": "2020-07-04 19:57:23",
        "updated_at": "2020-07-03 02:13:18"
    },
    "superior": [
        [
            {
                "id": 10,
                "parent_id": 11,
                "salescode": "tl01",
                "username": "Leader",
                "role": "leader"
            }
        ],
        [
            {
                "id": 11,
                "parent_id": 12,
                "salescode": "spv01",
                "username": "Supervisor",
                "role": "supervisor"
            },
            {
                "id": 26,
                "parent_id": 12,
                "salescode": "spv02",
                "username": "Supervisor",
                "role": "supervisor"
            }
        ]
    ]
}


this is the table

-------------------------------------------------------------
id | salescode | username| role | parent_id 
---------------------------------------------------------------

I managed to get the leader data from the parent user id with the following code. note: You can see Json above

whereas if I try to get supervisor data, instead it removes all the supervisor role user data.

  $super = Auth::user()->parent_id;
        $Find = DB::table('users')->where('id','=',$super)
                  ->select('id','parent_id','salescode','username','role')
                  ->groupBy('id','parent_id','salescode','username','role')
                  ->get();

```
.
this is the supervisor roles code.

```
$parent = Auth::user()->parent_id;
        for ($i=0; $i <$parent ; $i++) { 
          $spv = DB::table('users')
              ->where('role','=','supervisor')
              ->select('id','parent_id','salescode','username','role')
              ->groupBy('id','parent_id','salescode','username','role')
              ->get();
        }
```


how is it so that I can get supervisor data, from the parent id users 'roles sales' itself?
May
13
2 months ago
Activity icon

Started a new Conversation Save Image To Public Folder

Intervention\Image\Exception\NotWritableException
Can't write image data to path (C:\xampp\htdocs\gerobak\main\public\img1589369711IMG20200507180440.jpg)

i got this error.

but the public folder outside laravel folder , let me explain

laravel_folder
  main
     ..app
     ..bootstrap
     ..config
     etc
  public
  index.php
  .htaccess

and this is the coding

$originalImage= $request->file('IMAGE');
        $thumbnailImage = Image::make($originalImage);
        $thumbnailPath = public_path().'\thumbnail';
        $originalPath = public_path().'\img';
        $thumbnailImage->save($originalPath.time().$originalImage->getClientOriginalName());
        $thumbnailImage->resize(800,800);
        $thumbnailImage->save($thumbnailPath.time().$originalImage->getClientOriginalName()); 

so, what should i do now?

Apr
19
3 months ago
Activity icon

Replied to Validation Register

i got some error bro

BadMethodCallException
Method Illuminate\Support\Collection::exists does not exist.
```
Activity icon

Started a new Conversation Validation Register

i will to make it this validation before users doing the registration. so, before users registration they're must be input the code for registration, if the users enter the correct code they are directly to redirect to register page, if else, the page return back. oyaa, code for registration from the student table

i wrote this code but if am enters correct code, the page return back to validation page, and if am enters wrong code the same return back to validation page. and this my controller

namespace App\Http\Controllers;
use App\Siswa;
use DB;
use Auth;
use Illuminate\Http\Request;

class ValidationController extends Controller
{

public function validationRegister(Request $request)
    {
        $users = DB::table('siswa')->where('nisn','=','02278817208483')->get();
        if ($users == $request->nisn) {
            return view('auth.register');
        }

        toastr()->error('gagal','nisn tidak ditemukan di database!');
        return back();
    }
}

```
Mar
26
4 months ago
Activity icon

Started a new Conversation How To Auto Add Users_id In Foreign Key And One To Many Relations

this the controller

`public function store(Request $request) { $siswa = new Siswa; $siswa->nama = $request->nama; $siswa->nisn = $request->nisn; $siswa->pict = $request->pict; $siswa->kelas = $request->kelas; $siswa->jurusan = $request->jurusan; $siswa->save();

    toastr('success!');
    return back();
}`

this is the siswa model

public function user() { return $this->hasMany(User::class); }

this is the users model

public function Siswa() { return $this->belongsTo(Siswa::class); }

Mar
23
4 months ago
Activity icon

Started a new Conversation Laravel Relations Foreign Key

$table->bigIncrements('id'); $table->unsignedBigInteger('siswa_id'); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('nik_nisn'); $table->string('type'); $table->string('password'); $table->rememberToken(); $table->timestamps(); $table->foreign('siswa_id')->references('id')->on('siswa');

how do i do relations in users table? while the email field is unique, when I keep trying an error occurs. maybe the error appears because the email field is unique. Any suggestions for me?

Mar
19
4 months ago
Activity icon

Started a new Conversation Laravel Datatables

I'm trying datatables, there's a problem when I want to redirect to the edit form, the button doesn't work at all

this is my controller

->addColumn('action', function($data){ $button = ' Action Edit Delete '; return $button; }) ->rawColumns(['action']) ->make(true);

and this is the ajax that I made :

$(document).on('click', '.edit', function(){ var id = $(this).attr('id'); $.ajax({ url :"users/" + id + "/edit", dataType:"json", success:function(data) { console.log("OK"); } }) });

the button doesnt redirect to form edit, so plz help me :)

Mar
18
4 months ago
Activity icon

Replied to Laravel Blade

Ok,thanks sir

Mar
17
4 months ago
Activity icon

Started a new Conversation Laravel Blade

{!! Form::select('users', $users, null, ['id' => 'users', 'class' => 'form-control', 'required' => 'required']) !!}

what it looks like if you change it to a normal form control?

Mar
15
4 months ago
Activity icon

Started a new Conversation Laravel Alerts

how to send alert when login failed,where is the controller for editing the code of auth login