1. B

    Conflict in routing between Laravel Nova and Dingo API

    I have a Laravel API server which only has one web route (test page), everything else is controlled via dingo/api package and all is working correctly. In config/api.php I've set 'prefix' => env('API_PREFIX', '/') as it's only an API server. I've since installed Laravel Nova and kept getting...
  2. J

    How to get total of 2 arrays

    How do I get the total of 2 arrays. $array1 = [176, 0]; $array2 = [0, 160]; $combinedArrays = $array1 + $array2; // Actual result [176, 0] // Desired result [176, 160]
  3. M

    Laravel A non-numeric value encountered on functions

    What is the reason for the following error in code? The first time runs without problems, But the second time "A non-numeric value encountered" error occurs: public function checkName(string $name, string $path, string $extension, int $num) { if (Storage::exists("$path/$name"))...
  4. S

    Can I have a Laravel 4.2 blade include with it's own controller?

    I have a sidebar include file that is present on every page of the website I am working on. layout.blade: <div class="after-login buying-process-wrapper"> <!--page content--> {{ $content }} <!-- end of page content--> <!-- Sidebar --> @include('layout.sidebar') <!-- End of Sidebar...
  5. S

    ID received from post - send via ajax

    I would like to read the post id from html and send it via ajax to the controller. How can I get the ID of $ post->id and transfer it via ajax? Or is there a better solution to save the post seen by the user? @foreach ($posts as $post) <div id="post_container_{{$post->id}}" class="row...
  6. J

    Selecting Data from data base SQL

    I am selecting a data from the database, I can't seem to find the error $check = DB::select("select * from accounts where username = ".$data['username']); ERROR STATED:
  7. R

    Laravel Sorting user collection based by distance

    public function nearby() { $user = auth()->user(); $lat = auth()->user()->latitude; $lon = auth()->user()->longitude; $radius = 3; // km => converted to meter $angle_radius = (float)$radius / ( 111 * cos( (float)$lat ) ); // Every lat|lon degree° is ~ 111Km $min_lat =...
  8. M

    Why form::text takes up all width of browser viewport and how to make it narrower

    Good day to all I was creating laravel project and used form::text which I got from but in the view the textbox occupies all width of browser viewport and I am wondering how to make it narrower. The code: {{Form::text('BrandName', '', ['class'=>'form-control'])}}
  9. A

    Laravel - querying with select() and with() not working

    I'm querying a model with Relationships this way: $q = Repay::where('user_id', auth()->user()->id) ->with(['car:id,plate','place:id,title','offer:id,percent']) ->get() ->toArray(); It's working fine, so now I'm tyring to determine specific fields for main model. This way: $q =...