samalapsy

Developer at worshipnow.com.ng

Hire Me

Experience

5,630

4 Best Reply Awards

  • Member Since 1 Year Ago
  • 1 Lesson Completed
  • 1 Favorite

6th September, 2018

samalapsy started a new conversation Change Api Route To Subdomain • 2 weeks ago

I'm trying to change my Api route from

http://example.com/api 

to

http://api.example.com

while it at the same time points to the api route in Laravel route. Please how can I achieve that..?

Thanks in Anticipation.

10th July, 2018

samalapsy left a reply on PHP Quivalent Of This JS Code • 2 months ago

@martinbean, Very true I've been trying t write this same script in PHP but I don't seems to get it right, that's why I'm calling for help on this platform..

samalapsy left a reply on PHP Quivalent Of This JS Code • 2 months ago

Please any help from anyone else?

8th July, 2018

samalapsy left a reply on Query Runs Twice • 2 months ago

I've been able to sort the issue out...It's a Middleware that's causing the issue. I had to rewrite the middleware Below is the link where I got the CORS code from.

https://stackoverflow.com/questions/33076705/laravel-5-1-api-enable-cors

6th July, 2018

samalapsy started a new conversation Query Runs Twice • 2 months ago

I'm writing a VUEJS project inside Laravel. Using Laravel API route, below is my function to store a new client. Step to store a new client

  1. Generate api key for client
  2. Create a new user and save api key id to client
  3. Update the api key with client id and email
 public function store(Request $request, Client $client)
    {
        if (!$request->isMethod('post'))
            return response()->json(['status' => 405, 'response' => 'Method not Allowed']);

        $data = $request->except("_token");
        $data['slug'] = str_slug($request->name);


        $v = Validator::make($data,[
            'audio_provider_id' => 'required|numeric:max:2',
            'audio_status_id' => 'required|numeric:max:2',
            'text_provider_id' => 'required|numeric:max:2',
            'text_status_id' => 'required|numeric:max:2',
            'name' => 'required|string:min:3||max:50',
            //'email' => 'nullable|string|email|min:5|max:100|unique:clients',
            //'slug' => 'required|string|min:5|max:100|unique:clients',
            //'phone' => 'nullable|numeric|unique:clients|digits:11',
            //'description' => 'nullable|string:min:3|max:200',
        ],[
            'slug' => 'Client name is already exits',
            'audio_provider_id' => 'Select an audio provider',
            'text_provider_id' => 'Select a text provider',
            'audio_status_id'  => 'Select audio maximun status level.',
            'text_status_id'    => 'Select text maximun status level.',            
        ]);

         if ($v->fails()){
            return ["responseCode" => 503, "errors" => $v->errors()];
         }


        $key = Utils::generateApiToken();
        $apiKey=\App\ApiKey::firstOrCreate([
            'api_key'=> $key 
        ]);

        $data['enable_disable'] = 1;
        $data['api_key_id'] = $apiKey->id;
        unset($apiKey);
        

        $status = $client->firstOrCreate($data);
        if (!is_null($status)){
            $aKey = \App\Apikey::find($status->api_key_id)->update(
                [
                    'id' => $status->api_key_id 
                ],[
                    'client_id' => $status->id,
                    'client_email' => $status->email,
                ]
            );

             return [
                "responseCode" => 200,
                "message" => "Client has been created",
                //"newClient" => $status,
            ];
        }
        return [
            "responseCode" => 500,
            "message" => "Could not create client due to". $status->error()
        ];
    }

VUEJS FORM

