Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.

samalapsy

Developer at worshipnow.com.ng

Hire Me

Experience

5,250

4 Best Reply Awards

  • Member Since 8 Months Ago
  • 1 Lesson Completed
  • 1 Favorite

4th December, 2017

samalapsy left a reply on ModelNotFoundException When Queuing Mail • 1 week ago

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

27th November, 2017

samalapsy started a new conversation Notification • 2 weeks 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 • 3 weeks ago

@RamjithAp Client.php is the Twillo

use Twilio\Rest\Client;

samalapsy started a new conversation Sending SMS Via Twillo • 3 weeks 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 • 3 weeks ago

@mattsplat I placed it on production

18th November, 2017

samalapsy started a new conversation Execute Laravel Cron Jobs In Ubuntu • 3 weeks 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 • 3 weeks 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 • 3 weeks 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 • 1 month 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 • 1 month 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 • 1 month 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 ('.') • 1 month 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 • 1 month 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 • 1 month 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 • 1 month 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']) • 2 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 • 2 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 • 2 months ago

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

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

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

12th October, 2017

samalapsy started a new conversation Make Image Load Last • 2 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 • 2 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 • 2 months ago

Please can help with an example @cronix

my .env file is not accessible.

samalapsy left a reply on Css Not WOrking • 2 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 • 2 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 • 2 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 • 2 months 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 • 3 months 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 • 3 months ago

Someone should please help a brother here..!

samalapsy left a reply on Upload Laravel To Plesk Server • 3 months 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 • 3 months 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 • 3 months ago

I'm using the Laravel defaults

Auth::routes()

14th August, 2017

samalapsy started a new conversation Redirect To Dashboard • 3 months 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 • 4 months 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));
    }

    
}

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

@Snapey I've tried it it still the same error

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

Someone should kindly help me out with this

Table Structure

id, room_id, user_id, transaction_id, reference, price, discount_price, referral_income, referral, status

samalapsy left a reply on Select All From Table And Group By Email • 4 months ago

@extjac Structure already added

samalapsy started a new conversation Select All From Table And Group By Email • 4 months ago

I want to select all the entries in the referrals table and them group by referral

$referrals = Booking::whereNotNull('referral')->groupBy('bookings.referral')->orderBy('referral_income', 'DESC')->get();

This is the error I got

SQLSTATE[42000]: Syntax error or access violation: 1055 'bookings.id' isn't in GROUP BY (SQL: select * from `bookings` where `referral` is not null and `bookings`.`deleted_at` is null group by `bookings`.`referral` order by `referral_income` desc)

Please note that my Referral column has been made an index on the database.

Thank you

9th August, 2017

samalapsy left a reply on Dynamic Route Prefix • 4 months ago

@modestas Nope I don't, I think an illustration would be clear enough for me

Thanks

8th August, 2017

samalapsy started a new conversation Dynamic Route Prefix • 4 months ago

I have a column that distinguish each user on the DB. Please how can I change my route prefix using a condition (i.e check if User is admin or not) and then change the prefix based on the user role?

for admin I want to have

domian.com/admin/dashboard

for user I want to have

domian.com/user/dashboard

Thanks

6th August, 2017

samalapsy left a reply on How To Write Eloquent OrderBy() To Put Null Columns To The Last • 4 months ago

This is not still sorting the code..

orderByRaw('-images_id', 'DESC')

samalapsy started a new conversation How To Write Eloquent OrderBy() To Put Null Columns To The Last • 4 months ago

Please hoe can I write an eloquent query to sort result by a column making all the null columns item appear last. Here is my code

->orderBy('images_id', 'DESC')  // This should show the ones with value first
->distinct()->Paginate(24);

31st July, 2017

samalapsy left a reply on Search With Array Multiple Parameters • 4 months ago

This is how my route looks like

Route::any('/filter?room={room}&budget={budget}&proximity={$proximity}&amenities={amenities}', '[email protected]')->name('advanced_search');

30th July, 2017

samalapsy left a reply on Search With Array Multiple Parameters • 4 months ago

Thi is how my request query would look like

array:4 [
  "budget" => "5000"
  "room_type" => "Single Rooms"
  "amenities" => array:3 [
    0 => "Beds in room"
    1 => "Running Water"
    2 => "Wardrobe"
  ]
  "proximity" => "Very Close"
]

This is what I have in my url

http://localhost/prj/public/search/advanced?budget=5000&room_type=Single+Rooms&amenities%5B%5D=Beds+in+room&amenities%5B%5D=Running+Water&amenities%5B%5D=Wardrobe&proximity=Very+Close

How can I make this URL a Clean and SEO friendly one

samalapsy started a new conversation Search With Array Parameters • 4 months ago

I have an advanced search implementation on my website, where I have to display the selected or checked items (from a checkbox) on th url, please how can I achieve this and also how can I remove _token from the search parameters.

Thanks You

samalapsy left a reply on Validation • 4 months ago

@kheengz This is what I have now and it's working fine..

phone' => [
    'required',
    'numeric',
    'digits:11',
    \Illuminate\Validation\Rule::unique('users')->ignore($this->id, 'id')
]

Thanks...

samalapsy left a reply on Validation • 4 months ago

@kheengz This is the error it throws

Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Rule' not found

This is what I have

$rules = [
            'name' => 'required|string|min:5',
            //'phone' => 'required|numeric|digits:11|unique:users, phone, '.$this->id
            //'phone' => 'required|numeric|digits:11|exists:users'
'phone' => [
    'required',
    'numeric',
    'digits:11',
    \Rule::unique('users')->ignore($this->id, 'id')
]

28th July, 2017

samalapsy left a reply on Creating Folder From A Subdomain In Laravel Into Main Domain In Laravel • 4 months ago

yes they are on the same physical servers

samalapsy left a reply on Creating Folder From A Subdomain In Laravel Into Main Domain In Laravel • 4 months ago

If I understand what you just said..It means it's not possibles....right....If yes

What about Uploading and Image from the subdomain to the main domain..is that still possible too..?

samalapsy started a new conversation Creating Folder From A Subdomain In Laravel Into Main Domain In Laravel • 4 months ago

I have 2 laravel files on my website, one is on a subdomain {sub.domain.com} and the other on the main domain {domain.com}.

I want to upload an image into the main public_html folder from the subdomain using Image intervention

The code below creates dynamic folder if it's not existing..

    $path = "uploads/listings/house/" . $slug;

    if(!File::exists("http://domain.com/".$path)){
            File::makeDirectory("http://domain.com/". $path, 0777, true);
            \Log::info('Driectory ' .$path. ' was created');
        }else{
            \Log::info('Driectory ' .$path. ' was NOT created');
        }

This code get the Image, add a watermark and save to the location created above

        $fileName = md5(time() .$image->getClientOriginalName()) ."." . strtolower($image->getClientOriginalExtension());
        $img = Image::make($image->getRealPath());
                
        // Main Photo
        $img->fit(1080, 620)->insert(public_path('img/logo.png'), 'center')->save($path . '/' . $fileName); 
        //Create thumbnail
        $img->fit(300, 350)->save($thumbnailPath . '/' . $fileName); 

#The Issue

Trying to Upload, I receive a log message that the folder has been createdAfter having this, I get this error

Intervention\Image\Exception\NotReadableException: Image source not readable in /home2/username/laravel/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php:339

How can I achieve this

20th July, 2017

samalapsy left a reply on Mass Assignment Using UpdateOrCreate Method • 4 months ago

@cronix THank You. I'll check it out.

Edit Your Profile
Update

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