Cyber Monday! Get 25% off for as long as you keep your subscription. New subscribers only.

andrydox

andrydox

Member Since 4 Months Ago

Experience Points
580
Total
Experience

4,420 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
580 XP
Nov
24
6 days ago
Activity icon

Replied to HTTP Request In Laravel

thanks @neilstee i will take a read.

Activity icon

Replied to HTTP Request In Laravel

Thankyou for the answer and the explanation, i understand what you mean

Nov
23
1 week ago
Activity icon

Started a new Conversation HTTP Request In Laravel

hi teams, im new in laravel and learning about Microsoft Graphs, i found about HTTP Request in the tutorial page, but don't know where i must insert the code. the code looks like :

GET /me/calendarGroup/calendars/{id}
GET /users/{id | userPrincipalName}/calendarGroup/calendars/{id}

thanks for the help.

Aug
21
3 months ago
Activity icon

Replied to Break Looping While In Php

what variable should i use for parameter for if ? so i can use as variable for break the loop

Activity icon

Started a new Conversation Break Looping While In Php

hi guys hope you are well, i'am still learning and new in php, now i'm on progress develop simple website but i have a problem with array and looping, how to stop looping when all data has been output.

<form method="POST" action="storedata_g6b.php">
	<table class="table">
		<thead class="thead-dark">
			<tr>
				<th class="col-3">id</th>
				<th class="col-7">nama</th>
				<th class="col-3">rank</th>
			</tr>
		</thead>
		<tbody>
		<?php
			$rank_b = 'B';
			$sql = "select t_empeval.id, t_empeval.nama from t_empeval Where t_empeval.grade='$c' and sect=CONCAT('$a','$b') order by t_empeval.v1 desc limit ".$var1.",".$var2."";
			$query = mysqli_query($koneksi, $sql);
			if(!$query)
			{
				die('SQL Error :' . mysqli_error($koneksi));
			}
			$b=0;
			while ($array_b = mysqli_fetch_assoc($query))
			{
				if(mysqli_num_rows($query) > 0)
				{
		?>
					<tr>
						<td><input type="text" name="id_b[<?php echo $b; ?>]" value="<?php echo $array_b['id']; ?>"></td>
						<td><input type="text" name="nama_b[<?php echo $b; ?>]" value="<?php echo $array_b['nama']; ?>"></td>
						<td><input type="text" name="rank_b[<?php echo $b; ?>]" value="<?php echo $rank_b; ?>"></td>
					</tr>
		<?php
					$b++;
				}
			}
		?>
			<input type="hidden" name="cotton_b" value="<?php echo $b; ?>" />
		</tbody>
	</table>
	<input type="submit" id="submit" name="submit"/>
</form>

in this case amount of data will be display is 2 row.

example : 1 => a 2 => a

then if amount of data has been displayed then will break the loop and start other loop. please englithment me, thanks in advance.

Jul
24
4 months ago
Activity icon

Started a new Conversation Reset Autonumber To 1 When Month Change

i want to create invoice aplication that will give automatic number, the format be like : "1/order/engineering/VII/04-04-2020/Mycompany. "1" is for automatic number, "VI" for month will follow current month, and date will follow current date now, how to reset number to 1 again every month change ? if in a day have 100 request, it's will be like : "100/order/engineering/VII/04-04-2020/Mycompany". the first number have no limit depend on coming request. can everyone give me clue or tutorial ? i'm use laravel 7.

thanks in advance

Jul
22
4 months ago
Activity icon

Started a new Conversation Laravel Register Must Have Admin Approve And Role

I have a web application, when new user is register they will redirected to page "wait for admin approval" and i have position like "director, manager, senior staff, middle staff and new staff". So when new user login, admin can decide will approve the user or reject it and when approve admin will edit the user level, so the page will remain on "waiting approval" until new user have approve from admin and have a role, by that user can login to their page that should be. I'm using laravel framework version 7.19.1.

ApprovalController :

public function approval()
{
    return view('approval');
}

one of controller for distinguish page :

class DirectorController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }
    
    public function index()
    {
        return view('director.index');
    }
}

the function is here :

namespace App\Http\Middleware;

use Closure;

