biishmar

Senior Web Developer at RetailGenius

Experience

29,780

26 Best Reply Awards

  • Member Since 7 Months Ago
  • 120 Lessons Completed
  • 0 Favorites

24th April, 2018

biishmar left a reply on Remembering Id When Time Is Ended • 34 minutes ago

@dleroari When user click start dont save it in database, its better to save it in session.

21st April, 2018

biishmar left a reply on How To Manipulate Query Result Into JSON-ready Layout? • 2 days ago

@tinybot if you have used eloquent model and relation instead of query builder, you would have got the result like u expected, or else foreach your result and create an new array and structure that new array like u expected and return he new array

biishmar left a reply on Trying To Get Property Of Non-object • 2 days ago

@djay Your relation ruling returns null, thats why when u access name it says error, in controller try dd your result and check the results or use optional function if that name is optional

biishmar left a reply on Laravel $request->all() Is Empty • 2 days ago

@ayazshakoor Try checking by removing middleware from route group..

biishmar left a reply on Contact Form Email • 2 days ago

@LuckyLuke Your email is fine, this error coming in the ContactUsController return view at contactuspost function , there u didnt pass any variable.

biishmar left a reply on How To Properly Add A Package To My Project • 2 days ago

@WallyJ For front end packages better use npm or use cdnjs url in script tag...

biishmar left a reply on Contact Form Email • 2 days ago

@LuckyLuke Try to use with method in mailme class

public function build() {
        $subject = 'Contact Email';
        return $this->view('emails.mailme')->with([
                                                    "address" => $adress,
                                                    "myName" => $name,
                                                    "myMessage" => $msg
                                                ])->from($this->myAdress, $this->myName)->subject($subject);
    }

11th April, 2018

biishmar left a reply on Best Approach To Access Values From A Multidimensional Nested Array • 1 week ago

@bmm reason destination in two different node have different format, red contains multi-dimensional but yellow is normal array, cuz of different format yellow been omitted, check that format throughly

4th April, 2018

biishmar left a reply on Best Approach To Access Values From A Multidimensional Nested Array • 2 weeks ago

@bmm i only checked two level of node, can u send me that json so i can check it and provide u a right code?

biishmar left a reply on Validator Always Failing • 2 weeks ago

@ostamustafa No problem in validator function, double check your request..

3rd April, 2018

biishmar left a reply on Multiple Route Parameters Best Practice • 2 weeks ago

@tjcasner if team is belong to organisation, you dont have to get the team model from route binding ... try this

public function teamInfo(Organization $organization, $team)
{
    $organisation = $organization->load(['team' => function($q) {
        $q->where('id', $team); // you need to have a team relation in organisation model
    }]);

    return view();
}

biishmar left a reply on Best Approach To Access Values From A Multidimensional Nested Array • 2 weeks ago

@bmm without collapse u have to use foreach inside foreach, if you use collapse every thing comes inside single array, so one foreach is fine..

biishmar left a reply on View Composer Result To Controller? • 2 weeks ago

@lyonio Use view composer for specific view or all view and access the variable from that view directly, dont want to pass it to controller. check this for more detail https://laravel.com/docs/5.6/views#view-composers

biishmar left a reply on Remove Index.php From Laravel5.6 • 2 weeks ago

@vikdhr What i paste here was exact one

biishmar left a reply on Remove Index.php From Laravel5.6 • 2 weeks ago

@vikdhr Yes both r needed, if u find anything different in your index.php change it like this or copy paste this both index.php..

biishmar left a reply on Remove Index.php From Laravel5.6 • 2 weeks ago

@vikdhr Public/index.php

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <[email protected]>
 */

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels great to relax.
|
*/

require __DIR__.'/../bootstrap/autoload.php';

/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

$app = require_once __DIR__.'/../bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);

root/index.php

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <[email protected]>
 */

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
    return false;
}

require_once __DIR__.'/public/index.php';

