Spiral

Spiral

Member Since 4 Months Ago

Experience Points
5,230
Total
Experience

4,770 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
10
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 2
5,230 XP
Jul
04
1 week ago
Jul
01
1 week ago
Activity icon

Started a new Conversation Allowed Memory Size Of 1610612736 Bytes Exhausted (tried To Allocate 4096 Bytes)

I have changed memory_limit = 128M to memory_limit = 1G but getting same error

How can fix this plz give me the solution

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

E:\wamp64\www>php -r "echo ini_get('memory_limit').PHP_EOL;"
1G
Jun
29
1 week ago
Activity icon

Replied to Anybody Have Specialization In Swagger For Api Docs I Have A Question

Creating different Swagger docs is perfectly acceptable. You could do a single doc and prefix things by section and ability or just use separate docs as you are doing. Neither is a problem or best practice imo.

Can you provide me plateform or code so that i will solve my problem with the help of you as you are saying same i want

Activity icon

Replied to Anybody Have Specialization In Swagger For Api Docs I Have A Question

Trying the best process so that you understand the my question

  1. I have a project in laravel apis

  2. These laravel Apis are for different services/client e.g integrated some services/company in this project

  3. I have all Apis in one swagger.json file

  4. Some Apis which no need for some services/Companies which are integrated so that i want to provide only their need Apis

  5. As well as i want to provide only these Apis docs in swagger which they want not other services Apis

bro I will my best try that you wil understand

Activity icon

Replied to Anybody Have Specialization In Swagger For Api Docs I Have A Question

Copy you awnser which i want Creating different Swagger docs is perfectly acceptable. You could do a single doc and prefix things by section and ability or just use separate docs as you are doing. Neither is a problem or best practice imo.

Yes bro i want Multiple Swagger Api Documents for a one project because in this project has integrated with different client and services

so i want to provide different api docs for different services client so that they will only see their docs

Jun
28
1 week ago
Activity icon

Replied to [Vue Warn]: Error In Render: "TypeError: Cannot Read Property 'length' Of Undefined"

Bro i want to say that products.total is working but not proper

when delete all the list in the table show properly but when add one list in the table then still showing in the below of the table but when i refresh the page then remove other wise still below the table

Activity icon

Replied to Anybody Have Specialization In Swagger For Api Docs I Have A Question

Thanks @fylzero brother you replyed me...

Can you give me the example

Bro i have multiple end points in the project mean client, vendor, candidate have different end points

i want to make different docs for client so that i will provide to an other only client end point docs

same as vendor and candidate

these are endpoints are in the same project but i want to make different docs of these apis so that candidate will only see their docs and use

same as vendor will see only their swagger docs and use

same as candidate will see anly candidate swagger docs and use

Plz can you help me in deep so that i will make these work

Thanks in advance @fylzero

http://example.com/swagger/ClientOperations.json
http://example.com/swagger/CandidateOperations.json
http://example.com/swagger/PublicOperations.json
Jun
27
2 weeks ago
Activity icon

Started a new Conversation Anybody Have Specialization In Swagger For Api Docs I Have A Question

Hi!

I want to make api document for multiple client with the help of swagger UI

i have api's and want some api can access for public and some will private client and they will access only their api's endpoint and will use

Can you give me the best suggestion or example so that could solve my problem with the help of you

Thanks in advance

Activity icon

Replied to [Vue Warn]: Error In Render: "TypeError: Cannot Read Property 'length' Of Undefined"

Thanks bro replying me ..

Working not properly because error is gone but one issue coming when the talblelist have not data then show no data fount but when add the data then also showing no data found below the table after refresh the page then go

Jun
26
2 weeks ago
Activity icon

Replied to [Vue Warn]: Error In Render: "TypeError: Cannot Read Property 'length' Of Undefined"

