rajcoder

Experience

10,810

0 Best Reply Awards

  • Member Since 8 Months Ago
  • 103 Lessons Completed
  • 0 Favorites

23rd September, 2018

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

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 • 15 hours ago

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?

17th September, 2018

rajcoder left a reply on Npm Install Giving Warnings • 6 days ago

@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 • 6 days ago

$ 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?

12th July, 2018

rajcoder left a reply on Dusk Test Not Working As Expected • 2 months ago

@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

11th July, 2018

rajcoder started a new conversation Dusk Test Not Working As Expected • 2 months ago

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 ?

25th March, 2018

rajcoder started a new conversation 403 Forbidden Error When Visiting Website • 5 months ago

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.

23rd March, 2018

rajcoder left a reply on Class Not Found Error • 6 months ago

I found the solution.

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

rajcoder started a new conversation Class Not Found Error • 6 months ago

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

2nd March, 2018

rajcoder left a reply on Many To Many Relationship: Method Latest Does Not Exists Error • 6 months ago

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 • 6 months ago

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 ?

8th January, 2018

rajcoder left a reply on How To Use Class Variables Across Methods Of A Class ? • 8 months ago

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 ? • 8 months ago

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 ?

6th January, 2018

rajcoder started a new conversation Ajax Post Request In Laravel • 8 months ago

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 ?

31st December, 2017

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

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 ?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.