rajcoder

rajcoder

Member Since 10 Months Ago

Experience Points 12,010
Experience
Level
Lessons Completed 114
Lessons
Completed
Best Reply Awards 0
Best Answer
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.

02 Nov
1 week ago

rajcoder started a new conversation What Package Is Used In The Markdown Editor Used In Laravel Nova?

I saw taylor otwell's presentation on Nova. In that presentation, he showed markdown field type. So what package did he use for the markdown editor which had 2 tabs - 1 for the markdown text and the other for the result/output. He also showed trix editor in that example but I want to know about the other markdown editor.

26 Sep
1 month ago

rajcoder started a new conversation Why To Use Envoyer For 0% Downtime?

I am currently using Forge and I noticed that when quick deploy is enabled then when I push code forge automatically deploys the new code on the server.

During deployment I can still access my website. So what's the use of using envoyer for 0% downtime? Am I missing something?

23 Sep
1 month ago

rajcoder left a reply on I Did Not Get Sudo Password And Database Password On Creating A Server In Forge

Oh Seems like an issue with forge. I had cancelled my plan few months back and today when I returned I directly provisioned a server without starting a plan in forge so that's why it showed null for sudo password.

Hope they change this and only give access to provision server when you have an active plan.

rajcoder started a new conversation I Did Not Get Sudo Password And Database Password On Creating A Server In Forge

I just provisioned a Digital Ocean server using forge. I saw in the Forge tutorial that a sudo password and database password are displayed in a popup and also emailed to you but the popup was empty and also I did not receive the email at all.

What should I do?

17 Sep
1 month ago

rajcoder left a reply on Npm Install Giving Warnings

@knubbe82 But will it not cause any problem or break something in the project? Do you also get these warning in your project?

rajcoder started a new conversation Npm Install Giving Warnings

$ npm install

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of [email protected]^6.0.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected]^5.0.0 but none was installed.

How to solve this?

12 Jul
4 months ago

rajcoder left a reply on Dusk Test Not Working As Expected

@shez1983 Thanks for mentioning the tearDown() method. But it does not seem right to logout a user as there may be cases where I am testing that on wrong credentials assertPathIs('/login') and then the tearDown() method tries to find logout link eg. clickLink('logout') and since I am at the login page itself there might be an error.

So can you suggest me what code should I have in my tearDown() method to destroy the current session of the user ?

Or somehow each test method runs as if it is a separate test

11 Jul
4 months ago

rajcoder started a new conversation Dusk Test Not Working As Expected

I am using dusk for testing and have encountered a problem.

I have a test functions in ExampleTest file.

In the test, I am creating a factory user and logging him through login form and asserting that user should see home. But this gives me error:

Actual path [/login] does not equal expected path [/home].

And in the screenshot I can see the login page with error:

These credentials do not match our records.

What is the problem ?

25 Mar
7 months ago

rajcoder started a new conversation 403 Forbidden Error When Visiting Website

I am getting 403 Forbidden error when visiting website.

When I checked the server directory structure through SSH, I found that my public directory is empty.

The site was working before but after I did the following things its not working now

  1. Created linked folder public <---> storage/app/public
  2. Manually created link through SSH by running php artisan storage:link

Thats it and now my public folder is empty.

How do I get it back ? I tried to redeploy to older deployments but still public folder is empty.

23 Mar
7 months ago

rajcoder left a reply on Class Not Found Error

I found the solution.

I had simply forgotten to include the word php after <?

rajcoder started a new conversation Class Not Found Error

Im using maatwebsite/excel package so according to its doc i created a class eg. PostsExport.php in app/Exports folder.

namespace Demo\Exports;

`use Demo\Post;

class PostsExport implements FromCollection { public function collection() { return Post::all(); } }`

And in my PostController i have the method

` use Demo\Exports\PostsExport; use Maatwebsite\Excel\Facades\Excel;

... ...

public function export() { return Excel::download(new PostsExport, 'posts.xlsx'); }`

But when i click download button the export method runs but gives error that Demo\Exports\PostsExport not found

02 Mar
8 months ago

rajcoder left a reply on Many To Many Relationship: Method Latest Does Not Exists Error

ok i changed it to $posts = $tag->posts()->where('user.name', 'ABC')->latest()->paginate(5);

still it gives method latest does not exists error.

without latest() it returns collection but it latest gives error

rajcoder started a new conversation Many To Many Relationship: Method Latest Does Not Exists Error

Latest and Paginate method does not work on the collection.

$tag = Tag::where('name', 'php')->first(); $posts = $tag->posts->where('user.name', 'ABC')->latest()->paginate(5);

Here it gives error: Method latest does not exists.

How to solve this problem ?

08 Jan
10 months ago

rajcoder left a reply on How To Use Class Variables Across Methods Of A Class ?

But update function does not have access to those variables in $request but i want to use them. Is there a way by which i can store the $request variable that i receive in store method and use it in update method ?

rajcoder started a new conversation How To Use Class Variables Across Methods Of A Class ?

Lets say i have a controller with two methods. create() which stores a value in the class variable update() that makes use of the modified class variable

class DemoControlller extends Controller { public name;

public function create(Request $request)
    {
    $this->name = $request->name;
}

public function update(Request $request)
    {
    dd($this->name);
}

}

When create is called the value gets stored in name variable properly, But when update() is called i get null value.

How to use the name class variable across all methods ?

06 Jan
10 months ago

rajcoder started a new conversation Ajax Post Request In Laravel

Im sending a ajax request from demo/create page to /ajaxdemo page with calls a controller method ajaxpost where im inserting data which i have sent.

But the data is not inserted and the current page simply reloads and displays token in the URL.

What can be the reason for this ?

31 Dec
10 months ago

rajcoder started a new conversation How To Use Where Clause On Data Which Is Eager Loaded ?

This is my code

$users = User::with('admin')->where('role', 'super_admin') ->where(function ($query) use($keyword){ $query->where('id', 'LIKE', "%$keyword%") ->orWhere('email', 'LIKE', "%$keyword%") ->orWhere('name', 'LIKE', "%$keyword%")

                    ->orWhere($this->admin->status, 'LIKE', "%$keyword%");

        })->paginate($perPage);

This throws an error undefined property admin

Due to this line ->orWhere($this->admin->status, 'LIKE', "%$keyword%");

So how can i use admin's status column in filtering data ?