deepu07

Experience

15,350

0 Best Reply Awards

  • Member Since 11 Months Ago
  • 128 Lessons Completed
  • 0 Favorites

16th September, 2018

deepu07 started a new conversation Laravel-vue.js • 3 days ago

Hi Folks, I got weird error in Vue file.


(found in <Root>)
warn @ app.js:36570
warnNonPresent @ app.js:37876
has @ app.js:37909
(anonymous) @ VM3379:3
Vue._render @ app.js:40521
updateComponent @ app.js:38765
get @ app.js:39119
Watcher @ app.js:39108
mountComponent @ app.js:38772
Vue.$mount @ app.js:44517
Vue.$mount @ app.js:46916
(anonymous) @ app.js:13931
__webpack_require__ @ app.js:20
Object.defineProperty.value @ app.js:13881
__webpack_require__ @ app.js:20
(anonymous) @ app.js:63
(anonymous) @ app.js:66
app.js:36570 [Vue warn]: Property or method "name" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

(found in <Root>)
warn @ app.js:36570
warnNonPresent @ app.js:37876
has @ app.js:37909
(anonymous) @ VM3379:3
Vue._render @ app.js:40521
updateComponent @ app.js:38765
get @ app.js:39119
Watcher @ app.js:39108
mountComponent @ app.js:38772
Vue.$mount @ app.js:44517
Vue.$mount @ app.js:46916
(anonymous) @ app.js:13931
__webpack_require__ @ app.js:20
Object.defineProperty.value @ app.js:13881
__webpack_require__ @ app.js:20
(anonymous) @ app.js:63
(anonymous) @ app.js:66
app.js:36570 [Vue warn]: Property or method "description" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

(found in <Root>)```

Here is My app.js code
`new Vue({
    el: '#app',

    data: {
       name: ' ',
       description: ' '
    },

        methods: {
        },
});`

#blade file I'm loading app.js file 
` <script src="/js/app.js"></script>`

Any help. Thanks in advance

15th September, 2018

deepu07 started a new conversation Laravel-homestead • 4 days ago

Hey Folks, Im new to homestead. I'm struggling with creating two laravel projects in homestead. Can anyone help me on this? here is my config code:

#YAML file (I have two laravel projects in Sites foldes.)


    - map: ~/Development/sites/Laravue
      to: /home/vagrant/sites/Laravue

    - map: ~/Development/sites/Lara-vue
      to: /home/vagrant/sites/Lara-vue

sites:

    - map: Laravue.test
      to: /home/vagrant/sites/Laravue/public

    - map: Lara-vue.test
      to: /home/vagrant/sites/Lara-vue/public```

#here is my hosts file

127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost

192.168.10.10 Laravue.test 192.168.10.10 Lara-vue.test


I'm getting one project for two URLs (Laravue.test and Lara-vue.test both are routing to same project)

Anyone have any idea why it is loading one project. Thanks in advance

14th September, 2018

deepu07 left a reply on Laravel-vue • 5 days ago

So do i need t setup in .env file ? or somewhere? I'm using Mac with MAMP

deepu07 left a reply on Laravel-vue • 5 days ago

yup that resolved my problem it is throwing 404 error . This is my form <form method="POST" action="/projects" @submit.prevent="onSubmit">

and #web.php

Route::post('projects', '[email protected]')->name('projects');```

looks like it not recognizing the route. How can I resolve that? can you help me on this..

deepu07 started a new conversation Laravel-vue • 5 days ago

Hello Folks, I'm trying to build a blog with Laravel-vue. But I'm unable to load vue.js. It is getting an error. I couldn't find why it is not loading can anyone help me?

Thanks in advance

    <div id="app" class="container">
        @include ('projects.list')      

        <form method="POST" action="/projects" @submit.prevent="onSubmit">
        @csrf
            <div class="control">
                <label for="name" class="label">Project Name:</label>
                <input type="text" id="name" name="name" class="input"> 
            </div>

            <div class="control">
                <label for="description" class="label">Project Description:</label>
                <input type="text" id="description" name="description" class="input">
            </div>
    <br>
            <div class="control">
                <button class="button is-primary">Create</button>
            </div>
        </form>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
    <script src="../resources/assets/js/app.js"></script>
</body>
</html>```