check those both and tell you have same in ur both index.php

biishmar left a reply on Remove Index.php From Laravel5.6 • 2 weeks ago

@vikdhr cant see the code

biishmar left a reply on Remove Index.php From Laravel5.6 • 2 weeks ago

@vikdhr show me root/index.php and public/index.php

biishmar left a reply on Remove Index.php From Laravel5.6 • 2 weeks ago

@vikdhr Your htaccess is fine..

require_once __DIR__.'/public/index.php';

Does your index,php has a last line like this?

biishmar left a reply on How To Pass Or Access The Data From Middleware To All Route::resource Controllers? • 2 weeks ago

@dondo You cant pass variables from middleware to controller

app/CustomClass/Product

Class Product {
        public static function getSomething()
    {
        return ["a", "b", "c"];
    }
}

Controller/ProductController.php

class ProductController extends Controller
{
    protected $store;
    
    function __construct(  )
    {
        // can use this class and function anywhere
        $this->store = Product::getSomething();
    }
    
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }
}

Dont forget to import Product in ProductController.

biishmar left a reply on Remove Index.php From Laravel5.6 • 2 weeks ago

@vikdhr

Show me index.php and .htaccess

biishmar left a reply on Best Approach To Access Values From A Multidimensional Nested Array • 2 weeks ago

@bmm

$collection = collect($array["node"]);
        
$destination = $collection->pluck('links.destinations.destination')->collapse();

biishmar left a reply on Remove Index.php From Laravel5.6 • 2 weeks ago

@vikdhr

Just doing 2nd step is enough

2nd April, 2018

biishmar left a reply on To Many Request Getting Internal Server Error 500 • 3 weeks ago

@johnhenry2525 Seems like its CSRF problem

biishmar left a reply on What's The Best Way To Pull Data From Multiple Sources In Eloquent? • 3 weeks ago

@ashitvora

$post = Post::where('user_id',$user_id)->latest()->paginate();
$comment = Comment::where('user_id',$user_id)->latest()->paginate();

U cant make union of this both..

biishmar left a reply on What's The Best Way To Pull Data From Multiple Sources In Eloquent? • 3 weeks ago

@ashitvora

I want to pull data which contains both Posts & Comments made by a specific User sorted in descending Order and Paginated.

Whats a meaning of this? u didnt mention called UNION in your question

1st April, 2018

biishmar left a reply on Add Custom Message To Message Bag Without Validation • 3 weeks ago

@janakaontomatrix

return back()->withErrors($message_bag);

biishmar left a reply on How Do I Properly Sort This Distant Relationship • 3 weeks ago

@nexxai You cant sort by the parent by child in eloquent query, have to use join as normal query builder relationship.

30th March, 2018

biishmar left a reply on What's The Best Way To Pull Data From Multiple Sources In Eloquent? • 3 weeks ago

@ashitvora

User::with(['posts' => function($q) {
    $q->latest();
}, 'comments' => function($q) {
    $q->latest();
}])->paginate(10);

29th March, 2018

biishmar left a reply on Eloquent Collection And Clause/operators Didn't Supported • 3 weeks ago

@nicolalanzoni

$persons = Person::all();

$doePersons = $persons->where('name', 'like', '%doe%'); // this is collection where, syntax is wrong

$doePersons->all();

28th March, 2018

biishmar left a reply on Search Whith Laravel • 3 weeks ago

@IT2704 try jquery library DATATABLE

biishmar left a reply on No Application Encryption Key Specified Random Errors • 3 weeks ago

@PaulDiamant Upgrade your laravel app, might fix this problem

biishmar left a reply on Csrf Token Question • 3 weeks ago

@alexMafus if you remove your csrf from your app i can access all your post route directly and manipulate them.

27th March, 2018

biishmar left a reply on Variable Error • 3 weeks ago

@arctushar You have to use USE function on anonymous function get a variable that is outside the anonymous function.

biishmar left a reply on Code Update For PHP 7 • 3 weeks ago