<form role="form" autocomplete="off">
                <div class="modal-body">
                        <div class="row">
                            <div class="alert alert-danger" v-if="errors.slug">
                                <span>{{ errors.slug }}</span>
                            </div>
                            <div class="form-group col-md-12" :class="errors.name ? ' has-error ' : '' ">
                                <label>Name</label>
                                <input type="text"  autocomplete="off" class="form-control" v-model="list.name" required>
                                    <span class="help-block" v-if="errors.name">
                                        <strong>{{ errors.name[0] }}</strong>
                                    </span>
                            </div> 
                            <div class="form-group col-md-12 " :class="errors.phone  ? ' has-error' : '' ">
                                <label>Phone</label>
                                <input type="text" autocomplete="off" class="form-control" v-model="list.phone" >
                                <span class="help-block" v-if="errors.phone">
                                    <strong>{{ errors.phone[0] }}</strong>
                                </span>
                            </div>

                            <div class="form-group col-md-12" :class="errors.email ? ' has-error' : '' ">
                                <label>Email</label>
                                <input type="email" autocomplete="off" class="form-control" v-model="list.email">
                                <span class="help-block" v-if="errors.email">
                                    <strong>{{ errors.email[0] }}</strong>
                                </span>
                            </div>
                            <div class="form-group col-md-12" :class="errors.description ? ' has-error' : '' ">
                                <label>Description</label>
                                <textarea class="form-control" v-model="list.description"></textarea>
                                <span class="help-block" v-if="errors.description">
                                    <strong>{{ errors.description[0] }}</strong>
                                </span>
                            </div>

                            <div class="form-group col-md-6" :class="errors.audio_provider_id ? ' has-error' : '' " >
                                <label>Select Audio Provider</label>
                                <select v-model="list.audio_provider_id" class="form-control" required>
                                    <option value=""> &ndash; Select Audio Provider &ndash;</option>                
                                    <option  :value="provider.id" v-for="provider in createDetails.audioProviders" :selected="list.audio_provider_id"> {{ provider.name }}</option>
                                </select>
                                <span class="help-block" v-if="errors.audio_provider_id">
                                    <strong>{{ errors.audio_provider_id[0] }}</strong>
                                </span>                     
                            </div>

                            <div class=" form-group col-md-6" :class="errors.audio_status_id ? ' has-error' : '' " >
                                <label>Select Max Status Level</label>
                                <select v-model="list.audio_status_id" class="form-control" required>
                                    <option value=""> &ndash; Select Status Level &ndash;</option>
                                    <option :value="status.id" v-for="status in createDetails.status" :selected="list.audio_status_id">{{ status .name }}</option>  
                                </select>
                                <span class="help-block" v-if="errors.audio_status_id">
                                    <strong>{{ errors.audio_status_id[0] }}</strong>
                                </span>
                            </div>

                            <div class="form-group col-md-6"  :class="errors.text_provider_id ? ' has-error' : '' " >
                                <label>Select Text Provider</label>
                                <select v-model="list.text_provider_id" class="form-control" required>
                                    <option value=""> &ndash; Select Text Provider &ndash;</option>
                                    <option :value="provider.id" v-for="provider in createDetails.textProviders" :selected="list.text_provider_id"> {{  provider.name }}</option>
                                </select>
                                <span class="help-block" v-if="errors.text_provider_id">
                                    <strong>{{ errors.text_provider_id[0] }}</strong>
                                </span>                     
                            </div>

                            <div class="form-group col-md-6" :class="errors.text_status_id ? ' has-error' : '' " >
                                <label>Select Max Status Level</label>
                                <select v-model="list.text_status_id" class="form-control" required>
                                    <option value=""> &ndash; Select Status Level &ndash;</option>
                                    <option :value="status.id" v-for="status in createDetails.status" :selected="list.text_status_id == status.id"> {{ status.name }}</option>
                                </select>
                                <span class="help-block" v-if="errors.text_status_id">
                                    <strong>{{ errors.text_status_id[0] }}</strong>
                                </span>
                            </div>
                            
                        </div>
                    
                </div>
                <div class="modal-footer">
                    <!-- <button type="button" class="btn btn-secondary" @click="close">Close</button> -->
                    <button type="submit" :disabled="disable" class="btn cc-bg-blue btn-primary" @click.prevent="create($event)">
                        <i  v-if="loading" class="fas fa-spinner fa-spin" style="font-size:14px"></i>{{ btnAction }}
                    </button>
                </div>
            </form>

AXIOS POST