```const app = new Vue({
    el: '#app',

    data: {

    },

    methods: {
        onSubmit() {
           axios.post('/projects', this.$data);
        }
    },
});

#ERROR

In console im getting GET http://localhost:8888/larapower/public/resources/assets/js/app.js 404 (Not Found)

13th September, 2018

deepu07 left a reply on Laravel-Vue Route URL • 6 days ago

It would be a POST request. somehow i'm missing after hitting a submit button it it redirecting to the http://localhost/projects. That causes not found exception.

deepu07 left a reply on Laravel-Vue Route URL • 6 days ago

@AdhamLap it is not a POST request?

deepu07 started a new conversation Laravel-Vue Route URL • 6 days ago

Hey Folks, Hope you are doing well. I have a small question. I'm building a site with Laravel-Vue.js I'm unable to hit correct URL. I didn't whats wrong with that. Tried but no clue can anyone help me on this.

html code (create.blade.php)

        @include ('projects.list')
        <form method="POST" action="/projects" @submit="onSubmit">```
app.js
```new Vue({
    el: '#app',

    data: {
        name: ' ',
        description: ' ',
    },

        methods: {
            onSubmit() {
               axios.post('/projects', this.$data);
            }
        },
});```

Laravel code 
```Route::get('projects/create', '[email protected]');
Route::post('projects', '[email protected]');```

Create http://localhost:8888/blog/public/projects/create is working after clicking on submit button it is routing to `http://localhost:8888/projects` . 

Can anyone help me on this. Thanks in Advance.


25th August, 2018

deepu07 started a new conversation Sql Query • 3 weeks ago

Hi Folks,

I'm super confused that calling JOIN after making many LEFT JOIN's in SQL query is technical wrong ? I googled but I haven't find any info. Can anyone helped me on this. Looking forward. Thanks in advance.

8th June, 2018

deepu07 left a reply on How To Pass DB Array Values To Blade View • 3 months ago

#original: array:9 [▼ "id" => 6 "client_id" => 1 "user_id" => null "location" => "Hyderabad, Telangana, India" "airport" => "["HYD - Hyderabad Airport","BPM - Begumpet"]" "start_date" => "06/13/2018 12:00 AM" "end_date" => "06/14/2018 12:01 AM" "created_at" => "2018-06-08 04:28:35" "updated_at" => "2018-06-08 04:28:35"

