Spiral

Member Since 11 Months Ago

Experience Points
7,290
Total
Experience

2,710 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
12
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.

  • Community Pillar

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

Level 2
7,290 XP
Feb
27
1 day ago
Activity icon

Replied to How Can Insert Fake Array Of Object With Values

Thanks a lot, dear @tykus for helping me... But giving issue with mapping

Giving syntax error after mapping the requests

$category = Category::where('id', $request->category_id)->with('requests')->first();
$result = array_merge([
        'info' => [
            'name' => $category->name,
        ],
        'item' => [
            [
                'requests' => $category->requests->mapWithKeys(function ($request) {
                    'name' => $request->name,     ==> here why giving me syntax error
                    'request' => [
                        'method' => $request->type,
                        'url' => [
                            'raw' => $request->url,
                            'query' => [
                                    'key' => $request->type,
                                    'value' =>  $request->url,
                            ],
                        ],
                    ],
                })->all();
            ],
        ],
    ]);
\Log::info($result);
Feb
26
2 days ago
Activity icon

Replied to What Is The Best Practice To Persist Auth User Info In SPA?

You can make a helper in vue

 // Setting bearer token for the api calls
    setUser(user) {

        localStorage.removeItem('getUser');

        localStorage.setItem('getUser', user); // store the token in localstorage
    },// Setting bearer token for the api calls
    setUserId(id) {

        localStorage.removeItem('getUserId');

        localStorage.setItem('getUserId', id); // store the token in localstorage
    },
    setRole(role) {

        localStorage.removeItem('getRole');

        localStorage.setItem('getRole', role); // store the token in localstorage
    },

and You can use in a component when logged in the user

axios.post('/api/login', this.$data)
				.then(res => {
                        this.setUser(res.data.data.access_token);
                        axios.defaults.headers.common['Authorization'] = localStorage.getItem('getUser')
                        this.setUserId(res.data.data.user.id);
                        this.setProfileImage(res.data.data.user.image);
                        this.setRole(res.data.data.role);
                        this.$router.push('/dashboard')
				})
				.catch(error => {
					this.errors = error.response.data.msg;
				})
Activity icon

Replied to How Can Insert Fake Array Of Object With Values

Thanks a lot dear @tykus Your POC is working according to my requirement But I have one more issue how can use foreach loop in the array_merge method because one category will have many requests which I will assign

mean I want to like this

$category = Category::where('id', $request->product_id)->with('requests')->first();
return response()->json(
    array_merge([
        'category' => [
            'item' => [
                [
                    'name' => $category->name,
                    foreach ($category->requests as $request) {
                    	'request' => [
	                        'method' => $requests->name,
	                        'url' => [
	                            'raw' => $requests->url,
	                            'query' => $requests->query,
	                        ],
	                    ],
                    },
                ],
            ],
        ]
    ], $category->toArray())
);
Feb
25
3 days ago
Activity icon

Replied to How Can Insert Fake Array Of Object With Values

@tykus have you reach my point of view I have JSON response but I want to add fake array object and in fake object I will assign some value from the real object like from $category

Activity icon

Replied to How Can Insert Fake Array Of Object With Values

No Brother I did not create an Eloquent Resource yet

Activity icon

Replied to How To Validate Request Using Ajax?

Controller 


use Validator;

$validator = Validator::make($request->all(), [
            'body' => 'required'
        ]);


        if ($validator->passes()) {

			$reply->update([
            'body'=> $request->body
        ]);
			return response()->json(['success'=>'Added new records.']);
        }


    	return response()->json(['error'=>$validator->errors()->all()]);


Blade 

<div class="alert alert-danger print-error-msg" style="display:none">
        <ul></ul>
    </div>

function printErrorMsg (msg) {
            $(".print-error-msg").find("ul").html('');
            $(".print-error-msg").css('display','block');
            $.each( msg, function( key, value ) {
                $(".print-error-msg").find("ul").append('<li>'+value+'</li>');
            });
        }


Activity icon

Replied to How Can Insert Fake Array Of Object With Values

Thanks, @tykus for replying to me...

Yes this is API response & I want to add a fake item so that I could set category value to the item name

I'm showing an example that I want to add like this so showing you in JSON format because after assignI will set this into JSON format

like I want to assign category information in the fake object of the item