@AquinoBR

  • You better learn laravel first before you start coding on laravel framework, they have lots of resources to help through your problem

biishmar left a reply on Why My Json Data Does Not Show From API Database • 4 weeks ago

@towhid

  • That third party api, was it created by your company or other company api?

26th March, 2018

biishmar left a reply on Why My Json Data Does Not Show From API Database • 4 weeks ago

@towhid

  • you have to learn laravel web first for the basic flow of laravel.
  • then learn the api section.
  • I dont know why u creating your own api, if u want to access third party api..

biishmar left a reply on Creating A "tenancy Between Two Users" • 4 weeks ago

@andremac96

Create user table for common data like id, name, address, email, password like that, for specific data to tenant or landlord create another two table and insert that data to these table and connect it as one to one relationship.

At retrieve part using role connect the relation..

biishmar left a reply on How To Get Data From Api • 4 weeks ago

@towhid

Do you want to create api for ur web service or access an third party api for your web app?

biishmar left a reply on How To Change Base Url In Laravel • 4 weeks ago

@ajitdas

Create a middleware and check if the user is guest, user without subscription or subscribed user, according to this create the session variable as base url and save it,

by this every time they access some url, u can check this session and redirect it

biishmar left a reply on Passing Id Parameter From Main View To Parial View With View Composer? • 4 weeks ago

@sekar_nat

View composer used to send data to the view which displays all the pages like sidebar or navigation bar

If u want to pass it through include just pass data to view from controller and can access same variable in include partials..

biishmar left a reply on How Can I Hide Admin Routes? • 4 weeks ago

@Tarasovych

Create middleware, check that user have admin access or not and redirect to home page with message and display it..

biishmar left a reply on How To Change Base Url In Laravel • 4 weeks ago

@ajitdas

Use route name in every route, so when u want to call specific url use route function and call, if u want to check url then use request is function

route('route-name'); // this gives full url of that route
request()->is('/checking-name') // this return true or false if name available in url

biishmar left a reply on Receive All Users(model Objects) To JavaScript Variable • 4 weeks ago

@dabnad

@if(Auth::user()->isAdmin > 0)
    <script type="text/javascript">
        window.usersCalendar [email protected](App\User::where('isAdmin','=',0)->get());
    </script>
    @endif 

biishmar left a reply on Pass An Array Of Url Parameters To Controller • 4 weeks ago

@phpmaven Route

Route::get('/{parameter}.html', '[email protected]')

Controller

public function show( $parameter )
    {
        $param = explode( '-', $parameter);
        
        $paramLength = count($param);
        
        // According to length redirect to specific view with data
    }

biishmar left a reply on Migrate For Testing Database • 4 weeks ago

@m.donicova

Did you create database schema for tables?

biishmar left a reply on Retrieving Elements Of Relationship Not Working • 4 weeks ago

@bigweld86

$this inside order class create instance for order class not eloquent model class

25th March, 2018

biishmar left a reply on Fetching A Specific Field Value Within In The Nested Properties Of JSON Formatted Data. • 4 weeks ago

@abudo

$json = json_decode( file_get_contents( public_path( 'json/example.json' ) ) ); //get json from file, file path is just example.

$question = collect($json->levels)->pluck('quests')->flatten()->pluck('quest.questions');
// gets all the question

//if you want in single array use flatten function at the last.

I tested it working fine

23rd March, 2018

biishmar left a reply on Custom Attributes On Elequote • 1 month ago

@Mohemos

->with(['department:id,name','customer:id,name'])

                ->selectRaw('sales.quantity * sales.price as amount')

                ->get(); 

biishmar left a reply on Laravel - Generate Unique Order Number • 1 month ago

@Rainieren

  • Are you sure you want to create unique order number in incremental value, i dont see anything unique here, just same as primary key.
  • If i were you i would create alpha-numerical for unique order number.
Edit Your Profile
Update

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