<template>
  <table class="table table-bordered table-hover">
    <thead>
      <tr>
         <th>Title</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="(product,key) in products.data">
        <td>{{ product.title }}</td>
      </tr>
      <tr class="text-center" v-if="products.data.length <= 0">
        <td colspan="12">No data found</td>
      </tr>
    </tbody>
  </table>
  <pagination :data="products" :limit="1" @pagination-change-page="getResults"></pagination>
</template>
<script>
    export default {
        mounted() {
          this.getResults()
        },
        data(){
            return{
              products:{},
            }
        },
        methods: {
            getResults(page = 1) {
                let _this = this;
                axios.get('/admin/products/index', {
                      params: {
                          page: page,
                      }
                  })
                    .then(response => {
                        _this.products = response.data.products;
                    })
                    .catch(response => {
                        this.errors = response.errors;
                        console.log(response);
                    });
            }
        }
    }
</script>
Jun
25
2 weeks ago
Activity icon

Replied to [Vue Warn]: Error In Render: "TypeError: Cannot Read Property 'length' Of Undefined"

Thanks @bobbybouwmann bro for replying me

i have pagination on table using vue js pagination plugin and when used paginate from backend that will send response.data.products.data

length property is working but in console getting error length is undefind property

Activity icon

Started a new Conversation [Vue Warn]: Error In Render: "TypeError: Cannot Read Property 'length' Of Undefined"

<table class="table table-bordered table-hover">
  <thead>
    <tr>
       <th>Title</th>
    </tr>
  </thead>
  <tbody>
    <tr v-for="(product,key) in products.data">
      <td>{{ product.title }}</td>
    </tr>
    <tr class="text-center" v-if="products.data.length <= 0">
      <td colspan="12">No data found</td>
    </tr>
  </tbody>
</table>
Jun
24
2 weeks ago
Activity icon

Replied to Laravel Accessor Attribute Not Working In Vuejs Template

Thanks @nakov for replying me this code working for me


public function getStartDateAttribute($value)
{
    return Carbon::parse($value)->format('d/m/Y');
}

Bro one more issue is that i have use vue2-datepicker when edit the the specific product then other are showing in input field only date not showing why that where as i sending in accessor but not luck

Can you help about this

Vue js script

<date-picker 
                        style="width: 330px;"                       
                        input-class="form-control"
                        type="date"
                        autocomplete="off"
                        lang="en"
                        format="DD-MM-YYYY"
                        name="start_date"
                        v-model="start_date">                            
                      </date-picker>


editRecord(product) {
                console.log(product);
                let _this = this;
                _this.id = product.id
                _this.title = product.title;
                _this.start_date= product.start_date;
                _this.description = product.description;
            },
Activity icon

Started a new Conversation Laravel Accessor Attribute Not Working In Vuejs Template

i have parsed date in laravel accessor and view on vue template page but showing invalid date on list attribute

You can see my code

Laravel Code

protected $appends = ['date'];

public function getDueDateAttribute()
    {
        return Carbon::parse($this->attributes['date'])->format('d/m/yy');
    }

Vue Code

<tr v-for="(product,key) in products.data">
  <td>{{ product.due_date | formatDate }}</td>
</tr>
Activity icon

Started a new Conversation Vue2-datepicker Date Not Showing The On Edit Page

I'm taking date from database on edit page but not showing in the input field

Can you give me the solution what is missing from me other data giving in their input but only data not getting

getting response in this format 2020-06-26 00:00:00

editRecord(product) {
                console.log(product);
                _this.id = product.id
                _this.title = product.title;
                _this.due_date = product.due_date;
                _this.description = product.description;
            },
Activity icon

Replied to How Can Change The Database Status Value With Vue-js-toggle-button Plugin

Thanks bro for helping me i have saved the status value in database with true & false condition but i want to save in 1 and 0 form because event.value giving me true and false condtion

i have put condition but not luck you can check my condition

<toggle-button 
  @change="onChangeEventHandler(product, $event)" 
  :labels="{checked: 'Completed', unchecked: 'Open'}" 
  style="margin-left: 20px"/>