"item": [
		{
			"name": "Get",                  here ====> $category->name
			"request": {
				"method": "GET",          here   ===> $category->request['method']
				"url": {
					"raw": "http://127.0.0.1:8000/",
					"query": [
						{
							"key": "product_id",
							"value": "1"
						}
					]
				}
			},
		}
	]
Activity icon

Started a new Conversation How Can Insert Fake Array Of Object With Values

I have an object How can put fake object so that on the response will get these object from the object

$category = Category::where('id', $request->product_id)->with('images')->first();

giving me in response

"category": {	
	"id":1,
	"name":"Cat Category",
	"product_id":1,
	"created_by":1,
	"created_at":null,
	"updated_at":null,
	"imges":[ ]
}

I want to insert fake objects in a category like $category['info']['name'] after that the category object will this type of object you can see below

"category": {	
	"item": [
		{
			"name": "Get",
			"request": {
				"method": "GET",
				"url": {
					"raw": "http://127.0.0.1:8000/",
					"query": [
						{
							"key": "product_id",
							"value": "1"
						}
					]
				}
			},
		}
	]
	"id":1,
	"name":"Cat Category",
	"product_id":1,
	"created_by":1,
	"created_at":null,
	"updated_at":null,
	"imges":[ ]
}

then I will access item object like $category['item']['name'] or $category['item']['name']['request']['method']

Feb
24
4 days ago
Activity icon

Replied to Custom Pagination With Limit & Offset

Can you give me an example or link where I will get the concept and put the query in project

Activity icon

Replied to Custom Pagination With Limit & Offset

Yes, @michaloravec dear.. You are right if the developer want to get more 10 records for clicking the show more then I will give him more 10 with offset 10 records

Activity icon

Replied to Custom Pagination With Limit & Offset

React developer want 10 records from me on the first time whereas I have 100 of records in the database but want to send 10 records first time after if he clicks show more 10 records then I will give 10 records with existing 10 from the database.

we did not want to send more data from the backend when the frontend did not want to if he wants then will send 10 more whatever

Brother, maybe now you can find my logic that I want

Feb
23
5 days ago
Activity icon

Replied to Custom Pagination With Limit & Offset

@tykus bro.. I'm making this on the API side and want to send it to the react developer from the backend if he will click the show more then I will give more than 10 from the database

Activity icon

Replied to Custom Pagination With Limit & Offset

@tykus Yes Bro.. You are right i want to like this pagination.. Can you give me a solution or snippet so that solves my problem

Activity icon

Replied to Custom Pagination With Limit & Offset

@chaudigv Brother, I want to make custom pagination and send in JSON response so that user will have only 10 records if click show more with model id then I send more 10 from the database

Activity icon

Replied to Custom Pagination With Limit & Offset

@jtemple042996 Thanks brother for replying...

======

I want not to use model pagination I want to use custom pagination in laravel because I have 1000 records in the database I want to show only 10 records limit if user click for more show then I want show more 10 records then will show 20

Activity icon

Started a new Conversation Custom Pagination With Limit & Offset

Hi!

I have 100 records in the database. I want to show per page 10 if the user click on the show more then I will give him 10 more records with the existing 10 records with limit & offset

plz give me a solution so or link wherefrom I could solve my problem

Feb
20
1 week ago
Activity icon

Replied to Data Not Getting From Second Foreach Loop

Thanks, Dear @michaloravec You have solved my problem. Thanks again

Activity icon

Replied to Data Not Getting From Second Foreach Loop

Thanks, @michaloravec for replying me.. I have used eager loading but I want also to search from task with eager loading not working, can you give me a solution

You see my code with eager loading

// Controller Method
$workspaces = auth()->user()->workspaces;
$task_name = $request->get('task_name');
foreach ($workspaces as $workspace) {
    $lists = Lists::whereHas('tasks', function ($query) use ($task_name, $request) {
                    $query = $query->where('t_name', 'like', "%" . $task_name . "%")
                              ->where('completion', 'like', "%" . $request->completion . "%");
                    return $query;
                })
                ->where('workspace_id' , $workspace->id)
                ->where('listable_type', 'Task')
                ->with('tasks')
                ->get();  
    $workspace->workspaceLists = $lists;         
}

return $worksapces;

// Model Functions
public function tasks()
{
    return $this->hasMany(Task::class, 'task_list_id');
}
Activity icon

