biishmar

Senior Web Developer at RetailGenius

Experience

36,720

30 Best Reply Awards

  • Member Since 10 Months Ago
  • 156 Lessons Completed
  • 0 Favorites

25th June, 2018

biishmar left a reply on Advanced User Permissions • 3 weeks ago

@misvijay U can use same logic that u have done in codeigniter or put the same logic in middleware and menu to constraint the permission according to role.

biishmar left a reply on MethodNotAllowedHttpException Only Production • 3 weeks ago

@SANTI1111 try this

php artisan cache:clear

biishmar left a reply on Trying To Get Property Of Non-object • 3 weeks ago

@irankhosravi try this

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

22nd June, 2018

biishmar left a reply on Connection Refused • 4 weeks ago

@teguh_rijanandi check your DB_HOST value, i dont think it should be 127.0.0.1.

biishmar left a reply on Json • 4 weeks ago

@chagouani just return the taches it automatically become json

return $taches;

biishmar left a reply on Whats Mean No Such File Or Directory • 4 weeks ago

@teguh_rijanandi Show your db config and env file. u might connecting with sqlite i think so.

21st June, 2018

biishmar left a reply on BadMethodCallException In Controller.php Line 283: Method [postEmail] Does Not Exist. • 1 month ago

@jackym

In forgotPasswordSubmit function, u r calling postEmail function

$response = $this->postEmail($data);

the above line indicate u r calling postEmail function but i couldnt find that function in UserController

biishmar left a reply on BadMethodCallException In Controller.php Line 283: Method [postEmail] Does Not Exist. • 1 month ago

@jackym Need to see UserController, cuz error happens on that class.

biishmar left a reply on Problem With Method "show" In My Controller • 1 month ago

@vasiliy_v r u sure u have data in database with id of 1?

biishmar left a reply on BadMethodCallException In Controller.php Line 283: Method [postEmail] Does Not Exist. • 1 month ago

@jackym r u using inbuilt forgot password function or u create on your own?

23rd May, 2018

biishmar left a reply on How To Refer Outer Table In A Subquery • 1 month ago

@ashwini7 if u want to use A.C table value,

AB::with(['A', 'B', 'A.C' => function($query) {
    $query->where() // here u can get the C table value not outside
}]);

biishmar left a reply on Selecting Laravel Version • 1 month ago

@Nagamma its depends on the php version, if u r using 5.6 stay at laravel version 5, if u r using latest version of php u can download latest version of laravel

biishmar left a reply on Populate Database In Laravel • 1 month ago

@rory it's better to create those in sql file and u can run those using mysql cmd source command its fast.

22nd May, 2018

biishmar left a reply on Allow Only The User To See His Edit And Delete ?? • 1 month ago

@belykia Use laravel authorization, check this here https://laravel.com/docs/5.6/authorization

biishmar left a reply on HasMany Relationship To Model And Continue Use Chain Methods • 1 month ago

@zhezhebie this function will run everytime u update any data, i dont think this is the right code for u..

biishmar left a reply on Redirect()->intended('default') Is Not Working As Expected? • 1 month ago

@GTHell What do u mean profiel page is not static? any way after u login u suppose to redirect somewhere that is profile page, i think there is only one route for profile page, if u want to redirect the user to the page before they logged in then u got to capture that url and redirect

21st May, 2018

biishmar left a reply on Redirect()->intended('default') Is Not Working As Expected? • 1 month ago

@GTHell

#try to use this

redirect()->route('route-name-for-profile-page');

biishmar left a reply on HasMany Relationship To Model And Continue Use Chain Methods • 1 month ago

@zhezhebie

#instead of this
$level->update(['status' => 4]);
$units->update(['status' => 4]);
$lessons->update(['status' => 4]);
        
#try this
$modelnameforlevel::whereIn('id', $level->pluck('id'))->update(['status' => 4]);
$modelnameforunit::whereIn('id', $level->pluck('id'))->update(['status' => 4]);
$modelnameforlessons::whereIn('id', $level->pluck('id'))->update(['status' => 4]);

18th May, 2018

biishmar left a reply on Get Multiple Condition Into Array • 2 months ago

@kankai You are accessing a database too much, this will make your server cpu to 100%, never do the database access inside loop... Ever heard of N + 1 problem?

biishmar left a reply on Is There A Way To Make The Helper Function Str_random Return Only Letters From A-z And Not Include Numbers? • 2 months ago

@p0t4t0 use this function

function generateRandomString($length = 10) {
    $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}

biishmar left a reply on API Resources • 2 months ago

@sghimire Author have many Books and Books should belong to Author. This is how relationship works with book and author, if its many to many use belongsToMany function.

biishmar left a reply on Middleware Causes Route Note Defined Error..? • 2 months ago

@Jman you should use authorization for this, check it here https://laravel.com/docs/5.6/authorization

biishmar left a reply on How To Fetch Data From Api In Laravel • 2 months ago

@hidayat3676 try cURL

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=Arsenal",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Cache-Control: no-cache",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

the result is not array its json so use json_decode. this code is pure cURL or ucan use guzzlehttp package from composer..

biishmar left a reply on How To Use Template With Laravel? • 2 months ago

