RamjithAp

RamjithAp

Software Developer at Saggezza Inc.

Member Since 2 Years Ago

Bangalore

Experience Points
47,100
Total
Experience

2,900 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
2
Lessons
Completed
Best Reply Awards
73
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 10
47,100 XP
Aug
07
1 month ago
Activity icon

Started a new Conversation NA

NA

Jul
07
2 months ago
Activity icon

Awarded Best Reply on DELETE 405 (Method Not Allowed)

Your route should be

Route::delete('/management/site/{id}','[email protected]')->name('destroy')
May
25
3 months ago
Activity icon

Replied to Jquery Undefined

jQuery Validate requires jQuery. You can include just before the jquery.validate.js script.

<script src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../node_modules/jquery-validation/dist/jquery.validate.min.js"></script>
May
20
3 months ago
Activity icon

Replied to How Do I Send The View Back To Ajax In Laravel

Yes, you can return view from the controller and append via Ajax. For that, you need to render the view in the controller before returning it.

public function index()
{
    $posts = Post::latest()->get();
    $html = view('index', compact('posts'))->render();
    return $html;
}
Activity icon

Replied to Class 'Ixudra\\Curl\\Facades\\Curl' Not Found

Include the classes on your config/app.php providers & alias arrays.

May
19
4 months ago
Activity icon

Replied to How To Change The Color Of Some Rows On The Resource Page?

Try this

@foreach($colecctions as $collection) 
<tr @if($collection->points) class="red" @endif>
  <td></td>
</tr>
@endforeach
Activity icon

Replied to How To Block The Form Submission ?

Use e.preventDefault();

$("#btn-login").click(function (e) {
    $(this).attr('disabled', 'disabled');
    let formElement = $('#form-login');
    let action = formElement.attr('action');
    var formData = {
        _token: formElement.find("input[name='_token']").val(),
        email: formElement.find("input[name='email']").val(),
        password: formElement.find("input[name='password']").val(),
    };
   if(isExistEmail(formData.email, 'inputEmail') && isExistPassword(formData.password, 'inputPassword')){
       // $.ajax({
       //     type : "POST",
       //     url : action,
       //     data: formData,
       //     success(data){
       //
       //     }
       // });
       console.log("Done");
   }
   else{
       isExistEmail(formData.email, 'inputEmail');
       isExistPassword(formData.password, 'inputPassword');
       $(this).removeAttr('disabled');
	e.preventDefault();
   }
});
May
14
4 months ago
Activity icon

Awarded Best Reply on How To Load Employee Name Based On Dropdown Change

On your ajax

       $.ajax({
                type: 'POST',
                url: '{{ route('get.employee.all') }}',
                data: { 'id': air_id ,'_token':'{{ csrf_token()}}'},
                dataType: 'json',
                success: function(data) {
                    console.log(data);
                     $('#employee_name').html(data.fullname);
                     },
                error:function(){
                }
            });

Then you html

<span class="font-weight-bold">
                    For: <span id="employee_name"></span>
</span>
May
13
4 months ago
Activity icon

Replied to "554 5.5.1 Error: No Valid Recipients" On Password Reset

@snapey made a good point. So cover your password in .env if it has # character like this "Test#123". Then post the results.

May
12
4 months ago
Activity icon

Replied to Getting Value From Json_decode ( PHP )

When you do JSON decode the output will be an array format. So try this

$econfig = json_decode(file_get_contents("url.json"),TRUE);
return $econfig["uris"]["DIT"];
Activity icon

Replied to Count Age And Save It Into Table.

Then you have to tell us using which columns you have connected these tables so we can help further.

Activity icon

Replied to How To Load Employee Name Based On Dropdown Change

On your ajax

       $.ajax({
                type: 'POST',
                url: '{{ route('get.employee.all') }}',
                data: { 'id': air_id ,'_token':'{{ csrf_token()}}'},
                dataType: 'json',
                success: function(data) {
                    console.log(data);
                     $('#employee_name').html(data.fullname);
                     },
                error:function(){
                }
            });

Then you html

<span class="font-weight-bold">
                    For: <span id="employee_name"></span>
</span>
Activity icon

Replied to Count Age And Save It Into Table.

Try this