create(e) {
                //e.stopPropagation()
                e.preventDefault();
                //console.log('This is the place')
                this.loading = this.disable=true

                this.btnAction = 'Creating, please wait..'

                axios.post(store.state.baseApiUrl+ 'clients/add', this.$data.list, this.$authHeader).then((response)=> {
                    //console.log(response)
                    this.loading = this.disable=false
                    this.btnAction = 'Create Client'
                    if (response.data.responseCode === 200) {
                        toast('success', 'Create Client Status', response.data.message, 4000)
                        this.list =  {
                            name:'',
                            phone:'',
                            email:'',
                            description:'',
                            audio_provider_id:'',
                            audio_status_id:'',
                            text_provider_id:'',
                            text_status_id:'',
                        }
                        //this.$parent.tempResults = this.$data.list
                        //this.errors = this.list = "";
                        //this.$emit('pushToStack', $this.data.list);
                        this.close()
                    }
                    else{
                        $(this.$refs.newModal).effect( "shake" )
                        this.errors = response.data.errors
                    }

                }).catch((error)=> {
                    $(this.$refs.newModal).effect( "shake" )
                    console.log(error)
                    this.errors = error
                    this.loading = this.disable=false
                    this.btnAction = 'Create Client'
                });
            },

Whenever I click create buttoun from my vuejs form, the api ket and clients gets created twice. Please kindly help me out. Thank You

5th July, 2018

samalapsy left a reply on PHP Quivalent Of This JS Code • 2 months ago

Yes

4th July, 2018

samalapsy left a reply on PHP Quivalent Of This JS Code • 2 months ago

@burlresearch I think I can actually use CURL too right..|?

3rd July, 2018

samalapsy started a new conversation PHP Quivalent Of This JS Code • 2 months ago

<script>
            function parse(){
                document.getElementById("text").innerText = 'processing audio';
                let file =  document.getElementById("clip").files[0];
                let reader = new FileReader();
               
                reader.onload = (evt) => {
                    let contents = evt.target.result;

                    let request = new XMLHttpRequest();
                    request.open("POST", "http://example.com/treat");

                    request.setRequestHeader('Content-Type', file.type === 'video/webm' ? 'audio/webm': file.type);
                    
                    request.onload = (event) => {
                        if(event.currentTarget.status == 200 && event.currentTarget.readyState == 4){
                            document.getElementById("text").innerText = `The Parsed Audio is: ${JSON.parse(request.response).text}`
                        }else{
                            document.getElementById("text").innerText = "Processing failed"
                        }
                    }

                    request.send(contents);
                }

                reader.readAsArrayBuffer(file);
            }
        </script>

Please how can I create a replica of this in PHP..... This code accepts and audio file and streams it to the supplied URL. The Url now send a transcription of that Audio file.

Thank You

16th June, 2018

samalapsy left a reply on Fetch Class And Function From The DB. • 3 months ago

@Cronix Hmmmm Thank You... How about using this?

http://php.net/manual/en/functions.variable-functions.php

15th June, 2018

samalapsy started a new conversation Fetch Class And Function From The DB. • 3 months ago

I currently building a portal where I don't want to hard code my functions and classes. I want a scenario where I can fetch my class and method name from the Database dynamically as I tend to change the names regularly.

Thanks You.

13th March, 2018

samalapsy left a reply on Fontawesome 5 With Npm • 6 months ago

@heihachi88 npm works with javascript ..... If you want to use blade you have to download the file from this link https://use.fontawesome.com/releases/v5.0.8/fontawesome-free-5.0.8.zip and extract it into your public folder/directory and do the necessary calling in your tag.

Hope it helps

samalapsy left a reply on Fontawesome 5 With Npm • 6 months ago

@heihachi88 On which language are you using it with. is it vuejs?

samalapsy left a reply on Fontawesome 5 With Npm • 6 months ago

can you plesae send the link to the plugin so I can also look at it too? Thanks

samalapsy left a reply on Running Npm Ls With Errors • 6 months ago

@MSTDMSTD Make sure your nodejs version is up to date, else you have to update it to latest version

samalapsy left a reply on Fontawesome 5 With Npm • 6 months ago

You can either add it to your resources/assets/sass/app.css file this way

// FontAwesome
@import '~font-awesome/scss/font-awesome';

samalapsy left a reply on FirstOrCreate Not Working Properly • 6 months ago

@staticcode Can you try to Log out the content of your 'items Array' while performing the firstOrCreate function? and compare