deepu07 left a reply on How To Pass DB Array Values To Blade View • 3 months ago

  #items: array:6 [▼
    0 => Meeting {#529 ▼
      +timestamps: true
      #table: "meetings"
      #casts: array:1 [▶]
      #fillable: array:6 [▶]
      #connection: "mysql"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:9 [▶]
      #original: array:9 [▼
        "id" => 1
        "client_id" => 4
        "user_id" => null
        "location" => "Hyderabad, Telangana, India"
        "airport" => "HYD - Hyderabad Airport"
        "start_date" => "06/11/2018 12:06 PM"
        "end_date" => "06/12/2018 12:00 AM"
        "created_at" => "2018-06-07 00:09:28"
        "updated_at" => "2018-06-07 02:19:15"
      ]
      #changes: []
      #dates: []
      #dateFormat: null
      #appends: []
      #dispatchesEvents: []
      #observables: []
      #relations: array:2 [▼
        "client" => Client {#574 ▼
          +timestamps: true
          #table: "clients"
          #fillable: array:3 [▶]
          #connection: "mysql"
          #primaryKey: "id"
          #keyType: "int"
          +incrementing: true
          #with: []
          #withCount: []
          #perPage: 15
          +exists: true
          +wasRecentlyCreated: false
          #attributes: array:6 [▶]
          #original: array:6 [▶]
          #changes: []
          #casts: []
          #dates: []
          #dateFormat: null
          #appends: []
          #dispatchesEvents: []
          #observables: []
          #relations: []
          #touches: []
          #hidden: []
          #visible: []
          #guarded: array:1 [▶]
        }
        "user" => null
      ]
      #touches: []
      #hidden: []
      #visible: []
      #guarded: array:1 [▼
        0 => "*"
      ]
    }
    1 => Meeting {#530 ▶}
    2 => Meeting {#531 ▶}
    3 => Meeting {#532 ▶}
    4 => Meeting {#533 ▶}
    5 => Meeting {#534 ▶}
  ]
}```

deepu07 started a new conversation Display An Json_decode Values In Blade File • 3 months ago

Hi everyone,

How to display json_decode values into blade view. here is my code to display single author and multiauthor books. Any help that would be appreciated Thanks in advance

      <tr>
        @if (json_encode($book['author']) !== 1 )
        <td>{{{ json_decode(json_encode($book['author'][0]),true) }}} &
        {{{ json_decode(json_encode($book['author'][1]),true) }}}</td>
        @else  
        <td>{{{ $book['author'][0] }}}</td>
        @endif 
     </tr>```

deepu07 left a reply on How To Pass DB Array Values To Blade View • 3 months ago

I tried like this

        <td>{{{ json_decode(json_encode($meeting['airport'][0]),true) }}} &
        {{{ json_decode(json_encode($meeting['airport'][1]),true) }}}</td>
        @else  
        <td>{{{ $meeting['airport'][0] }}}</td>
        @endif```
but getting only getting where we have 2 values in array

deepu07 left a reply on How To Pass DB Array Values To Blade View • 3 months ago

@arukomp Getting an error implode(): Invalid arguments passed

deepu07 left a reply on How To Pass DB Array Values To Blade View • 3 months ago

@arukomp only 5th record is having airports array(2 values) remaining all records they have only one. How can I manage this? any help

deepu07 left a reply on How To Pass DB Array Values To Blade View • 3 months ago

@arukomp We are getting collection of meetings. there are total 5 records in DB. But 5th record they have array data value in airport.

      <tr>
        <td>{{$meeting['id']}}</td>
        <td>{{ $meeting->client['company_name'] }}</td>
        <td>{{ $meeting->client['contact_person'] }}</td>
        <td>{{$meeting['location']}}</td>
        @if (isset($meeting['airport']))
        <td>{{{ json_encode($meeting['airport']) }}}</td>
        @else
        <td>{{$meeting[0]['airport']}}</td>
        @endif
        @php dd($meetings) @endphp```

deepu07 left a reply on How To Pass DB Array Values To Blade View • 3 months ago

@Inquisitive It is not working I was tried before. After some research Idid like this

        <td>{{{ json_encode($meeting['airport']) }}}</td>
        @else
        <td>{{$meeting[0]['airport']}}</td>
        @endif```

Output: ["HYD - Hyderabad Airport","BPM - Begumpet"]

But I want to convert user readable format output 

deepu07 started a new conversation How To Pass DB Array Values To Blade View • 3 months ago

Hi folks, I have array values in database. Can anyone help me on this how to display in view? Thanks In advance

      @foreach($meetings as $meeting)
      <tr>
        <td>{{$meeting['id']}}</td>
        <td>{{ $meeting->client['company_name'] }}</td>
        <td>{{ $meeting->client['contact_person'] }}</td>
        <td>{{$meeting['location']}}</td>
        <td>{{$meeting['airport'] }}</td>```

DB values looks like this
``` ["HYD - Hyderabad Airport","BPM - Begumpet"]```

Tried with @foreach but no luck

7th June, 2018

deepu07 started a new conversation Selecting Multiple Values From Dynamic Dropdown (HTML-jQuery) And Send To Controller • 3 months ago

Hi Folks, Here I'm trying to get multiple values into my controller from Front-end dynamic Drop-down selection by using HTML-jQuery. I'm able select multiple options by pressing SHFT key but when I DD(); in controller I'm getting only one value. How can I achieve multiple dynamic selected values into Back-end. any help that would be appreciated. Thanks in Advance.

//HTML

                  <label for="airport">Nearest Airport:</label>
                  <select id="AirportCode" name="AirportCode" multiple="multiple" class="form-control" placeholder="Select an Airport">
                    <option value="" disabled selected>Select Nearest Airport</option>
                    <option value="AirportCode" selected="selected"><div id="table"></div></option>
                  </select>
                </div>```

//jQUery

``` $.ajax({
                type: 'GET',
                url: url ,
                dataType: 'json',
                headers: {
                  accept: "application/json",
                  authorization:"key "+ bearer_token
                }
              }).done(function(data) {

              var options = '<option value="" disabled="" selected="">Select Nearest Airport</option>';
              data= data|| {};

               $("select option:selected" ).each( data, function( key, value ) {
                   options += '<option value="'+value.code+ ' - ' +value.name+'">'+value.code+ ' - ' +value.name+'</option>';
               })
            
                $('#AirportCode').html(options);
            })```

//Controller

``` public function store(Request $request)
    {
        $meeting = new Meeting;
        $meeting->airport = $_POST['AirportCode'];
        $meeting->save();

        return redirect('/meetings');
    }```

6th June, 2018

deepu07 left a reply on Controller Edit Method (Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No Message) • 3 months ago

@Inquisitive Thanks man. I did big mistake that I commented my update method in y controller.

              {{csrf_field()}}
              <input name="_method" type="hidden" value="PATCH">``` 

deepu07 started a new conversation Controller Edit Method (Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No Message) • 3 months ago

Hi Folks, Im Trying to update meeting details. But getting an error I didn't get why it is happening. Any help that would be appericated.

Thanks in Advance

//Blade file

 <form method="PATCH" action="{{action('[email protected]')}}">
            {{csrf_field()}}
            <input name="_method" type="hidden" value="PATCH">```

//controller
``` public function edit($id)
    {
        $input = Input::all();

        $meeting = Meeting::find($id);
        $meeting->update($input);
        $result = $meeting->save();

        return view('meetings.edit', compact('id', 'meeting'));
      
    }```

//error
Error: ```Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
No message```

5th June, 2018

deepu07 started a new conversation Displaying Data From Dynamic Dropdown Selection By Using Laravel-jQuery Ajax Calling • 3 months ago

Hi Folks, I'm trying to display data from dynamic dropdown selection. I'm new to Laravel-jQuery Ajax Calling. I want to display books list by selecting author names from dropdown. How can I achieve that. any suggestions that would be appreciated. Looking forward Thanks in Advance.

//Blade.php

   
        <link rel="stylesheet" href="{{ asset('css/home.css') }}" type="text/css"/>
        <link rel="stylesheet" href="{{asset('css/app.css')}}">

    </head>

    <body>

        <div class="container">
              <div class="row col-md-12">
                <div class="form-group col-md-12">
                  <label for="authorName">Select Author Name:</label>
                  <select name="authorName" id="authorName" class="form-control">
                    <option value="" disabled selected>Select Author Name</option>
                     @foreach($authors $author)
                      <option value="{{$author->id}}">{{ $author->id }} {{ $author->name }} </option>
                     @endforeach
                  </select>
                </div>
              </div>

          <table class="table table-striped" id="table">
            <thead>
              <tr>
                <th>Book ID</th>
                <th>Location</th>
                <th>Price</th>
                <th>Start Date</th>
                <th>End Date</th>
              </tr>
            </thead>
            <tbody id="tbody">
              @foreach($authorBooks  as $authorBook)
              <tr>
                <td>{{$authorBook['id']}}</td>
                <td>{{$authorBook['location']}}</td>
                <td>{{$authorBook['price']}}</td>
                <td>{{$authorBook['start_date']}}</td>
                <td>{{$authorBook['end_date']}}</td> 
              </tr>
              @endforeach
            </tbody>
          </table>
        </div>

            <!-- Ajax Scripts -->
        <script type="text/javascript">
        $(document).ready(function() {
            $('select[name="authorName"]').on('change', function() {
                var authorID = $(this).val();
                console.log(authorID );
                if(authorID ) {
                    $.ajax({
                        url: '/authorsList/ajax/'+authorID ,
                        type: "GET",
                        dataType: "json",

                         $('#table').find('tbody').append([
                            '<tr>',
                                '<td>{{$authorBook['id']}}</td>',
                                '<td>{{$authorBook['location']}}</td>',
                                '<td>{{$authorBook['price']}}</td>',
                                '<td>{{$authorBook['start_date']}}</td>',
                                '<td>{{$authorBook['end_date']}}</td>',
                            '</tr>'
                            ].join(''));
                    });
                  }
            </script>```

//Controllers Code

public function authorsList() { $authors= Author::all();

    return view('AuthorBooksList')->with(array('authors' => $authors));
}

public function authorBooksList($authorId)
{
    $input = func_get_args($authorId);
    $authorId= implode(' ', $input);

    $authorBooks  =  \DB::table('books')
                        ->leftJoin('authors', 'authors.id', '=', 'books.author_id')
                        ->where(author_id', '=', $authorId)
                        ->select('location', 'price', 'start_date', 'end_date')
                        ->get();

    return json_encode($authorBooks  );
}

//Route.php
Route::get('authorsList',array('as'=>'authorsList','uses'=>'[email protected]'));
Route::get('authorsList/ajax/{id}',array('as'=>'authorsList.ajax','uses'=>'[email protected]'));

deepu07 started a new conversation How To Get Bootstrap Datetime In Controller • 3 months ago

Hi Folks,

I have one form in that I'm using datetime picker in that. but I'm unable to get selected date in controller how can achieve that. any help that would be appreciated.

                  <label for="name">Start Date:</label>
                    <div class='input-group date' id='StartDate'>
                        <input type='text' class="form-control" id="SDate" />
                        <span class="input-group-addon">
                            <span class="glyphicon glyphicon-calendar"></span>
                        </span>
                    </div>
                </div>```

``` <script type="text/javascript">
            $(document).ready(function() {
                $(function () {
                    $('#StartDate').datetimepicker({
                    });
                    $('#EndDate').datetimepicker({
                        useCurrent: false 
                    });
                    $("#StartDate").on("dp.change", function (e) {
                        $('#EndDate').data("DateTimePicker").minDate(e.date);
                    });
                    $("#EndDate").on("dp.change", function (e) {
                        $('#StartDate').data("DateTimePicker").maxDate(e.date);
                    });
                });
            });
        </script>```

I tried in multiple ways i.e. `dd(Input::get('SDate'));`
`dd(date("Y-m-d", strtotime(Input::get("StartDate"))));`
dd($_POST['SDate']);` but no luck at all.

Thanks in Advance.

4th June, 2018

deepu07 left a reply on Google Map API Integration In Laravel 5.6 • 3 months ago

@freeccboy I got that I'm using google map API

3rd June, 2018

deepu07 left a reply on How To Enable Bootstrap-jquery Datetimepicker • 3 months ago

It didn't solved @Cronix see my post title I wanna enable the datetimepicker.

deepu07 left a reply on How To Enable Bootstrap-jquery Datetimepicker • 3 months ago

@Cronix for that. I'm using this datetimepicker laravel So that's what I' confusing. Anyway thanks man.

deepu07 left a reply on How To Enable Bootstrap-jquery Datetimepicker • 3 months ago

@Cronix But I'm using in composer not npm. There is no installion process for composer ;)

deepu07 left a reply on How To Enable Bootstrap-jquery Datetimepicker • 3 months ago

@Cronix I would like to use datetimepicker

deepu07 started a new conversation How To Enable Bootstrap-jquery Datetimepicker • 3 months ago

Here I'm trying to use bootstrap-jquery datetimepicker for my form. but unfortunately I'm getting an error that datetimepicker undefined function. here is my code `

 <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/css/bootstrap-datepicker.min.css" rel="stylesheet"/>
 <script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>

 <script type="text/javascript">
 $('#date').datetimepicker({
   todayHighlight: true,
   format: 'dd/mm/yyyy',
   startDate: new Date()   
  });
 </script>```

Uncaught TypeError: $(...).datetimepicker is not a function

Any help that would be appreciated. Thanks in advance 

deepu07 left a reply on Laravel Store Method • 3 months ago

By using a value with an {{$author->id}} in option tag. problem got resolved. thanks

2nd June, 2018

deepu07 started a new conversation Laravel Store Method • 3 months ago

Hi Folks,

I have one question for you guys. any help that would be appreciated.

Here is my question ```I have one form (books) that has a drop-down with author names and book title and book price columns. but in my books table I have author_id is a foreign keyI want to save selected author name in the format ofid` in books table. How can I achieve that.

Thanks In advance.

30th May, 2018

deepu07 left a reply on Google Autocomplete Address • 3 months ago

Hi @tisuchi Can you help on this? how you achieved this address auto-populate task by using Google map API? Looking forward..

Thanks

29th May, 2018

deepu07 started a new conversation Google Map API Integration In Laravel 5.6 • 3 months ago

Can anyone suggest suitable packages to consume google map api and want to auto-populate the locations.

Thanks In Advance.

28th May, 2018

deepu07 started a new conversation Display A Records With Laravel Relationships In View • 3 months ago

Hi Folks,

here is my problem. can you help me out.

  1. book belongsTo one author. (author_id is a foreign key in book table)
  2. Author hasMany books. (book_id is a foreign key in author table)

How to access author in books view.

I tried like this

     <tr>
       <td>{{$book['id']}}</td>
       <td>
         @foreach ($book->author as $author)
               {{ $author->name }}
        @endforeach
     </tr>
@endforeach ```

I'm unable to get author details in my view.  I'm getting an error. Please help me out on this. 
Thanks in advance

17th May, 2018

deepu07 started a new conversation Regarding Group • 4 months ago

Hello Folks, Hope you guys are doing good. DO you guys have any WhatsApp group for PHP or Laravel? If you know anyone please let me know.

Thanks in advance

24th April, 2018

deepu07 started a new conversation WebSite Hosting Service • 4 months ago

Hi Folks, I would like to have a personal blog. Can you guys help me on this i.e. which hosting services are cheap & best for personal blogging. Any suggestions that would be great.

Thanks In Advance

13th April, 2018

deepu07 left a reply on PHP-Laravel UnitTesting • 5 months ago

I tried. but it is not working for multiple Route calls in a single test method (I'm using php 5.6V and laravel 4.2V)

12th April, 2018

deepu07 started a new conversation PHP-Laravel UnitTesting • 5 months ago

Hi folks,

Is it possible to fire a multiple route calls (POST) in a one test method.(php unit-test)

Thanks in advance

18th March, 2018

deepu07 left a reply on Column Not Found: 1054 Unknown Column 'files.users_id' In 'where Clause' • 6 months ago

could you provide controllers logic here @jonimng

deepu07 left a reply on I'm Getting This Error Can Anyone Help Me Out On This? • 6 months ago

thanks guys I got it. appreciate your help. By adding manually it is working for me (in composer.json)

deepu07 left a reply on I'm Getting This Error Can Anyone Help Me Out On This? • 6 months ago

I did it through cmd but the thing is i'm unable to see in composer.json It makes me so confuse

deepu07 left a reply on I'm Getting This Error Can Anyone Help Me Out On This? • 6 months ago

added in app.php but not in composer.json

17th March, 2018

deepu07 started a new conversation I'm Getting This Error Can Anyone Help Me Out On This? • 6 months ago

In ProviderRepository.php line 208:

Class 'Barryvdh\Cors\ServiceProvider' not found

Thanks

7th March, 2018

deepu07 left a reply on Testing Job Dispatch In Laravel • 6 months ago

@ryan.dial Do you know how to write phpunit for laravel 4.2 jobs?? Thanks

deepu07 started a new conversation Unittesting For Jobs • 6 months ago

Hi, can anyone help me out on this. How to write PhpUnit for Jobs in Laravel 4.2? Any resources that would be appreciated. Thanks.

4th March, 2018

deepu07 started a new conversation Larevel Phpunit-selenium • 6 months ago

Hi,

Can you guys provide any sample github repo for phpunit-selenium type testing stuff.

15th February, 2018

deepu07 started a new conversation PHP Unit Testing (Mail) • 7 months ago

public function testEmail() { $txt = [ 'subject' => ' New comment was added', 'username' => 'user123@mail.com' ]; $parameters = [ 'description' => 'this is comment' ];

    \Mail::shouldReceive('send')
        ->once()
        ->andReturnUsing();

      $this->call('POST', '/api/post/{post_id}/comment', $parameters)->original;
      $this->assertEquals('[email protected]', $msg['username']);
 }```

above code make sense?? Here I'm trying to send an email when someone commented on post. I do have an observer for that mail thing. How to write a test script for this? Can you help me out? Thanks in advance!

deepu07 left a reply on How To Test Email Mock In Laravel. • 7 months ago

@skliche does it make sense?

public function testEmail()
    {
        $txt = [ 'subject' => ' New comment  was added', 'username' => '[email protected]' ];
        $parameters = [ 'description' => 'this is comment' ];

        \Mail::shouldReceive('send')
            ->once()
            ->andReturnUsing();

          $this->call('POST', '/api/post/{post_id}/comment', $parameters)->original;
          $this->assertEquals('[email protected]', $msg['username']);
     }```

Here I'm trying to send an email when someone commented on post. I do have an observer for that mail thing. How to write a test script for this? Can you help me out?

9th February, 2018

deepu07 left a reply on How To Test Email Mock In Laravel. • 7 months ago

@skliche How to do with Mail Fake ??

deepu07 left a reply on Required If Coupon != 0 • 7 months ago

@JuanRangel Hey try Try n catch Thing. For example in

if(coupon > 0){
    //
}
catch {
return;
}```

like this...
Edit Your Profile
Update

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