Started a new Conversation Data Not Getting From Second Foreach Loop

I have two loops where I'm passing data with the objects from the first loop getting data from the object but in the second loop not coming object which I passing to the object

You can see my code

$workspaces = auth()->user()->workspaces;

foreach ($workspaces as $workspace) {

    $lists = Lists::where('workspace_id' , $workspace->id)
                    ->where('listable_type', 'Task')
                    ->get();

    $workspace->workspaceLists = $lists;

    foreach ($workspace->workspaceLists as $list) {

        $tasks = Task::where('task_list_id', $list->id)->get();

        $workspace->workspaceLists->listTasks = $tasks;     ==>here not sending tasks object in listsTasks fake object
    }            
}
return $workspaces;
Feb
03
3 weeks ago
Activity icon

Replied to How Can Get Accessors In Joins

I have use the query & working correct but I have lot of data in object with relation table which are taking time on frontend application so I want to add selected data from different table

Activity icon

Replied to How Can Get Accessors In Joins

Thanks, @tykus .. Can you give me solution about that how can use for URL because I want to send it to frontend developer picture full URL or other attributes with changing

Activity icon

Started a new Conversation How Can Get Accessors In Joins

I want to send accessors in listing how can I send model accessor in join query

Model Function accessor

protected $appends = ['profilePictureFullUrl'];
    
public function getProfilePictureFullUrlAttribute(){
    $default = "pictures/avatar.png";
    if(!empty($this->profile_picture)){
        return url('/')."/".$this->profile_picture;
    }
    return url('/')."/".$default;
}

Controller Join

$comments = DB::table('applications')
            ->join('comments', 'comments.application_id', '=',  'applications.id' )
            ->join('users', 'users.id', '=', 'comments.created_by')
            ->join('user_meta', 'user_meta.user_id', '=', 'users.id', function($join) {
                $join->profilePictureFullUrl;     ===> here not working accessor
            })
            ->get();
Feb
02
3 weeks ago
Activity icon

Replied to Value Not Giving From Collection

Thanks! Dear @michaloravec for helping. I have solved my problem with your help

Feb
01
3 weeks ago
Activity icon

Started a new Conversation Value Not Giving From Collection

I want to push selected member in user object but not working can you give me solution.. Can you solve me code issue

$job = Job::query()->find($id);

$slugs =  ['team-member', 'account-holder', 'other'];
$all_members = \App\Models\SentinelUser::wherehas('roles', function ($q) use ($slugs) {
        $q->whereIn('slug', $slugs);
    })->with(['meta','roles'])->get();

$new_members = [];

foreach ($all_members as $user ) {

	$user->selected  = $job->members->has($user->id) ? 1 : 0 ;
	array_push($new_members,  $user); 

}
return response[
	'members' =>  $new_members
];

user selected value giving always 0 where as I have also 1 value but giving all 0

Jan
31
4 weeks ago
Activity icon

Replied to How Can Use A Custom Callback Ajax Function In Datatables

Will solve your problem

<script>
        $(document).ready(function(){
            var columns = [
                {   data: 'DT_RowIndex', 
                    name: 'DT_RowIndex'
                },
                { 
                    data: 'first_name', 
                    name: 'first_name', 
                    searchable: true 
                },
                { 
                    data: 'email', 
                    name: 'email', 
                    searchable: true,  
                },
                { 
                    data: 'residing_country', 
                    name: 'residing_country', 
                    searchable: true,  
                },
                { 
                    data: 'target_country', 
                    name: 'target_country', 
                    searchable: true, 
                }
            ];

            columns.push({
                    data: 'rating', 
                    name: 'rating',
                    orderable: true,
                    searchable: "false",                     
                    className: "td_align"
                });
            columns.push({
                    data: 'is_active', 
                    name: 'is_active',
                    orderable: true,
                    searchable: "true",                     
                    className: "td_align",

                });
            columns.push({
                    data: 'action', 
                    name: 'action',                      
                    orderable: false,
                    searchable: "false",
                    className: "td_align"
                });
            $('#consultant-table').DataTable({                
                processing: true,
                serverSide: true,                                                 
                ajax: {
                    url: '{{ route('admin.consultant.dt') }}',
                },
                columns: columns,
                drawCallback: function(data) {
                    var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));

                      elems.forEach(function(html) {
                          var switchery = new Switchery(html,  { size: 'small' });
                      });
                    $('.js-switch').change(function () {
                        let is_active = $(this).prop('checked') === true ? 1 : 0;
                        let id = $(this).data('id');
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '{{ route('admin.consultant.update_status') }}',
                            data: {'is_active': is_active, 'id': id},
                            success: function (data) {
                                toastr.options.closeButton = true;
                                toastr.options.closeMethod = 'fadeOut';
                                toastr.options.closeDuration = 100;
                                toastr.success(data.message);
                            }
                        });
                    });
                },
            });                                                           
        });
    </script>