<script>
	export default {
		data(){
            return{
              status: 0,
              products:{},
            }
        },
        methods: {
            onChangeEventHandler(product, event) {
               let _this = this;
               const config = { headers: { 'Content-Type': 'multipart/form-data' } };
               // if (event.value == true) {
               //    return event.value== 1;
               // }  event.value == 0;

               this.formData.append('id', product.id);
               this.formData.append('status', event.value);
               axios.post('/admin/product/status', this.formData, config)
                .then(response => { 
                  if (response.data.success) {
                    _this.product = response.data.product;
                    console.log(_this.product);
                    this.$toasted.show('Status updated successfully!');
                  }                      
                })
                .catch(response => {
                    console.log('error');
                });              
            },
        }    
	}		
</script>
Activity icon

Started a new Conversation How Can Send Data Without Using Formdata.append Functionality

I want to send the data in an object without using formdata.append functionality because when i have lot of values then will append any value before send axios http request

Can you give me the solution that i will send in one object

You can see my code and give me the example from my code

<script>
	export default {
		data(){
            return{
                title: '',
                date: '',
                description: '',
                status: '',
                products:{},
            }
        },
        methods: {
            saveProduct(){
                const config = { headers: { 'Content-Type': 'multipart/form-data' } };
                this.formData.append('title', this.title);
                this.formData.append('date', this.date);
                this.formData.append('description', this.description);
                this.formData.append('status', this.status);
                this.formData.append('_token', this.csrfToken);

                axios.post('/admin/products', this.formData,config).then(function (response) {
                        this.products.data = response.data.products;
                }).catch(function (response) {
                    console.log(response);
                })
            },
        }    
	}		
</script>
Jun
23
2 weeks ago
Activity icon

Replied to How Can Change The Database Status Value With Vue-js-toggle-button Plugin

Thanks @willvincent bro for replying me..

Bro i have issue in the response when hit the backend route then not hitting the route

Can you give me solution from my code you can see below my vuejs & laravel code

Laravel Script

Route:
Route::put('admin/product/status', '[email protected]');

Controller Method:
public function updateStatus(Request $request)
{
    $product      = Product::findOrFail($request->id);
    $product->status = $request->status;
    $product->save();
    
    return response()->json([
        'success' => true,
        'product' => $product,
    ]);
}

Vue Script

<toggle-button 
  @change="onChangeEventHandler(product, $event)" 
  :labels="{checked: 'Completed', unchecked: 'Open'}" 
  style="margin-left: 20px"/>

<script>
	export default {
		data(){
            return{
              status: 0,
              products:{},
            }
        },
        methods: {
            onChangeEventHandler(product, event) { 
               axios.put(`/admin/product/status/${ product.id }`)
                .then(response => {
                    console.log(response);
                    let value = event.value;  
                    console.log(value);
                })
                .catch(response => {
                    console.log('error');
                });              
            },
        }    
	}		
</script>
Jun
22
2 weeks ago
Activity icon

Started a new Conversation How Can Change The Database Status Value With Vue-js-toggle-button Plugin

Hi!

I have a list of products as table with status attribute which have Active & InAtive value in database and getting response from backend in laravel to vue js

i want that the status will save with toggle functionality with the help of vue-js-toggle-button plugin Can you check my below code and give me the solution so that i could complete this

How can manage from frontend in vue js

<table class="table table-bordered table-hover">
 <thead>
   <tr>
       <th class="text-center">Status</th>
   </tr>
 </thead>
 <tbody>
   <tr v-for="(product,key) in products">
       <td class="text-center">
        <!-- <span v-if="product.status == 1" class="label label-success">Completed</span>
        <span v-else="product.status == 0" class="label label-danger">Open</span> -->
        <toggle-button @change="onChangeEventHandler" :labels="{checked: 'Completed', unchecked: 'Open'}" style="margin-left: 20px" width="80" />
        </td>
   </tr>
 </tbody>
</table>