@hanisster create js and css file in public folder and access those by /public/bootstrap.css, this will retrieve bootstrap file if u have inside public folder, whatever the template is if they have only html and css and js , can be use in laravel, if u have more doubt. check laravel from scratch tuttorial here.

biishmar left a reply on How Not To Use DB In The Following Query Having A Subquery • 2 months ago

@Quadram Create a pub model by referring laravel site then try this query..

Pub::where('distance', '<', $distance)->selectRaw('*, (6371 * acos(cos(radians(40.4169473)) * cos(radians(latitude)) * cos(radians(longitude) - radians(-3.7035285)) + sin(radians(40.4169473)) * sin(radians(latitude)))) AS distance')->orderBy('distance')->get();

biishmar left a reply on Return Foreach Loop • 2 months ago

@Lordgreymaul Create a variable as an array and push those value to that array

public function getMailbox() {
            $messages = LaravelGmail::message()->unread()->preload()->all();
            $messagesArray = [];
            foreach($messages as $message) {
                $modifiedData["id"] = $message->getId();
                $modifiedData["date"] = $message->getDate();
                $modifiedData["from"] = $message->getFromEmail();
                $modifiedData["email"] = $message->getPlainTextBody();
                
                $messagesArray[] = $modifiedData;
            }
            return compact('messagesArray');
        }

11th May, 2018

biishmar left a reply on Profile Photo Update Failure • 2 months ago

@abudo if u r forcing https then do it in server or .htaccess file.

biishmar left a reply on How Do I Combine Three Foreach Loops Into One ? • 2 months ago

@HopesAreMiracle group by your result by code it will become single record as u expected.

26th April, 2018

biishmar left a reply on Cant Understand Eloquent Distinct • 2 months ago

@alexMafus The reason you are seeing 5 john doe is those 5 rows have different value is different column, there might be a two john doe as different person, distinct only works if all the coulmns are equal with another row...

biishmar left a reply on New Changes Not Being Detected • 2 months ago

@tubbrez did u check that model file in server that what ever u changed are there?

biishmar left a reply on How To Get Data From Relationship Table Using Laravel Eloquent Model? • 2 months ago

@dreamxyz as long as primary and foreign key are same it will work, but using alpha-numeric in primary and foreign is not good practice, it will slowdown ur query submission time, better use numeric only

biishmar left a reply on Show Single Post In Laravel With Ajax Call • 2 months ago

@beginner_luck put console.log the data on button click and check the data from button from inspect element compare it.

biishmar left a reply on Cant Understand Eloquent Distinct • 2 months ago

@alexMafus Eloquent distinct is same as mysql distinct, distinct will unique the row when all coulmns r equal, first checkout what mysql distinct do.

biishmar left a reply on Query To Eloquent Model • 2 months ago

@Skizo @devk is right, he gave you the what u need author name and count of books.

The query above is simplified version of the actuall query so I dont really can use that.

i thought every one need simplified query for run their website fast.

I used this method already, I thought there are ways to use Eloquent relationships.

If u want eloquent way use Author as main model and call book relationship like @devk said.

25th April, 2018

biishmar left a reply on Image Upload Using Laravel And Ajax. • 2 months ago

@beginner_luck if u r creating a button for a row, u better create that through controller side and append to table

biishmar left a reply on How To Get The Second One? • 2 months ago

@haizone

$post = Post::where('column', $condition)->skip(1)->take(1);

biishmar left a reply on Union With Pagination - Laravel 5.6 • 2 months ago

@oroalej i dont know the solution for the current problem, if u want pagination that badly u have to create manually..

check this link https://laravel.com/docs/5.6/pagination#manually-creating-a-paginator

biishmar left a reply on Search In Eloquent • 2 months ago

@alexMafus what is the different between search name and unique name variables?

biishmar left a reply on Image Upload Using Laravel And Ajax. • 2 months ago

@beginner_luck after u storing that data , are you appending that info to table in same page?

biishmar left a reply on Union With Pagination - Laravel 5.6 • 2 months ago

@Agelios i aint the one asked this question

biishmar left a reply on Need Help Category Wise Post Show • 2 months ago

@towhid it seems u lack data, do u have any post data with a category_id as 6?

biishmar left a reply on Union With Pagination - Laravel 5.6 • 2 months ago

@oroalej would you please show that code? paginate only works for query builder, i think u calling paginate from collection.

biishmar left a reply on Url Previous - Moving Between More Pages • 2 months ago

@DarkHarden You want that query string to be attached while u go back or u dont want it?

biishmar left a reply on Image Upload Using Laravel And Ajax. • 2 months ago

@beginner_luck create that view button from controller and send it to ajax so u can append to your table.

biishmar left a reply on Redirect Problem • 2 months ago

@djay your solution at the login function, put the previous url in session and overwrite the redirect in login function..

biishmar left a reply on Need Help Category Wise Post Show • 2 months ago

@towhid i dont think post is belong to many category, did u create a column category_id in post table?

biishmar left a reply on Redirect Problem • 2 months ago

Dashboard means when you use php artisan make::auth

the default home page is dashboard

Change that default home page to dynamic one.

biishmar left a reply on Need Help Category Wise Post Show • 2 months ago

@towhid does your post table has category_id column? if not create a column name category_id.. it seems your relationship is

Category -> Post (One to Many) Post -> Category (Belong to One)

Create it in your post and category model.

Edit Your Profile
Update

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