Jan
18
1 month ago
Activity icon

Started a new Conversation 'mix' Is Not Recognized As An Internal Or External Command, In Laravel 8 New Installation

'mix' is not recognized as an internal or external command, in laravel 8 new installation

on npm run dev

$ npm run dev

> @ dev E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_blog
> npm run development


> @ development E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_blog
> mix

'mix' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `mix`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs21-01-18T16_22_38_439Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs21-01-18T16_22_38_470Z-debug.log
Activity icon

Started a new Conversation The Mix Manifest Does Not Exist. On Laravel New Installation

I have new installation and using jetstram giving me this issue you can check in image

https://imgur.com/4juMYJk

I have installed

composer require laravel/jetstream 
php artisan jetstream:install livewire 
npm install

On npm run dev giving logs issue

[email protected] MINGW64 /e/wamp64/www/Laravel8Projects/Laravel_Livewire_JetStream_Projects/jetstream_blog
$ npm run dev

> @ dev E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_blog
> npm run development


> @ development E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_blog
> mix

'mix' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `mix`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs21-01-18T13_22_31_264Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs21-01-18T13_22_31_295Z-debug.log

packages.json file

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.2.1",
        "@tailwindcss/typography": "^0.3.0",
        "alpinejs": "^2.7.3",
        "autoprefixer": "^10.0.2",
        "axios": "^0.21",
        "cross-env": "^7.0.3",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "postcss-import": "^12.0.1",
        "tailwindcss": "^2.0.1"
    }
}
Activity icon

Replied to Giving Logs Issue On Fresh Installation Of Laravel With Jetstream Livewire

rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install

I have try these command many time but not luck

Activity icon

Replied to Giving Logs Issue On Fresh Installation Of Laravel With Jetstream Livewire

Yes I have remove node_modules many time and run again npm install but not solving this issue giving same issue

Activity icon

Replied to Giving Logs Issue On Fresh Installation Of Laravel With Jetstream Livewire

Thanks, brother for replying to me...

You can check my package.json file

    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.2.1",
        "@tailwindcss/typography": "^0.3.0",
        "alpinejs": "^2.7.3",
        "autoprefixer": "^10.0.2",
        "axios": "^0.21",
        "cross-env": "^7.0.3",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "postcss-import": "^12.0.1",
        "tailwindcss": "^2.0.1"
    }
}
Activity icon

Started a new Conversation Giving Logs Issue On Fresh Installation Of Laravel With Jetstream Livewire

I have installed new project then

composer require laravel/jetstream php artisan jetstream:install livewire npm install when I run then npm run dev then giving this issue can you explain me why giving this issue

[email protected] MINGW64 /e/wamp64/www/Laravel8Projects/Laravel_Livewire_JetStream_Projects/jetstream_blog
$ npm run dev

> @ dev E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_blog
> npm run development


> @ development E:\wamp64\www\Laravel8Projects\Laravel_Livewire_JetStream_Projects\jetstream_blog
> mix

'mix' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `mix`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs21-01-18T13_22_31_264Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs21-01-18T13_22_31_295Z-debug.log
Dec
09
2 months ago
Activity icon

Started a new Conversation How Can Move Old Table Data Into New Table With Command/route

I have a website that is in production. How can move old table data into newly created data?

plz, give me a solution.

Can I move old data with command or route?

Dec
07
2 months ago
Activity icon

Replied to How Can Append New Data In Existing Data

@tisuchi Thanks for replying to me... Bro, I want a concept that not delete my live values which giving in the dropdown, I want to add new values in this without deleting the old values... from another table which I create for the only dropdown & append this in existing dropdown values

Activity icon

Started a new Conversation How Can Append New Data In Existing Data