samalapsy left a reply on FirstOrCreate Not Working Properly • 6 months ago

@staticcode I think there are some data that are changing, Maybe the sku_id is changing. If the sku_id is different from what's in the DB it'll insert into the DB.

4th December, 2017

samalapsy left a reply on ModelNotFoundException When Queuing Mail • 9 months ago

@mikec can you share your Todo Models with us..?

27th November, 2017

samalapsy started a new conversation Notification • 9 months ago

Please how can I implement a notification system in my application where I can show the list of a user's notification indication as read and unread.

Example USER A send a message to USER B, the system should shoe (1) as a notification to USER B, if USER C send USER a message too, the system would show (2) notification since USER B has not rad the first one.

Please hoe can I implement this in my application.

Thanks

20th November, 2017

samalapsy left a reply on Sending SMS Via Twillo • 10 months ago

@RamjithAp Client.php is the Twillo

use Twilio\Rest\Client;

samalapsy started a new conversation Sending SMS Via Twillo • 10 months ago

whenever I send SMS via twillo using their sdk, my sms is always in queue and it'll never get to deliver....Pls how can I fix this..

$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client(ENV('TWILLO_ACCOUNT_SID_LIVE'), ENV('TWILLO_AUTH_TOKEN_LIVE'));

$res = $client->messages
    ->create(
        "+234706XXXXX,
        array(
            "from" => ENV('TWILIO_NUMBER_LIVE'),
            "body" => "Jenny please?! I love you <3",
            "mediaUrl" => "http://www.example.com/hearts.png"
        )
    );

        dd($res);

Thanks for helping in Anticipation

19th November, 2017

samalapsy left a reply on Execute Laravel Cron Jobs In Ubuntu • 10 months ago

@mattsplat I placed it on production

18th November, 2017

samalapsy started a new conversation Execute Laravel Cron Jobs In Ubuntu • 10 months ago

I'm getting this error when I run php artisan schedule:run on my ubuntu VPS terminal

  [InvalidArgumentException]
  Invalid log level.

This is how my cron job looks like

* * * * * php -q  /path to laravel/artisan scheduled:run 1>> /dev/null 2>&1

Please how can I solve this error and make my cron job work.

Thanks

17th November, 2017

samalapsy left a reply on Display XML Marker Result On Google • 10 months ago

I've solved this. Below are the steps I took Steps

  1. Initialze Google map this way
function initMap() {
var lat = 23489331;
var lng = 23459872;
        var map = new google.maps.Map(document.getElementById('map'), {
          center: new google.maps.LatLng(lat, lng),
          zoom: 11
        });
}
  1. Created a new map instance on my button onclick function as illustrated below