<script>
  export default { 
    data(){
      return{
        status: '',
        products:{},
      }
    },
    methods: {
      onChangeEventHandler(){
        alert('hi');
      }
    }            
  }
</script>
Jun
20
3 weeks ago
Activity icon

Replied to Invalid Prop: Type Check Failed For Prop "data". Expected Object, Got Array

Thanks @frankielee bro replying me

Bro you can give me an example How can make jobs an object

data(){
            return{
              jobs:{}
            }
        }
Activity icon

Started a new Conversation Invalid Prop: Type Check Failed For Prop "data". Expected Object, Got Array

I'm using laravel-vue-pagination getting this error Invalid prop: type check failed for prop "data". Expected Object, got Array

code is

<template>
  <table class="table table-bordered table-hover">
     <thead>
       <tr>
           <th>Title</th>
       </tr>
      </thead>
      <tbody>
       <tr v-for="(job,key) in jobs">
           <td>{{ job.title }}</td>
       </tr>
     </tbody>
   </table>
   <pagination :data="jobs" :limit="1" @pagination-change-page="getResults"></pagination>
 </template>
<script>
	getResults(page = 1) {               
                let _this = this;
                axios.get('/admin/jobs/create', {
                      params: {
                          page: page,
                      }
                  })
                    .then(response => {
                        _this.jobs = response.data.jobs.data;
                    })
                    .catch(response => {
                        this.errors = response.errors;
                        console.log(response);
                    });
            },
</script>
Activity icon

Replied to Vue Js Datepicker Not Formating

i'm using vuejs-datepicker how can change its format for save in mysql database because mysql date format is different from vuejs-datepicker

mysql database datepicker Format 2020-15-03

where as in vuejs datepicker format getting Could not parse 'Thu Jun 25 2020 15:31:00 GMT+0500 (Pakistan Standard Time)

Activity icon

Replied to Vue Js Datepicker Not Formating

Thanks @bobbybouwmann bro for replyming me

Getting same error Could not parse 'Thu Jun 25 2020 15:31:00 GMT+0500 (Pakistan Standard Time)

when use

customDateFormat(date) {
    return moment(date).format("MM-DD-YYYY")
}
Activity icon

Replied to Pagination Not Working In Vue Js

@sergiu17 bro then getting this error Cannot read property 'title' of null

<tr v-for="(job,key) in jobs">
       <td>{{ job.title }}</td>
       <td v-if="job.user">{{ job.user.first_name }} {{ job.user.last_name }}</td>   
       <td>{{ job.birt_date | formatDate }}</td>
   </tr>
Activity icon

Replied to Pagination Not Working In Vue Js

Thanks @sergiu17 brother for replying..

I have an object user in the jobs but when put pagination then get this error which is attach with the user object

Can you give me the solution when have object with in the object how can manage in vue js when put pagination

Activity icon

Started a new Conversation Pagination Not Working In Vue Js

i'm using vuejs plugin pagination for paginate the list but getting error You can see this Cannot read property "first name" undefined

my vue js code is

<table v-if="type=='list'" class="table table-bordered table-hover">
   <thead>
   <tr>
       <th>Title</th>
       <th>User</th>
       <th>Birth Date</th>
   </tr>
   </thead>
   <tbody>
   <tr v-for="(job,key) in jobs">
       <td>{{ job.title }}</td>
       <td>{{ job.user.first_name }} {{ job.user.last_name }}</td>   
       <td>{{ job.birt_date | formatDate }}</td>
   </tr>
   </tbody>
</table>
<pagination :data="jobs" :limit="1" @pagination-change-page="getResults"></pagination>