I have a live website. I want to append new data to existing data. without deleting the existing data.

I have a dropdown in which giving values & I have to create a table for this & append this in existing dropdown value without removing existing values

Plz give me a solution...

Nov
01
3 months ago
Activity icon

Started a new Conversation Sentinel::findByCredentials($credentials); Giving Empty Value

$credentials = [
            'email' => $request->email
        ];
$user = Sentinel::findByCredentials($credentials);

Giving empty value in $user object

Oct
27
4 months ago
Activity icon

Replied to Tymon/jwt-auth For Authentication Not Working In Laravel V8

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.0",
        "laravel/tinker": "^2.0",
        "tymon/jwt-auth": "^1.0",
        "zizaco/entrust": "^1.9"
    },
    "require-dev": {
        "facade/ignition": "^2.3.6",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\": "app/",
            "Database\Factories\": "database/factories/",
            "Database\Seeders\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

Activity icon

Replied to Tymon/jwt-auth For Authentication Not Working In Laravel V8

This command running successfully but not creating jwt.php file in config folder

Activity icon

Replied to Tymon/jwt-auth For Authentication Not Working In Laravel V8

Then php artisan jwt:secret not working giving error

 There are no commands defined in the "jwt" namespace.
Activity icon

Replied to Tymon/jwt-auth For Authentication Not Working In Laravel V8

Yes bro.. i have installed "^1.0" installed successfully but after publish the provider and generate secret key not working...

config/app.php
$provider = [
	Tymon\JWTAuth\Providers\LaravelServiceProvider::class,
 ]

php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"

php artisan jwt:secret
Activity icon

Started a new Conversation Tymon/jwt-auth For Authentication Not Working In Laravel V8

I have installed tymon/jwt-auth version "^1.0" in Laravel version 8. After install publish not working and giving error

In ProviderRepository.php line 208:

  Class 'Tymon\JWTAuth\Providers\LaravelServiceProvider' not found

Can you give me the solution so that I can solve my problem

Oct
06
4 months ago
Activity icon

Replied to Why Are Coming All Checkboxes With Checked Value Where As Some Are Checked

Well..I'm reading from laravel documentations Can you give example from my code which table I will use withpivot & how can call this in blade.. plz give me example

Activity icon

Replied to Why Are Coming All Checkboxes With Checked Value Where As Some Are Checked

ProductUser is a pivot table in which project_id, user_id, is_active attribute

Both Models Project & users have belongsToMany Relationship

I want to get is_active attribute from the pivot table where I'm saving request data

Activity icon

Replied to Why Are Coming All Checkboxes With Checked Value Where As Some Are Checked

Thanks, @snapey for replying me...

I have a table in which I have product_id, user_id & is_active attributes when clicking on any checkbox then in request sending product_id,user_id & is_active will 1 with the help of ajax request

I want to show checked checkboxes that the admin will see that how many users I have send notification

Activity icon

Started a new Conversation Why Are Coming All Checkboxes With Checked Value Where As Some Are Checked

You can see my code I don't understand that's why are coming to all checkboxes with checked value whereas all checkboxes are checked

You can see...

Controller Code

public function showProduct($product_id, Request $request)
{
	$users = User::query()->get();
	foreach ($users as $user) {
            $products = ProductUser::where('product_id', $product_id)
                                        ->where('user_id', $user->id)
                                        ->get();
        }

    return view('products.show', compact('products', 'users'));
}

Blade Code

<div class="modal fade myModal" id="producttUsers">
    <div class="modal-dialog modal-dialog-300">
        <div class="modal-content ">
            <div class="modal-header">
                <h4 class="modal-title">Send Product Active Notification</h4>
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            </div>
            <div class="modal-body">                    
                @foreach($users as $user)
                    @foreach($products as $product)                
                        <div class="custom-control1">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" class="custom-control-input" name="is_active" {{ @$product->is_active == 1 ? 'checked' : '' }}>
                                   {{ $user->name }}
                                </label>
                            </div>
                        </div>
                    @endforeach                                  
                @endforeach
            </div>
        </div>
    </div>
</div>
Activity icon

Replied to How To Add New Value To Database Column Without Deleting Old Data In Laravel

Thanks a lot, @tykus bro... for helping me I have solved my email problem after that I will move on the listing area and will delete one by one from the column...