public function getAgeAttribute()
{
  $runnerDob = $this->dob;
  $eventDate = Event::where('runner_id',$this->id)->pluck('date');

  $from = Carbon::parse($runnerDob);
  $to = Carbon::parse($eventDate);
  $diff_in_years = $to->diffInYears($from);

  return $diff_in_years;
}
Activity icon

Replied to Birthday Email

@drewdan do you think this path(C:\xampp\php\php.exe) belongs to CentOS. Its windows path. But this is definitely his fault not mentioning the environment he trying.

Activity icon

Replied to Using Cors To Prevent Accessing From All Domains

Try this

public function handle($request, Closure $next)
{
    $allowedOrigins = ['first.com', 'second.com', 'third.com'];
    $origin = $request->headers->get('referer');
    if (!in_array($origin, $allowedOrigins)) {
        return response()->json(["status"=>"error","message"=>"Domain not allowed"],403);
    }
    return $next($request);
}
Activity icon

Replied to Birthday Email

@snapey his environment is windows and using xampp software. So all the crontab suggestions would not help him.

Activity icon

Replied to Birthday Email

On Windows OS there is no crontab. You need to use the scheduler task from Windows to create a "Cronjob". See this for task scheduler. https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc721931(v=ws.11)?redirectedfrom=MSDN

May
11
4 months ago
Activity icon

Replied to Sub.mydomain.com Redirect To Mydomain.com/sub With Forge|Digital Ocean

Try this in your .htacess file

RewriteCond %{HTTP_HOST} ^([^/.]+)\.example\.com$ 
RewriteCond %1 !^(www|ftp|mail)$ [NC]
RewriteRule (.+)$ "http://example.com/%1" [R=301,L]
Activity icon

Replied to How To Load Employee Name Based On Dropdown Change

Because you are posting data in ajax and your route is GET so posted id not available in your controller. So change ajax type to post and add _token for csrf verification.

            $.ajax({
                type: 'POST',
                url: '{{ route('get.employee.all') }}',
                data: { 'id': air_id ,'_token':'{{ csrf_token()}}'},
                dataType: 'json',
                success: function(data) {
                    console.log(data);
                     $('#employee_name').val(data.fullname);
                     },
                error:function(){
                }
            });

And your route

Route::any('get/findEmployee','[email protected]')->name('get.employee.all');

Also in your controller add

return response()->json(["status"=>"success","fullname"=>$data], 200);
Activity icon

Replied to Find Date In Range

Try this

$range = [];
$values = [];
for($i=0;$i<6;$i++){
    //Get $date from carbon 
    $range[]= $date->format("any format");
    $values[] = // use $date to query and get the result count 
}
Activity icon