<script>
  Vue.component('pagination', require('laravel-vue-pagination'));
  export default {
        mounted() {
          this.getResults()
        },        
        data(){
            return{
              csrfToken : Laravel.csrfToken,
              title: '',
              birt_date: '',
              jobs:[],
            }
        },
        methods: {
          getResults(page = 1) {               
                let _this = this;
                axios.get('/admin/jobs/create', {
                      params: {
                          page: page,
                      }
                  })
                    .then(response => {
                        _this.jobs = response.data.jobs;
                    })
                    .catch(response => {
                        this.errors = response.errors;
                        console.log(response);
                    });
            }
        }
</script>

laravel code is

$jobs = Job::with('user')->paginate(5);
        return response()->json([
            'success' => true,
            'jobs' => $jobs
        ]);
Activity icon

Started a new Conversation Vue Js Datepicker Not Formating

I am using vuejs-datepicker for saving date into the database for frontend and for backend using laravel and mysql database

when send date from date picker then get this error Could not parse 'Thu Jun 11 2020 11:46:00 GMT+0500 (Pakistan Standard Time)

<datepicker 
                        input-class="form-control" 
                        v-model="due_date" 
                        name="due_date"
                        type="date"
                        autocomplete="off"
                        :format="customDateFormat" 
                        :typeable="true">  
                      </datepicker>

customDateFormat() {
                return moment(this.due_date).format("MM-DD-YYYY")
            }
May
29
1 month ago
Activity icon

Replied to How Do I Upload Images To My Heroku App In Laravel

Yes bro in local are working with symlink and also did run the command of symlink on liver server of heroku but not working because i will use S3 storage for heroku live storage but i have no account for one year tier registeration have any service which i will use free of cost with heroku without account

May
26
1 month ago
Activity icon

Started a new Conversation How Do I Upload Images To My Heroku App In Laravel

use heroku run php artisan storage:link after deploy but not showing images

I am following a tutorial on deploying a Rails app to Heroku. It is using a free heroku account. The tutorial does not cover adding images. I have a simple test site up and working. Now, I'd like to add a few images to the site, but have no idea how to do this.

showing the static images which are save in assets but when the users upload image then not show the i want to show dynamicaly image which user will upload

if anyone have any solution for this so plz i need help of you

May
25
1 month ago
Activity icon

Replied to Laravel 6 Password Reset Mail Not Sending On Heroku

@jeffreyvanrossum local .env for mail setting are working but after deploy the project on heroku for production not working and not getting email on reset password

Activity icon

Replied to Laravel 6 Password Reset Mail Not Sending On Heroku

Thanks @jeffreyvanrossum bro for replying me..

i have config:set all data of mail setting in the heroku setting config variable but i have not solution that how will be working with heroku

Activity icon

Started a new Conversation Laravel 6 Password Reset Mail Not Sending On Heroku

i have setting in laravel project when user reset the password then get email

local is working but after deploy the project on heroku then getting error

(1/1) Swift_TransportException

Connection could not be established with host http://train-grow.herokuapp.com/ :stream_socket_client(): php_network_getaddresses: getaddrinfo faile
Activity icon

Replied to Call To Undefined Function GetUser() After Deploy On Heroku Serve

Thanks @talinon brother when used

"autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        },
        "files": [
            "app/Helpers/helpers.php"
        ]
    },

to

"autoload": {
        "psr-4": {
            "App\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "files": [
            "app/Helpers/helpers.php"
        ]
    },

then working find thanks again bro

Activity icon

Replied to Call To Undefined Function GetUser() After Deploy On Heroku Serve

@jlrdw getting internal server error 500 in the devtool

sheltered-refuge-25738.herokuapp.com/:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)

May
24
1 month ago
Activity icon

Replied to Call To Undefined Function GetUser() After Deploy On Heroku Serve

i have registered helpers.php in composer.json

"autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        },
        "files": [
            "app/Helpers/helpers.php"
        ]
    },
Activity icon

Replied to Call To Undefined Function GetUser() After Deploy On Heroku Serve

Yes Bro... did this

i'm using window OS

Activity icon

Started a new Conversation Call To Undefined Function GetUser() After Deploy On Heroku Serve

helpers function not working on heroku server after deploy

Activity icon