$('#buttonID').on('click', function (){
var lat = 23489331;
var lng = 23459872;
        var map = new google.maps.Map(document.getElementById('map'), {
          center: new google.maps.LatLng(lat, lng),
          zoom: 11
        });

        var infoWindow = new google.maps.InfoWindow;
        var geocoder = new google.maps.Geocoder();

downloadUrl(searchUrl, function(data) {
            var xml = data.responseXML;
            var markers = xml.documentElement.getElementsByTagName('marker');
            Array.prototype.forEach.call(markers, function(markerElem) {
              var id = markerElem.getAttribute('id');
              var name = markerElem.getAttribute('name');
              var avatar = markerElem.getAttribute('avatar');
              var code = markerElem.getAttribute('code');
              var charge = markerElem.getAttribute('charge');
              var bank = markerElem.getAttribute('bank');
              var available = markerElem.getAttribute('available');
              var min_trnx = markerElem.getAttribute('min_trnx');
              var max_trnx = markerElem.getAttribute('max_trnx');
              
              var point = new google.maps.LatLng(
                  parseFloat(markerElem.getAttribute('lat')),
                  parseFloat(markerElem.getAttribute('lng'))
              );

              if (available == '1')
                var status = ' <span style="color:green;"><i class="fa fa-circle" aria-hidden="true"></i><span>';
              else
                var status = ' <span style="color:red;"><i class="fa fa-circle" aria-hidden="true"></i><span>';


              var rating = '<span class="blu-co"><span class="fa fa-star-o star-co" data-rating="1"></span> <span class="fa fa-star-o star-co" data-rating="2"></span> <span class="fa fa-star-o star-co" data-rating="3"></span> <span class="fa fa-star-o star-co" data-rating="4"></span> <span class="fa fa-star-o star-co" data-rating="5"></span></span>';

              var profileImage = "<div class='text-center' ><div><img src='/uploads/avatars/default.png' class='' alt='Image' height='80px;' width='auto' style='border-radius: 50%;margin-bottom: 15px;'></div>" + rating+"<br/><a href=#! id='mCode"+ id+"' style='color:#4B5320;'><strong>" + code + "</strong></a> " +"<br/>"+name+ " "+status +" </div>";

              var contentStringNew = "<div style='width:100%'>" + profileImage +"<h5><strong>Charge : </strong> " + charge+"%</h5><h5><strong>Min. Amt.: </strong>" + min_trnx+ "</h5><h5><strong>Max. Amt.: </strong>"+ max_trnx+"</h5><h5><strong>Preferred Bank : </strong>"+ bank +"</h5>";

              var contentString = "<div style='width:100%'><h5><strong>Charge : </strong> " + charge+"%</h5><h5><strong>Code : </strong><a href=#! id='mCode'>" + code + "</a></h5><h5><strong>Min. Amt.: </strong>" + min_trnx+ "</h5><h5><strong>Max. Amt.: </strong>"+ max_trnx+"</h5><h5><strong>Preferred Bank : </strong>"+ bank +"</h5>";


              //var icon = customLabel[type] || {};

              var marker = new google.maps.Marker({
                map: map,
                position: point,
                // label: icon.label
              });

              marker.addListener('click', function() {
                infoWindow.setContent(contentStringNew);
                infoWindow.open(map, marker);
              });
            });
          });
  1. Form my url did something like this
var searchUrl = '{{ route("url") }}?address=' +address+"&amount="+amount ;

Thanks Everyone

16th November, 2017

samalapsy started a new conversation Display XML Marker Result On Google • 10 months ago

In my website I want users to be able to find location based on area and amount and it would display their location markers on google map, How can I implement this..?

SEARCH FORM

<form action="#!" method="GET">
                        {!! csrf_field() !!}
                        <div class="cbox col-sm-12">
                            <div class="col-sm-12 remove-padding">
                                <div class="col-sm-4">
                                    <h5><span class="color-bold">Location</span></h5>
                                </div>
                                <div class="col-sm-8 stst" >
                                    <input id="address" type="text" placeholder="eg. New York">
                                </div>
                            </div>
                            
                            <div class="col-sm-12 remove-padding">
                                <div class="col-sm-4">
                                    <h5><span class="color-bold">Amount</span></h5>
                                </div>
                                <div class="col-sm-8 stst">
                                    <input type="number" id="amout" placeholder="eg. 5000" required autocomplete="off" min="0">
                                </div>
                            </div>                                        
                            <div class="col-sm-12" style="padding-top: 5px;">
                                <button id="findMerchant" type="type" class="btn btn-primary waves-effect pull-right waves-light btn-sm" name="button">Find</button>
                            </div>
                        </div>
                    </form>  

Script to display markers on google map

function initMap(address, amount) {
var lat = 23489331;
var lng = 23459872;
        var map = new google.maps.Map(document.getElementById('map'), {
          center: new google.maps.LatLng(lat, lng),
          zoom: 11
        });

        var infoWindow = new google.maps.InfoWindow;
        var geocoder = new google.maps.Geocoder();

downloadUrl(searchUrl, function(data) {
            var xml = data.responseXML;
            var markers = xml.documentElement.getElementsByTagName('marker');
            Array.prototype.forEach.call(markers, function(markerElem) {
              var id = markerElem.getAttribute('id');
              var name = markerElem.getAttribute('name');
              var avatar = markerElem.getAttribute('avatar');
              var code = markerElem.getAttribute('code');
              var charge = markerElem.getAttribute('charge');
              var bank = markerElem.getAttribute('bank');
              var available = markerElem.getAttribute('available');
              var min_trnx = markerElem.getAttribute('min_trnx');
              var max_trnx = markerElem.getAttribute('max_trnx');
              
              var point = new google.maps.LatLng(
                  parseFloat(markerElem.getAttribute('lat')),
                  parseFloat(markerElem.getAttribute('lng'))
              );

              if (available == '1')
                var status = ' <span style="color:green;"><i class="fa fa-circle" aria-hidden="true"></i><span>';
              else
                var status = ' <span style="color:red;"><i class="fa fa-circle" aria-hidden="true"></i><span>';


              var rating = '<span class="blu-co"><span class="fa fa-star-o star-co" data-rating="1"></span> <span class="fa fa-star-o star-co" data-rating="2"></span> <span class="fa fa-star-o star-co" data-rating="3"></span> <span class="fa fa-star-o star-co" data-rating="4"></span> <span class="fa fa-star-o star-co" data-rating="5"></span></span>';

              var profileImage = "<div class='text-center' ><div><img src='/uploads/avatars/default.png' class='' alt='Image' height='80px;' width='auto' style='border-radius: 50%;margin-bottom: 15px;'></div>" + rating+"<br/><a href=#! id='mCode"+ id+"' style='color:#4B5320;'><strong>" + code + "</strong></a> " +"<br/>"+name+ " "+status +" </div>";

              var contentStringNew = "<div style='width:100%'>" + profileImage +"<h5><strong>Charge : </strong> " + charge+"%</h5><h5><strong>Min. Amt.: </strong>" + min_trnx+ "</h5><h5><strong>Max. Amt.: </strong>"+ max_trnx+"</h5><h5><strong>Preferred Bank : </strong>"+ bank +"</h5>";

              var contentString = "<div style='width:100%'><h5><strong>Charge : </strong> " + charge+"%</h5><h5><strong>Code : </strong><a href=#! id='mCode'>" + code + "</a></h5><h5><strong>Min. Amt.: </strong>" + min_trnx+ "</h5><h5><strong>Max. Amt.: </strong>"+ max_trnx+"</h5><h5><strong>Preferred Bank : </strong>"+ bank +"</h5>";


              //var icon = customLabel[type] || {};

              var marker = new google.maps.Marker({
                map: map,
                position: point,
                // label: icon.label
              });

              marker.addListener('click', function() {
                infoWindow.setContent(contentStringNew);
                infoWindow.open(map, marker);
              });
            });
          });
        }
searchUrl // This is the URl that would return XML marker..

My question is that how make the search result from the form be used in the seachUrl of the map function.

Thanks in Anticipation.

9th November, 2017

samalapsy left a reply on Address Not Showing In Google Places • 10 months ago

@ejdelmonico I get your point but What i'm asking is an alternative. I might not know the location where the address is situated on the map. Is there an alternative way to getting user's location

8th November, 2017

samalapsy left a reply on Address Not Showing In Google Places • 10 months ago

@ejdelmonico My application actually allows user to add her address, while I get their coordinates and other information from the address.... My users are not knowledgeable to add their place on google map, Is there any other alternative to that..?

I was thinking about getting the coordinate of the location from where they are registering but the issue is that they might not register whil at home...It might be in transit....

So sir is there an alternative to how I can get the actual coordinate of their address.?

samalapsy started a new conversation Address Not Showing In Google Places • 10 months ago

Hi, please what can I do If my address is not showing in google places auto complete input box.

Please help me.

samalapsy left a reply on Show Integer (price) Separate With Comma(',') Or Dot ('.') • 10 months ago

@mlazuardy use the php function

number_format()
Excample
echo '$'.number_format("1000000")."<br>";
echo '$'.number_format("1000000",2)."<br>";
echo '$'.number_format("1000000",2,",",".");

Results to
,000,000
,000,000.00
.000.000,00

Hope it's helpful

samalapsy left a reply on Access To Source Codes On Vultr.com Server • 10 months ago

@ejdelmonico Thank you sir...I'll try that ....Moreso I've tried sftp and I could access the Codes too...

Another Question I have is how I can access the database on same vultr

7th November, 2017

samalapsy started a new conversation Access To Source Codes On Vultr.com Server • 10 months ago

Hello,

Please how can I access my Laravel Source codes on Vultr.com Hosting...Someone is to pass the a project to me on this server...I don't seems to find the code

18th October, 2017

samalapsy left a reply on Pace.js Never Show Progress Bar • 11 months ago

@ANONYMOUS194 I was trying to solve the issue I had using pace.js and I think I could help out by providing a solution to your question.

Add this class to the div that wraps all your content pace-done

Thanks

13th October, 2017

samalapsy left a reply on What's The Use Of Route::domain Or Route::group(['domain' => 'xyz.com']) • 11 months ago

@polarcubs

Route::domain (Used in Laravel 5.4)or Route::group(['domain' => 'xyz.com'])? are is used when you have a sub domain which can be either dynamic or statc for example

Route::domain('{account}.myapp.com')->group(function () {
    Route::get('user/{id}', function ($account, $id) {
        //
    });
});

Means that {account} is a variable that can change therefore instead of having a static subdomain for your website.... you can have a container to show any subdomain under your domain using the laravel route domain function.

samalapsy left a reply on Mail Arrive As Plain Text • 11 months ago

@sebastian.bouckaert@sbsoftware.be wuld have been grate if your share your mail vie html

samalapsy left a reply on Make Image Load Last • 11 months ago

@snapey Wow....Does that means that Medium did the same thing?

samalapsy left a reply on Mail Arrive As Plain Text • 11 months ago

@SEBASTIAN.BOUCKAERT@SBSOFTWARE.BE can you pls showyour codes?

12th October, 2017

samalapsy started a new conversation Make Image Load Last • 11 months ago

Good Day

Please How can i make images be the last thing to be loaded last on pages in my web application.

All Comment sincerely appreciated

11th October, 2017

samalapsy left a reply on Css Not WOrking • 11 months ago

It's working now..

This is what i did..

I'm running laravel 5.3 so I'm using gulp...I added all my csss to the assest folder in the resource.. Below is the content of my gulp file. thanks

const elixir = require('laravel-elixir');

require('laravel-elixir-vue-2');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(mix => {
    //mix.sass('app.scss')
       //.webpack('app.js');
       mix.styles([
        "bootstrap.css",
        "app.css"
    ], 'public/css/all.css');


       mix.scripts([
        //"laravel-app.js",
        "vue-app.js",
        "theme-app.js"
    ], 'public/js/all.js');

});

Then I called all.css and all.js in my blade file

samalapsy left a reply on Css Not WOrking • 11 months ago

Please can help with an example @cronix

my .env file is not accessible.

samalapsy left a reply on Css Not WOrking • 11 months ago

@lancecoder Yeah It's working fine but my page is not rendered by the css in the sheet.

samalapsy left a reply on Css Not WOrking • 11 months ago

<link rel="shortcut icon" type="image/ico" href="favicon.ico" />
<link rel="icon" type="image/ico" href="favicon.ico" />

   <!-- =============== VENDOR STYLES ===============-->
   <!-- FONT AWESOME-->
   {{-- <link rel="stylesheet" href="{{ asset('/vendor/fontawesome/css/font-awesome.min.css')}}"> --}}
   <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">

   {{-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.9/css/weather-icons.min.css">
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css"> --}}


   <!-- SIMPLE LINE ICONS-->
   <link rel="stylesheet" href="{{ asset('/vendor/simple-line-icons/css/simple-line-icons.css')}}">
   <!-- ANIMATE.CSS-->
   <link rel="stylesheet" href="{{ asset('/vendor/animate.css/animate.min.css')}}">
   <!-- WHIRL (spinners)-->
   <link rel="stylesheet" href="{{ asset('/vendor/whirl/dist/whirl.css')}}">
   <!-- =============== PAGE VENDOR STYLES ===============-->
   <!-- WEATHER ICONS-->
   <link rel="stylesheet" href="{{ asset('/vendor/weather-icons/css/weather-icons.min.css')}}">
   <!-- =============== BOOTSTRAP STYLES ===============-->
   {{-- <link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}" id="bscss"> --}}
   <!-- =============== APP STYLES ===============-->
   <link rel="stylesheet" href="{{ asset('css/all.css') }}" id="maincss">
   <!-- Scripts -->
    <script>
      var APP_URL = "{{ route('index') }}";
      window.Laravel = <?php echo json_encode([
        'csrfToken' => csrf_token(),
      ]); ?>
    </script>
</head>

samalapsy started a new conversation Css Not WOrking • 11 months ago

Good Day Please I installed laravel pusher echo on my laravel project, ran, php artisan make:auth and suddenly my app is not reading the css I had already. Please how can I fix this? Thank you

21st September, 2017

samalapsy left a reply on Upload Multiple Images To Server Using Image Intervention • 1 year ago

@johnef_sh You have a duplicated in your controller.. See this

Image::make( $gImg )->resize( 1890, 1358 )->save( 'images/decoration/' . $filename );
                Image::make( $gImg )->fit( 646, 250 )->save( 'images/decoration/thumbs-' . $filename );

The above code would duplicated the images in different size.

9th September, 2017

samalapsy left a reply on Upload Laravel To Plesk Server • 1 year ago

@jlrdw I've tried this process before but it's still the same things....Mind you I can't find any error on the error log....But i keep getting This page isn’t working, domain is currently unable to handle this request.

samalapsy left a reply on Upload Laravel To Plesk Server • 1 year ago

Someone should please help a brother here..!

samalapsy left a reply on Upload Laravel To Plesk Server • 1 year ago

I've uploaded it.. Please can you give an illustration on how bind it.? Thanks

8th September, 2017

samalapsy started a new conversation Upload Laravel To Plesk Server • 1 year ago

Please hoe can I upload my laravel project from my localhost to my plesk dedicated server ..?

15th August, 2017

samalapsy left a reply on Redirect To Dashboard • 1 year ago

I'm using the Laravel defaults

Auth::routes()

14th August, 2017

samalapsy started a new conversation Redirect To Dashboard • 1 year ago

Please how can I redirect to dashboard when logged in and I visit the registration or login url.

Thank you

12th August, 2017

samalapsy left a reply on Select All From Table And Group By Specific Column • 1 year ago

No I don't have it. This is my model

<?php

namespace App;
use App\User;
use App\Hostel;
use Mail;
use App\Mail\NewBooking;
use App\Mail\BookingSucessful;
use App\Mail\BookingFailed;
use App\Mail\Invoice;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Booking extends Model {
    
    use SoftDeletes;

    protected $fillable =['user_id', 'hostel_id', 'transaction_id', 'user_type', 'inspection_date', 'move_in_date', 'cleaning_services', 'information', 'status', 'room', 'price', 'discount_price','referral_income','referral', 'channel', 'reference' ];

    protected $dates = ['deleted_at'];

    public function user() {
        return $this->belongsTo(User::class);
    }

    public function getOwnerPhone($id) {
        $user = User::select('phone')->whereId($id)->first();
        return $user->phone;
    }

    public function getOwnerEmail($id) {
        $user = User::select('email')->whereId($id)->first($id);
        return $user->email;
    }

    public function getBookerPhone($id) {
        $user = User::select('phone')->whereId($id)->first();
        return $user->phone;
    }

    public function getBookerEmail($id) {
        $user = User::select('email')->whereId($id)->first($id);
        return $user->email;
    }

    public function getBookedHostel($id) {
        return $hostel = Hostel::find($id);
    }
    
    public function booker() {
        return  $this->belongsTo(User::class);
    }

    
    public function hostel() {
        return $this->belongsTo(Hostel::class);
    }


    public function referalIncome($refId) {
        return $refIncome= Booking::where('referral', $refId)->sum('referral_income');

    }

    public function hostelDetails($id) {
        return Hostel::find($id);
    }

    public function finalizeBooking($data){
        
    }
    
    public function successfulBookingMail($data) {
        return Mail::to($data['user_email'])->send(new BookingSucessful($data));
    }

    public function successfulBookingToOwner($data) {
        return Mail::to($data['user_email'])->send(new NewBooking($data));
    }
    

    public function failedBookingMail($data) {      
        return Mail::to($data['user_email'])->send(new BookingFailed($data));
    }


    public function successfulInvoiceMail($data) {
        return Mail::to($data['user_email'])->send(new Invoice($data));
    }

    
}

Edit Your Profile
Update

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