class CheckApproved
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (!auth()->user()->approved_at) {
            return redirect()->route('approval');
        }
        if(!Auth::check()->role == 1){
            return redirect()->route('director');
        }
        if(!Auth::check()->role == 2){
            return redirect()->route('manager');
        }
        if(!Auth::check()->role == 3){
            return redirect()->route('senior_staff');
        }   
        if(!Auth::check()->role == 4){
            return redirect()->route('middle_staff');
        }
        if(!Auth::check()->role == 4){
            return redirect()->route('new_staff');
        }
        return $next($request);
    }
}

route :

Route::middleware(['auth'])->group(function () {
    Route::get('/approval', '[email protected]')->name('approval');

    Route::middleware(['approved'])->group(function () {
        Route::get('/director', '[email protected]')->name('director');
        Route::get('/manager', '[email protected]')->name('manager');
        Route::get('/staff', '[email protected]')->name('staff');
    });
});

did my code is correct ? i mean if you see from middleware, controller and route and relate with my question, thanks in advance

Jul
21
4 months ago
Activity icon

Replied to Live Search In Laravel 5.8 Using AJAX Doesn't Show Results In The Table

i have same problem too, im using laravel 7, please advice : here is my controller

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;

class LivesearchController extends Controller
{
    public function indexing()
	{
		return view('pages.evaluation.eval-search');
	}
function search(Request $request)
	{
		if($request->ajax())
		{
			$output = '';
			$query = $request->get('query');
			if($query != '')
			{
				$data = DB::table('department')
					->where('name', 'like', '%'.$query.'%')
->get();
			}
			else
			{
				$data = DB::table('department')
					->orderBy('emp_id', 'desc')
					->get();
			}
				$total_row = $data->count();
if($total_row > 0)
				{
					foreach($data as $row)
					{
						$output .=
							'<tr>
								<td>'.$row->id.'</td>
								<td>'.$row->emp_id.'</td>
								<td>'.$row->name.'</td>
								<td>'.$row->dept.'</td>
								<td>'.$row->sec.'</td>
								<td>'.$row->subsec.'</td>
								<td>'.$row->group.'</td>
								<td>'.$row->subgroup.'</td>
							</tr>';
					}
				}
				else
				{
					$output .= 
						'<tr>
							<td align="center" colspan="5"> No Data Found</td>
						</tr>';
				}
				$data = array(
					'table_data' => $output,
					'total_data' => $total_row
					);
				return Response::json($data);

view :

@extends('layouts.app')

@section('content')
@push('scripts')
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
	<script>
		$(document).ready(function(){

 fetch_customer_data();

 function fetch_customer_data(query = '')
 {
  $.ajax({
   url: "{{route('pages.evaluation.search')}}",
   method:'GET',
   data: {query: query},
   dataType: 'json',
   success: function(data)
   {
    $('tbody').html(data.table_data);
    $('#total_records').text(data.total_data);
   }
  })
 }

 $(document).on('keyup', '#search', function(){
  var query = $(this).val();
  fetch_customer_data(query);
 });
});
	</script>
@endpush
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">{{ __('Dashboard') }}</div>

                <div class="card-body">
                    @if (session('status'))
                        <div class="alert alert-success" role="alert">
                            {{ session('status') }}
                        </div>
                    @endif

                    <div class="card-body">
						<h4 class="card-title">Search Employee</h4>
						<div class="form-group">
							<input type="text" name="search" id="search" class="form-control" placeholder="type id pegawai" />
						</div>
						<div class="table-responsive">
							<h3 align="center">Total Data : <span id="total_records" name="total_records"></span></h3>
							<table class="table table-striped table-bordered">
								<thead>
									<tr>
										<th> id </th>
										<th> nama </th>
										<th> departemen </th>
										<th> section </th>
										<th> sub section </th>
										<th> group </th>
										<th> sub group </th>
									</tr>
								</thead>
								<tbody>
									
								</tbody>
							</table>
						</div>
					</div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

route:

Route::get('/pages/evaluation', '[email protected]');
Route::get('/pages/evaluation/search', '[email protected]')->name('pages.evaluation.search');
Jul
17
4 months ago
Activity icon

Started a new Conversation Insert Type Radio Button To Database

how to insert radio button inline to database ?

<td class="col">
	<label for="exampleInputEmail1">point</label></br>
		<div class="form-check form-check-inline">
			<input class="form-check-input" type="radio" name="t1r1" id="que1rad1" value="4">
			<label class="form-check-label" for="que1rad1">4</label>
		</div>
		<div class="form-check form-check-inline">
			<input class="form-check-input" type="radio" name="t1r1" id="que1rad1" value="8">
			<label class="form-check-label" for="que1rad1">8</label>
		</div>
		<div class="form-check form-check-inline">
			<input class="form-check-input" type="radio" name="t1r1" id="que1rad1" value="12">
			<label class="form-check-label" for="que1rad1">12</label>
		</div>
		<div class="form-check form-check-inline">
			<input class="form-check-input" type="radio" name="t1r1" id="que1rad1" value="16">
			<label class="form-check-label" for="que1rad1">16</label>
		</div>
		<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="t1r1" id="que1rad1" value="20">
<label class="form-check-label" for="que1rad1">20</label>
</div>
</td>
Activity icon

Replied to Count Value From Radio Button

sorry, im a bit confuse. my mistake. ill close this thread. thaknyou for all reply.

Jul
16
4 months ago
Activity icon

Replied to Count Value From Radio Button

it's not showing the result of sum

Activity icon

Started a new Conversation Count Value From Radio Button

how to calculate value from radio button ? i tried but not showing result, what is missing ?

<td class="col">
<label for="exampleInputEmail1">point</label></br>
<div class="form-check form-check-inline">
<input class="form-check-input table1" type="radio" name="r4" id="inlineRadio1" value="2">
<label class="form-check-label" for="inlineRadio1">2</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input table1" type="radio" name="r4" id="inlineRadio1" value="4">
<label class="form-check-label" for="inlineRadio1">4</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input table1" type="radio" name="r4" id="inlineRadio1" value="6">
<label class="form-check-label" for="inlineRadio1">6</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input table1" type="radio" name="r4" id="inlineRadio1" value="8">
<label class="form-check-label" for="inlineRadio1">8</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input table1" type="radio" name="r4" id="inlineRadio1" value="10">
<label class="form-check-label" for="inlineRadio1">10</label>
</div>
</td>
</tr>
<tr>
<td class="col-7" style="text-align:right;">
total
</td>
<td class="col">
<input class="form-control" type="text" name="sum" id="sum" readonly>
</td>
</tr>

js script

function calcscore(){
    var score = 0;
    $(".form-check-input table1:checked").each(function(){
        score+=Number(this.value);
    });
    $("input[name=sum]").val(score)
}
$().ready(function(){
    $(".form-check-input table1").change(function(){
        calcscore()
    });
});
Jul
15
4 months ago
Activity icon

Replied to Multiple View In One Controller

i see, i'll make it clear.

public function search()
	{
		return view('pages.evaluation.search');
	}
public function show()
	{
		return view('pages.evaluation.show');
	}

let's say i have page for searh data with function search, and when data is found user will click the data and go to other page that is show page in function show.

Route::get('/pages/evaluation', '[email protected]')->name('search');
Route::get('/pages/evaluation', '[email protected]')->name('show');

the structure like this :

pages-->evaluation-->search.blade.php & show.blade.php

that's why in controller i have same route in '/pages/evaluation' and same controller.

Activity icon

Started a new Conversation Multiple View In One Controller

okay, i have page let's call it page A, on page A have button to page B. if i use multiple controller it's possible. but how to use multiple view in same controller

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class AnchorController extends Controller
{
    public function search()
	{
		return view('pages.evaluation.page-a');
	}
   public function show()
	{
		return view('pages.evaluation.page-b');
	}

here is my routes

Route::get('/pages/evaluation', '[email protected]');
Route::get('/pages/evaluation', '[email protected]');

this is the button on page-a, that i wanna link to page-b

<a href="{{ URL('/pages/evaluation) }}"><h5>here</h5></a>
Activity icon

Replied to Dropdown Option In Laravel

worked like charm! thankyou

Jul
09
4 months ago
Activity icon

Started a new Conversation Dropdown Option In Laravel

I'm new in laravel, i had search for my problem but nothing clear for me. How to make a dropdown options in laravel form, and then selected options will become value for saved in database or for distinguish page for every users. I searching on google, bootstrap just make it into clickable link. Can you help me out ?