Replied to Laravel Project Deployment On Heroku Gives The HTTP ERROR 500

Thanks @sergiu17 for replying me

the laravel.log file is empty

Activity icon

Started a new Conversation Laravel Project Deployment On Heroku Gives The HTTP ERROR 500

sheltered-refuge-25738.herokuapp.com is currently unable to handle this request.
HTTP ERROR 500
Activity icon

Replied to Laravel 6 On Heroku. Forbidden You Don't Have Permission To Access This Resource.

My document root is public in which will hit index.php but not working

i have in procfile with the content web: vendor/bin/heroku-php-apache2 /public

Activity icon

Started a new Conversation Laravel 6 On Heroku. Forbidden You Don't Have Permission To Access This Resource.

After push the code on heroku and run the link on browser then getting this type of error

You don't have permission to access this resource.

Activity icon

Replied to How To Deploy A Laravel/vue Project On Heroku

Thansk @james_moore & @martinbean for replying me...

Bro i have deploy simple laravel app on heroku but i have also vuejs in laravel project in the resource js components i am not able to search how can deploy laravel with vue js so you can provide me the solution that how can deploy laravel in which i have vue js

May
23
1 month ago
Activity icon

Started a new Conversation How To Deploy A Laravel/vue Project On Heroku

Hi! i want to deploay a laravel/vue app on heroku finding solution from last 5 to 6 hours but not gettting plz anyone can give me the solution or address of website where could find and deploy project

Activity icon

Replied to Git Push Heroku Master Not Working

composer working fine when update but when doing the push to heroku then giving this error

if when i addheroku buildpacks:add heroku/php then detect Push rejected, failed to compile nodejs app. error

if when i add heroku buildpacks:add heroku/nodejs then detect Push rejected, failed to compile PHP app. error

where as when i check heroku buildpacks then getting both buildpacks like that

root: C:\Program Files\heroku\client
See more details with DEBUG=*
=== sheltered-meadow-39277 Buildpack URLs
1. heroku/nodejs
2. heroku/php
Activity icon

Replied to Git Push Heroku Master Not Working

i want to deploy a laravel app which have vue js components can you give me some solution so that i will deploy app on heroku because trying from morning but till not get any solution

Activity icon

Replied to Git Push Heroku Master Not Working

Thanks @bobbybouwmann for replying me.. i don't understant also run composer install but getting same error

Activity icon

Started a new Conversation Git Push Heroku Master Not Working

Hi.

i don't understanding that what type of this error plz five me the solution you can check image below with link

https://imgur.com/urHeWOf

May
15
1 month ago
Activity icon

Started a new Conversation How To Embed Multiples Videos In Laravel Web Application

Hi! i want to upload many video lecture in the the app so that user can see the video.

plz give me the best solution i have no idea of this type give me any solution where from i will understant best and embed video in our laravel website

May
04
2 months ago
Activity icon

Started a new Conversation Js-switch Inside Datatables Plugin With Ajax Call

Hi!

I'm using a js-switch for toggle active & in_active status how can use in yajra datatables this is code plz give me the best way so that use in datatables blade script

$(document).ready(function(){
	var columns = [
	columns.push({
                    data: 'is_active', 
                    name: 'is_active',
                    orderable: true,
                    searchable: "true",                     
                    className: "js-switch",

                });
];
	$('#consultant-table').DataTable({                
                processing: true,
                serverSide: true,                                              
                ajax: {
                    url: '{{ route('admin.product.dt') }}',
                },
                columns: columns
            }); 

            $('.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.product.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);
                    }
                });
            });
});

controller

->addColumn('is_active', function ($consultant) { 
                $consultantId = $consultant->id;
                $consultantStatus = $consultant->user->is_active;               
                $html = "";
                $html .= "<input type=\"checkbox\" data-id='$consultantId' name=\"is_active\" class=\"js-switch\" 			 $consultantStatus == 1 ? 'checked' : '' >";

                return $html;
            })