Replied to SQLSTATE[42S22]: Column Not Found: 1054 Unknown Column '_token' In 'field List' (SQL: Update `todos` Set `_token` = UonSH9zn8ELeZFunPC2JKutqsSJ8tZDKDmkUHUJw, `_method` = Put, `title` = With Lead Ramesh Kumar, `description` = Mollitia Anim Volupt, `tasktyp

Quick fix

    public function update(CreateTaskRequest $request, Todo $task)
    {
        $lead = Tbl_leads::find($request->lead_id);

        $input = $request->validated();

        $input['user_id'] = Auth::user()->id;

	unset($input["_token"]);
        unset($input["lead_id"]);

        if ($request->lead_id == '') {

            $input = $request->except(['todoable_id','_token']);

            $task->update($input);

        } else {

            $lead->todos()->update($input);
        }

        return redirect(route('tasks.index'))->with('success','succesfully updated');

    }
Activity icon

Replied to SQLSTATE[42S22]: Column Not Found: 1054 Unknown Column '_token' In 'field List' (SQL: Update `todos` Set `_token` = UonSH9zn8ELeZFunPC2JKutqsSJ8tZDKDmkUHUJw, `_method` = Put, `title` = With Lead Ramesh Kumar, `description` = Mollitia Anim Volupt, `tasktyp

This happens because you passing unwanted columns to todos table. Go to your todos table model file app/todos.php and add fillable array with the columns you would like to bulk assign.

class Todos extends Eloquent {

    protected $fillable = array('column1', 'column2');

}

For reference see https://laravel.com/docs/4.2/eloquent#mass-assignment

Activity icon

Replied to SQLSTATE[42S22]: Column Not Found: 1054 Unknown Column '_token' In 'field List' (SQL: Update `todos` Set `_token` = UonSH9zn8ELeZFunPC2JKutqsSJ8tZDKDmkUHUJw, `_method` = Put, `title` = With Lead Ramesh Kumar, `description` = Mollitia Anim Volupt, `tasktyp

Try this

    public function update(CreateTaskRequest $request, Todo $task)
    {
        $lead = Tbl_leads::find($request->lead_id);

        $input = $request->validated();

        $input['user_id'] = Auth::user()->id;

	unset($input["_token"];

        if ($request->lead_id == '') {

            $input = $request->except(['todoable_id','_token']);

            $task->update($input);

        } else {

            $lead->todos()->update($input);
        }

        return redirect(route('tasks.index'))->with('success','succesfully updated');

    }
Activity icon

Replied to Laravel Count With Relationship Fields

Accept the answer that fixed your issue. And for your next question try this

$users = User::select(['users.*','departments.*',DB::raw('count(classes.*) as classes_total')])
        ->where('users.graduate_year', 2015)
        ->join('classes', 'users.id', '=', 'classes.user_id') // correct the column names if wrong
       	->groupBy('classes.department_id')
        ->join('departments', 'departments.id', '=', 'classes.department_id')
     	->where('departments.name', '=', 'MUSIC')
        ->get();
Activity icon

Awarded Best Reply on Passport Clients

Your route will be

Route::post('get_token', function(Request $request){ 

$http = new GuzzleHttp\Client;

$response = $http->post('http://my-domain/oauth/token', [
    'form_params' => [
        'grant_type' => 'password',
        'client_id' => 'take_from_passport_table',
        'client_secret' => 'take_from_passport_table',
        'username' =>$request->email,
        'password' => $request->password,
        'scope' => '*',
    ],
]);

return json_decode((string) $response->getBody(), true);
});
  1. Send postman POST request to http://my-domain/get_token with the parameters email & password.
  2. Based on the error you posted above your storage/log/laravel.log file if not writtable so fix it as well.
Activity icon

Replied to Passport Clients

Your route will be

Route::post('get_token', function(Request $request){ 

$http = new GuzzleHttp\Client;

$response = $http->post('http://my-domain/oauth/token', [
    'form_params' => [
        'grant_type' => 'password',
        'client_id' => 'take_from_passport_table',
        'client_secret' => 'take_from_passport_table',
        'username' =>$request->email,
        'password' => $request->password,
        'scope' => '*',
    ],
]);

return json_decode((string) $response->getBody(), true);
});
  1. Send postman POST request to http://my-domain/get_token with the parameters email & password.
  2. Based on the error you posted above your storage/log/laravel.log file if not writtable so fix it as well.
Activity icon

Replied to How Secure Is The Env. File?

If your application domain name pointed to laravel/public directory then your .env is already secured. Otherwise simply you add below code to your .htaccess file to set the permission of .env and composer.json file.

  <Files .env>
    Order allow,deny
    Deny from all
  </Files>

  <Files composer.json>
    Order allow,deny
    Deny from all
  </Files>

And below line for disabling directory browsing

Options All -Indexes
Activity icon

Replied to Maximum Execution Time Of 60 Seconds Exceeded

Increase your max execution time in your php.ini settings.

Activity icon

Replied to Gates Not Working In Controller And Routes

You have to use "===" not "=="

 public function boot()
{
    $this->registerPolicies();

     Gate::define('isAdmin', function($user){

        return $user->role === 'admin';
    });

     Gate::define('isArtisan', function($user){

        return $user->role === 'student';
    });

      Gate::define('isUser', function($user){

        return $user->role === 'user';
    });

       Gate::define('isRep', function($user){

        return $user->role === 'rep';
    });

}
May
10
4 months ago
Activity icon

Replied to DELETE 405 (Method Not Allowed)

Based on the information you have provided in the question I have suggested this fix

Route::delete('/management/site/{id}','[email protected]')->name('destroy');

However, you only know how many route groups above unless you show them to us. Anyway, you fixed it.

Activity icon

Replied to Time For Push Notifications!

Okay people like me don't want push notifications for all the emails I receive because most of my Gmail emails are spam. So having push notification for this forum will be a big plus to engage. However, we are also not receiving new thread emails( that would spam our inbox though) so we miss a lot of threats we could have answered this will cut down the volunteer contribution into half.

Activity icon

Replied to Where Are You All From?

Incredible India!

Activity icon

Replied to Counting Page Views

For your information. If you increment read count on the controller without any check then read count may not be accurate because people can refresh and increase it. So add cookie after visitor read then check for cookie in future. By this, you can have more accurate unique visits.

    public function show(Post $post)
    {
        if(Cookie::get($post->id)!=''){
		Cookie::set('$post->id', '1', 60);
		$post->incrementReadCount();
	}
        return view('post.show', compact($post));
    }

Activity icon

Started a new Conversation Time For Push Notifications!

Can we have browser-based push notifications for new threads and replies in threads? So we can work and watch this forum parallelly. Can't keep checking for new threads and replies.

Activity icon

Replied to Laravel Count With Relationship Fields

Just to make sure try this

$users = User::select([
            'id',
            'first_name',
            'last_name',
            'email',
            'graduate_year'
        ])
        ->where('graduate_year', 2015)
        ->withCount('classes', function ($query) {
                     $query->groupBy('classes.department_id');
                })->get();
Activity icon

Replied to "554 5.5.1 Error: No Valid Recipients" On Password Reset

@loomix Please follow the below steps. Ignore if already done.

  1. Go to https://www.smtper.net/ and test your SMTP credentials and use the same which works there.
  2. Configure .env and mail.php properly means use the correct variable names. For example dont use env('xyxyx') in mail.php change that to env('USERNAME') then in your .env file USERNAME=xyxyx.
  3. Finally, if the error comes, post the complete error in your log file here to help.(Replace credentials in error log before post)
Activity icon

Replied to Stripe How To Get Amount?

By seeing your code source must come to your controller. The only possible mistake you are doing could be make sure your form has

 <form id="payment-form" method="POST">

Also before submitting open your browser console and check form got appended with stripeToken hidden input. Post your blade file for further help.

Activity icon

Awarded Best Reply on How To Get A Sum Of Related Collumn

Try

$sum = $countsi->tasks()->where('t_status', 'started')->sum("t_hours");
Activity icon

Replied to "554 5.5.1 Error: No Valid Recipients" On Password Reset

If you using Google mail for laravel you need to enable less secure apps permission on your google account.

Activity icon

Replied to "554 5.5.1 Error: No Valid Recipients" On Password Reset

No both from address and username has to be full email address. Did you tested this smtp details on outlook or something? Is it working?

Activity icon

Replied to "554 5.5.1 Error: No Valid Recipients" On Password Reset

Your SMTP config mail username use full email address and try. Also update

      'username' => env('MAIL_USERNAME'),
      'password' => env('MAIL_PASSWORD'),   
Activity icon

Replied to Eloquent Adds "is Null" Condition To A Query And Messes The Results

Add this to your query

whereNotNull("column_name")
Activity icon

Replied to How To Get A Sum Of Related Collumn

Try

$sum = $countsi->tasks()->where('t_status', 'started')->sum("t_hours");
Activity icon

Replied to "554 5.5.1 Error: No Valid Recipients" On Password Reset

Open laravel.log and dig into that particular error. Every error will have 40 to 50 lines of description so in that email recipient and other details will be there in array format. So check recipient email present there correctly.

Activity icon

Replied to "554 5.5.1 Error: No Valid Recipients" On Password Reset

Error says invalid recipient which means the to address you are trying to send is not correctly passed to mail class. Try log the to address before you send and check it is correctly coming.

Activity icon

Replied to DELETE 405 (Method Not Allowed)

Your route should be

Route::delete('/management/site/{id}','[email protected]')->name('destroy')
Activity icon

Replied to Incoming Mail Recieved In Sub-domain Not In Main-domain Email Account

Not a laravel issue. However if you don't receive mail in your main domain on your Chanel check the MX records for the main domain are configured properly. Try login into web client and test there itself first then test from laravel.